Пример #1
0
 static void Main(string[] args)
 {
     try
     {
         String path = @"F:\2 курс гргу КБ\ЯП\Solutions\lab02_Csharp\Task\DictionarySorted.txt";
         Console.Write("Minimum length: ");
         uint minLen = uint.Parse(Console.ReadLine());
         Console.Write("Maximum length: ");
         uint maxLen = uint.Parse(Console.ReadLine());
         Game game = new Game(path, minLen, maxLen);
         String curWord = game.GetCurrentWord;
         Console.WriteLine(curWord);
         while (!game.isEnd())
         {
             Console.WriteLine(/*"Current word: " +*/ curWord);
             Console.WriteLine("Player1. HP: " + game.GetPlayerHP(0) + " Score: " + game.GetPlayerScore(0));
             Console.WriteLine("Player2. HP: " + game.GetPlayerHP(1) + " Score: " + game.GetPlayerScore(1));
             Console.Write("Player" + (game.GetCurPlayer() + 1) + ". Enter: ");
             String word = Console.ReadLine(); word = word.ToUpper();
             game.NextGameStep(word);
         }
         Console.WriteLine(game.Winner());
     }
     catch (Exception ex)
     {
         Console.WriteLine("ERROR: " + ex.Message);
     }
 }