TicTacToe: Use game objects instead of calling TicTacToeGame with self.

This commit is contained in:
neiljp (Neil Pilgrim) 2017-12-10 11:45:02 -08:00 committed by showell
parent b1dba0bd30
commit a7f7994302

View file

@ -287,8 +287,8 @@ class ticTacToeHandler(object):
return_content += TicTacToeGame.positions return_content += TicTacToeGame.positions
elif command == 'help': elif command == 'help':
return_content = TicTacToeGame.detailed_help_message return_content = TicTacToeGame.detailed_help_message
elif (user_game) and TicTacToeGame.check_validity(user_game, TicTacToeGame.sanitize_move(user_game, command)): elif (user_game) and user_game.check_validity(user_game.sanitize_move(command)):
move, printed_boards = TicTacToeGame.tictactoe(user_game, user_board, command) move, printed_boards = user_game.tictactoe(user_board, command)
mid_text = "My turn:\n" if printed_boards['after_computer'] else "" mid_text = "My turn:\n" if printed_boards['after_computer'] else ""
return_content = "".join([printed_boards['after_player'], mid_text, return_content = "".join([printed_boards['after_player'], mid_text,
printed_boards['after_computer'], printed_boards['after_computer'],