void CPUGameRunner() { GestureCollection List = new GestureCollection(); ComputerPlayer Fred = new ComputerPlayer("Fred"); int playerRoundScore = 0; int compRoundScore = 0; while (playerRoundScore < 3 && compRoundScore < 3) { int userScore = User.MakeMove(); //replace optionsList User.PrintPlayerChoice(User.name, userScore); Console.ReadKey(); //replace optionsList int computerScore = Fred.MakeMove(); Fred.PrintPlayerChoice(Fred.name, computerScore); Console.ReadKey(); int value = CompareValues(userScore, computerScore); int score = RoundScore(userScore, computerScore, User.name, Fred.name); if (score == 1) { playerRoundScore++; } else if (score == 2) { compRoundScore++; } } PrintVictor(playerRoundScore, compRoundScore, User.name, Fred.name); Console.ReadKey(); RunProgram(); }
void PVPGameRunner() { GestureCollection List = new GestureCollection(); HumanPlayer PlayerTwo = new HumanPlayer(2); int playerRoundScore = 0; int playerTwoRoundScore = 0; while (playerRoundScore < 3 && playerTwoRoundScore < 3) { int userScore = User.MakeMove(); //replace optionsList User.PrintPlayerChoice(User.name, userScore); Console.ReadKey(); int userTwoScore = PlayerTwo.MakeMove(); //replace optionsList PlayerTwo.PrintPlayerChoice(PlayerTwo.name, userTwoScore); Console.ReadKey(); int value = CompareValues(userScore, userTwoScore); int score = RoundScore(userScore, userTwoScore, User.name, PlayerTwo.name); if (score == 1) { playerRoundScore++; Console.Clear(); } else if (score == 2) { playerTwoRoundScore++; Console.Clear(); } } PrintVictor(playerRoundScore, playerTwoRoundScore, User.name, PlayerTwo.name); Console.ReadKey(); RunProgram(); }
int RoundScore(int playerOneInt, int playerTwoInt, string playerOne, string playerTwo) { GestureCollection List = new GestureCollection(); int diff = CompareValues(playerOneInt, playerTwoInt); int winnerValue = Winner(diff, playerOneInt, playerTwoInt); int loserValue = Loser(diff, playerOneInt, playerTwoInt); string roundWinner = PlayerRoundWinner(winnerValue, playerOneInt, playerTwoInt, playerOne, playerTwo); List.PrintRoundWinner(winnerValue, loserValue, roundWinner); int winnerID = WinnerPlayerNumber(roundWinner, playerOne, playerTwo); return(winnerID); }