Need help with my risk game program – i need to insert 2 players, throw x number of dices, order them and confront the results of the 2 players

using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Text;

namespace ConsoleApp8 { class Program { static List names; static List dices; // [2, 3] static List player1Dices = new List(); static List player2Dices = new List();

    static List<string> PromptNames()     {         Console.Write("Nome del primo giocatore: ");         string player1 = Console.ReadLine();         Console.Write("Nome del secondo giocatore: ");         string player2 = Console.ReadLine();          List<string> names = new List<string>();          names.Add(player1);         names.Add(player2);         return names;     }      static int GetDieValue(string x, string msg)     {         Console.Write("{0}, {1} ", x, msg);         string rawDie = Console.ReadLine();         int parsedDie;         // qui devi usare do, while perché non sai a priori quante volte un giocatore potrebbe inserire un valore sbagliato         if (!Int32.TryParse(rawDie, out parsedDie))         {             Console.WriteLine("Meti un numero");             return GetDieValue(x, msg);         }         return parsedDie;     }      static List<int> PromptDices()     {         int p1Dices = GetDieValue(names[0], "con quanti dadi vuoi attaccare?");         int p2Dices = GetDieValue(names[1], "con quanti dadi ti vuoi difendere?");          return new List<int>() { p1Dices, p2Dices };     }     static void Play()     {         Console.WriteLine("{0} attacca con {1} dadi", names[0], dices[0]);         Console.WriteLine("{0} difende con {1} dadi", names[1], dices[1]);         CalculateResult();      }     static void CalculateResult()     {         System.Random random = new System.Random();         for (int i = 0; i <= dices.Count; i++)         {             player1Dices.Add(random.Next(1, 7));         }         Console.WriteLine("Prima: {0}{1}{2}", player1Dices[0], player1Dices[1], player1Dices[2]);         player1Dices = player1Dices.OrderByDescending(x => x).ToList();         Console.WriteLine("Dopo: {0}{1}{2}", player1Dices[0], player1Dices[1], player1Dices[2]);           for (int i = 0; i <= dices.Count; i++)         {             player2Dices.Add(random.Next(1, 7));         }         Console.WriteLine("Prima: {0}{1}{2}", player2Dices[0], player2Dices[1], player2Dices[2]);         player2Dices = player2Dices.OrderByDescending(x => x).ToList();         Console.WriteLine("Dopo: {0}{1}{2}", player2Dices[0], player2Dices[1], player2Dices[2]);      }         private static void PlayAgain(string x)     {         Console.WriteLine("Se vuoi finire il gioco scrivi Exit");         string Exit = x;         do         {             RunGame();             player1Dices.Clear();             player2Dices.Clear();         }         while (x != Console.ReadLine());                }      static void RunGame()     {         names = PromptNames();         dices = PromptDices();         CalculateResult();         Play();         PlayAgain();                          // generate random numbers - and sort them         // display results - compare dices         // repeat or quit?     }      private static void PlayAgain()     {         throw new NotImplementedException();     }      static void Main(string[] args)     {         RunGame();         Console.WriteLine("Thanks for playing");         Console.ReadKey();     } } 

}