Esempio n. 1
0
 def __init__(self) -> GameScenarioBase:
     game = [1, 1, 2, 2, 3, 3, 4]
     super().__init__(
         game_to_play=game,
         expected_game_results=game_scenario_utilities.
         generate_expected_output(game, {
             "PutValid": range(6),
             "PutWin": [6]
         }),
         expected_board_result=ExpectedCommandOutcomes.BoardUsed(
             [["2", "2", "2"], ["1", "1", "1", "1"]]),
         expected_history_result=ExpectedCommandOutcomes.GetUsed(
             ["1", "1", "2", "2", "3", "3", "4"]))
Esempio n. 2
0
 def __init__(self) -> GameScenarioBase:
     game_board_height = GameBoardConstructor().board_height
     game = [1] * game_board_height + [1]
     super().__init__(
         game_to_play=game,
         expected_game_results=game_scenario_utilities.
         generate_expected_output(
             game, {
                 "PutValid": range(game_board_height),
                 "PutColumFilled": [game_board_height]
             }),
         # Creates game board with one row and alternating ["1"], ["2"] ex [["1"],["2"],["1"]] for game_board_height = 3
         expected_board_result=ExpectedCommandOutcomes.BoardUsed(
             [["1"] if
              (game_board_height - current_row_int) % 2 == 0 else ["2"]
              for current_row_int in range(1, game_board_height + 1)]),
         expected_history_result=ExpectedCommandOutcomes.GetUsed(
             ["1"] * game_board_height))
Esempio n. 3
0
 def __init__(self) -> GameScenarioBase:
     game_board_constructor = GameBoardConstructor()
     game_board_height = game_board_constructor.board_height
     game_board_width = game_board_constructor.board_width
     game = game_scenario_utilities.generate_draw_game(
         game_board_height, game_board_width) + [1]
     super().__init__(
         game_to_play=game,
         expected_game_results=game_scenario_utilities.
         generate_expected_output(
             game, {
                 "PutValid": range(len(game) - 2),
                 "PutDraw": [len(game) - 2],
                 "PutAlreadyDraw": [len(game) - 1]
             }),
         expected_board_result=ExpectedCommandOutcomes.BoardUsed(
             game_scenario_utilities.generate_draw_game_board(
                 game_board_height, game_board_width)),
         expected_history_result=ExpectedCommandOutcomes.GetUsed(
             [str(column_int) for column_int in game[:-1]]))