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); } }
static void Main(string[] args) { // string Path = Console.ReadLine(); Console.Write("Minimum length: "); int minL = int.Parse(Console.ReadLine()); Console.Write("Maximum length: "); int maxL = int.Parse(Console.ReadLine()); Game G = new Game("input.txt", minL, maxL); string Cur = G.GetCur; while (!G.isEnd()) { Console.WriteLine("Current word: " + Cur); Console.WriteLine("1. HP: " + G.GetHPPlayerOne() + " Score: " + G.GetScorePlayerOne()); Console.WriteLine("2. HP: " + G.GetHPPlayerTwo() + " Score: " + G.GetScorePlayerTwo()); Console.Write((G.GetCurPlayerNum + 1) + ". Enter: "); string Str = Console.ReadLine(); G.CheckWord(Str); } Console.WriteLine(G.WhoWon); }