Level 5 - One-dimension arrays and lists 0 van 9 activiteiten opgelost
  1. RPG inventory Nog niet opgelost
  2. Search for life Nog niet opgelost
  3. Two-dice pig Nog niet opgelost
  4. Random name generator Nog niet opgelost
  5. Cup draw Nog niet opgelost
  6. Feud Nog niet opgelost
  7. Darts Nog niet opgelost
  8. Cut the deck Nog niet opgelost
  9. London underground Nog niet opgelost
Volgende reeks Level 6 - Count controlled iterations and scope
Level 5 - One-dimension arrays and lists

Cup draw

Meld je aan om je oplossing in te dienen en feedback te krijgen.

// Cup draw program using System; using System.Collections.Generic; class Submission { // ------------------------- // Globals // ------------------------- static Random random_generator = new Random(); // ------------------------- // Subprograms // ------------------------- // Add teams to a list in pairs static void input_teams(List<string> teams) { } // Shuffle (Fisher-Yates) static void shuffle(List<string> list) { int n = list.Count; while (n > 1) { n--; int i = random_generator.Next(n + 1); string value = list[i]; list[i] = list[n]; list[n] = value; } } // Draw teams to play each other randomly static void draw_teams(List<string> teams) { } // ------------------------- // Main program // ------------------------- public static void Main(string[] args) { List<string> teams = new List<string>(); input_teams(teams); draw_teams(teams); } }