Cup draw
Sign in to test your solution.
// 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);
}
}
You can submit as many times as you like. Only your latest submission will be taken into account.
Sign in to test your solution.