def main(): game_board = GameBoard() keep_playing = True while keep_playing: print "Next Cards: {}".format(game_board.next_cards) print game_board in_keys = raw_input("Press awsd keys to move the board ulrd (or type quit): ") if in_keys == 'quit': print "Sorry to see you go!" break direc = key_map.get(in_keys, None) if direc is None: print "Invalid command! Try Again!" else: try: game_board.move_board(direc) except InvalidMoveException: print "You cannot move that direction! Try another!" if game_board.no_more_moves: print "Sorry Charlie, no moves remain for you!" print "Your score is: {:d}".format(game_board.calc_score())
def assert_board_shifts(self, direc, start_board, exp_board): game_board = GameBoard() game_board.board = start_board game_board.move_board(direc) self.assert_board_equal(game_board.board, exp_board)