Advertisement
EESweetieBot

Thing

May 7th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.62 KB | None | 0 0
  1. public static async void cod() {
  2.                         /*
  3.                          * 1 - Mafia (Kill people)
  4.                          * 2 - Villager (Powerless)
  5.                          * 3 - Detective (Detect Mafia)
  6.                          * 4 - Doctor (Heal Player)
  7.                          * 5 - Farmer (Change Role)
  8.                          */
  9.                         //so i want to give 2 mafias, 2 villagers and one detective
  10.                         List<string> players = new List<string>() {"a","b","c","d","e","f","g","h","i","j","k","lmao"}; // TEMPORARY LIST!
  11.                         Dictionary<string, int> roles = new Dictionary<string, int>();
  12.                         // Shuffle players
  13.                         Random rand = new Random();
  14.                         //
  15.                         players = players.OrderBy(x => rand.Next()).ToList();
  16.                         //
  17.                         roles.Add(players[0],1); // a
  18.                         roles.Add(players[1],1); // b
  19.                         roles.Add(players[2],2); // c
  20.                         roles.Add(players[3],2); // d
  21.                         roles.Add(players[4],3); // e
  22.                         players.RemoveRange(0,5);
  23.                         if(players.Count != 0) {
  24.                             foreach(string s in players) {
  25.                                 int a = 4 + (new Random(rand.Next(1,100))).Next(0,2);
  26.                                 roles.Add(s,a);
  27.                             }
  28.                         }
  29.                         foreach(string s in roles.Keys) {
  30.                             Console.WriteLine(s + " - " + roles[s]);
  31.                         }
  32.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement