static void Main(string[] args) { Game game = new Game(); game.ComputerMove(); game.ComputerMove(); if (PrintStatusAndReturnWhetherGameHasEnded(game)) { return; } game.UserMove(); game.UserMove(); if (PrintStatusAndReturnWhetherGameHasEnded(game)) { return; } while (true) { Console.Write("Would you like to draw another card? (Y/N) "); string input = Console.ReadLine(); if (input == "Y" || input == "y") { game.UserMove(); if (PrintStatusAndReturnWhetherGameHasEnded(game)) { return; } } else if (game.ComputerScore > game.UserScore) { Console.WriteLine("Computer won :-("); return; } game.ComputerMove(); if (PrintStatusAndReturnWhetherGameHasEnded(game)) { return; } } //TestCardClass(); //TestDeckClass(); //TestGameClass(); }
private static void TestGameClass() { Game game = new Game(); game.ComputerMove(); PrintStatusAndReturnWhetherGameHasEnded(game); game.UserMove(); PrintStatusAndReturnWhetherGameHasEnded(game); game.ComputerMove(); PrintStatusAndReturnWhetherGameHasEnded(game); game.UserMove(); PrintStatusAndReturnWhetherGameHasEnded(game); game.ComputerMove(); PrintStatusAndReturnWhetherGameHasEnded(game); game.UserMove(); PrintStatusAndReturnWhetherGameHasEnded(game); game.ComputerMove(); PrintStatusAndReturnWhetherGameHasEnded(game); game.ComputerMove(); PrintStatusAndReturnWhetherGameHasEnded(game); }
static void Main(string[] args) { Game game = new Game(); game.ComputerMove(); game.ComputerMove(); if (PrintStatusAndReturnWhetherGameHasEnded(game)) return; game.UserMove(); game.UserMove(); if (PrintStatusAndReturnWhetherGameHasEnded(game)) return; while (true) { Console.Write("Would you like to draw another card? (Y/N) "); string input = Console.ReadLine(); if (input == "Y" || input == "y") { game.UserMove(); if (PrintStatusAndReturnWhetherGameHasEnded(game)) return; } else if (game.ComputerScore > game.UserScore) { Console.WriteLine("Computer won :-("); return; } game.ComputerMove(); if (PrintStatusAndReturnWhetherGameHasEnded(game)) return; } //TestCardClass(); //TestDeckClass(); //TestGameClass(); }
private void MyMove() { MyCards.Children.Add(GetImageForCard(_game.UserMove())); MyScore.Text = _game.UserScore.ToString(); }