Ejemplo n.º 1
0
        public string Play_Game(GameMove playerMove, GameMove computerMove)
        {
            WinningMove winningMove = null;
            string      result      = "Player wins";

            if (Is_Tie(playerMove, computerMove))
            {
                return("Tie");
            }
            //This section will need refactoring
            if (Is_Computer_Winner(computerMove, playerMove))
            {
                result      = "Player Loses";
                winningMove = Get_Winning_Move(computerMove, playerMove);
            }
            else
            {
                winningMove = Get_Winning_Move(playerMove, computerMove);
            }

            return(Get_Winner_Text(winningMove, result));
        }
Ejemplo n.º 2
0
 private string Get_Winner_Text(WinningMove move, string result)
 {
     return($"{result}: {move}");
 }