Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static async void cod() {
- /*
- * 1 - Mafia (Kill people)
- * 2 - Villager (Powerless)
- * 3 - Detective (Detect Mafia)
- * 4 - Doctor (Heal Player)
- * 5 - Farmer (Change Role)
- */
- //so i want to give 2 mafias, 2 villagers and one detective
- List<string> players = new List<string>() {"a","b","c","d","e","f","g","h","i","j","k","lmao"}; // TEMPORARY LIST!
- Dictionary<string, int> roles = new Dictionary<string, int>();
- // Shuffle players
- Random rand = new Random();
- //
- players = players.OrderBy(x => rand.Next()).ToList();
- //
- roles.Add(players[0],1); // a
- roles.Add(players[1],1); // b
- roles.Add(players[2],2); // c
- roles.Add(players[3],2); // d
- roles.Add(players[4],3); // e
- players.RemoveRange(0,5);
- if(players.Count != 0) {
- foreach(string s in players) {
- int a = 4 + (new Random(rand.Next(1,100))).Next(0,2);
- roles.Add(s,a);
- }
- }
- foreach(string s in roles.Keys) {
- Console.WriteLine(s + " - " + roles[s]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement