def play_game(): onemoretime = 'suppose_yes' while onemoretime: print(greeting) cols = _get_cols() rows = _get_rows() turn = _who_move_first() top_left_color = _which_color_on_top_left() board = gamecode._get_new_board(turn, cols, rows, top_left_color) game = Othello(turn, cols, rows, board) rule = _get_winning_rule() print('\nGame Starts!\n') Othello.take_turns(game) print('\nGame Ends!\n') winner = gamecode.choose_the_winner(game._turn, game._cols, game._rows, game._board, rule) print('The winner is(are): ' + winner + '\nCongratulations!') print('\nThanks for playing the game. Do you want to play again?') onemoretime = (input( 'Press <ENTER> if you want to quit.\nOtherwise, press any key(s) on the keyboard.' )) print(ending)
def play_game(): onemoretime = 'suppose_yes' while onemoretime: print (greeting) cols = _get_cols() rows = _get_rows() turn = _who_move_first() top_left_color = _which_color_on_top_left() board = gamecode._get_new_board(turn, cols, rows, top_left_color) game = Othello(turn, cols, rows, board) rule = _get_winning_rule() print ('\nGame Starts!\n') Othello.take_turns(game) print ('\nGame Ends!\n') winner = gamecode.choose_the_winner(game._turn, game._cols, game._rows, game._board, rule) print ('The winner is(are): '+ winner + '\nCongratulations!') print ('\nThanks for playing the game. Do you want to play again?') onemoretime = (input('Press <ENTER> if you want to quit.\nOtherwise, press any key(s) on the keyboard.')) print (ending)
def _choose_the_winner(self): if gamecode._game_is_over(self._turn, self._cols, self._rows, self._logicboard): winner = gamecode.choose_the_winner(self._cols, self._rows, self._logicboard, self._rule) self._gamereport.set(winner + ' wins!')