예제 #1
0
파일: main.py 프로젝트: atomsk121/checkers
def main():
    parser = argparse.ArgumentParser(description='Please enter file path for game')
    parser.add_argument('path', type=str)
    args = parser.parse_args()
    move_iterator = create_move_iterator_from_move_file(args.path)
    game = CheckersGame(CheckerBoardFactory.build_board_from_preset(CheckerBoardPresets.standard_8_by_8))
    game_result = game.run_game(move_iterator)
    print(f'{os.path.basename(args.path)} - {game_result}')
예제 #2
0
 def test_empty_iterator(self):
     test_board = CheckerBoardFactory.build_board_from_preset(
         CheckerBoardPresets.standard_8_by_8)
     test_game = CheckersGame(test_board)
     move_iterator = create_move_iterator_from_list_of_lists([])
     print(test_game.run_game(move_iterator))