def make_move(board, move, ch): """ Puts ch on board as dictated by move. Returns (game_decided, winner) """ board[move['row']][move['col']] = ch winner = board_winner(board) if winner is not None: return True, winner if not board_has_move(board): return True, None return False, None
def test_has_no_move(self): board = [[x_char, o_char, x_char], [x_char, o_char, x_char], [o_char, x_char, o_char]] self.assertFalse(board_has_move(board))
def test_has_move(self): board = [[x_char, o_char, x_char], [x_char, o_char, x_char], [o_char, None, o_char]] self.assertTrue(board_has_move(board))