mastermind.main package

class mastermind.main.game_controller.GameController[source]

Bases: object

Communication between MainUI and the gameboard.

classmethod get_game_parameters() tuple[int, int, int][source]

Get the number of colors, number of dots, and number of rounds from user.

classmethod resume_game(game_index: int) None[source]

Resume a saved game.

classmethod start_new_game(game_mode: str) None[source]

Start a new game.

classmethod validate_input(prompt: str, validator: Validator) Any[source]

Get user input and validate it.

class mastermind.main.game_history.GameHistoryManager[source]

Bases: object

Store and retrieve game history.

static generate_meta_data(game: Game) dict[source]

Generate meta data for the game.

static retrieve_continuable_games() DataFrame | None[source]
static retrieve_game_history() DataFrame | None[source]
static save_game(game: Game) None[source]

Save the game to a file.

mastermind.main.game_history.game_list_to_pandas(games: List[dict]) DataFrame | None[source]
mastermind.main.game_storage.list_continuable_games(stored_games)[source]

Return a list of the stored games that can be continued.

mastermind.main.game_storage.list_continuable_games_index(stored_games)[source]

Return a list of indexes of the stored games that can be continued.

mastermind.main.game_storage.retrieve_stored_games()[source]

Retrieve all stored games

class mastermind.main.main.MainUI[source]

Bases: object

Class to handle the user menu interface.

main_menu() bool[source]

Display the main menu and handle user input. Return whether the user want to exit.

new_game_menu() bool[source]

Display the new game menu and handle user input.

run()[source]

Run the game.

saved_game_menu()[source]

Display the saved game menu and handle user input.

mastermind.main.main.main()[source]