コード例 #1
0
ファイル: othello_ui.py プロジェクト: walg/Othello
def get_win_condition(state: othello_logic.OthelloGameState) -> None:
    '''
    Asks th user to specify what the win condition of the game will be:
    the player who has the most or least pieces
    '''
    win_condition = {'1': "MOST", "2": "FEWEST", "": "MOST"}
    choice = _ask_choice("""\nPlease specify which player will win (default=MOST):
1) The Player with the MOST Pieces\n2) The Player with the FEWEST Pieces\n""", "12")
    state.set_win_condition(win_condition[choice])
コード例 #2
0
ファイル: othello_ui.py プロジェクト: walg/Othello
def get_win_condition(state: othello_logic.OthelloGameState) -> None:
    '''
    Asks th user to specify what the win condition of the game will be:
    the player who has the most or least pieces
    '''
    win_condition = {'1': "MOST", "2": "FEWEST", "": "MOST"}
    choice = _ask_choice(
        """\nPlease specify which player will win (default=MOST):
1) The Player with the MOST Pieces\n2) The Player with the FEWEST Pieces\n""",
        "12")
    state.set_win_condition(win_condition[choice])