Пример #1
0
def start_game():
    choices1 = starting_inputs()
    game_board = Othello_logic.new_othello_board(choices1)
    Othello_logic.initial_four_chips(game_board, choices1)
    Othello_logic.count_of_chips(game_board)
    Othello_logic.visual_othello_board(game_board)
    current_turn = choices1[2]
    print("Turn:", current_turn)
    while True:
        if Othello_logic.full_board(game_board) == True:
            choices = insert_input()
            game_logic = Othello_logic.GameLogic(game_board, current_turn, choices1[4])
            if (
                game_logic.check_validity(choices[0], choices[1], current_turn, choices) == True
                and game_logic.insert_check(choices) == True
            ):
                if game_logic.check_both_players(choices) == True:
                    print("Valid")
                    game_logic.flip_vertical(choices)
                    game_logic.flip_horizontal(choices)
                    game_logic.flip_diagonal(choices)
                    current_turn = game_logic.player_turn(current_turn)
                    Othello_logic.count_of_chips(game_board)
                    Othello_logic.visual_othello_board(game_board)
                    print("Turn:", current_turn)
                else:
                    Othello_logic.winner(game_board, choices1[4])
                    break
            else:
                print("Invalid")
        else:
            Othello_logic.winner(game_board, choices1[4])
            break
Пример #2
0
def start_game():
    choices1 = starting_inputs()
    game_board = Othello_logic.new_othello_board(choices1)
    Othello_logic.initial_four_chips(game_board,choices1)
    Othello_logic.count_of_chips(game_board)
    Othello_logic.visual_othello_board(game_board)
    current_turn = choices1[2]
    print("Turn:",current_turn)
    while True:
        if Othello_logic.full_board(game_board) == True:
            choices = insert_input()
            game_logic = Othello_logic.GameLogic(game_board,current_turn,choices1[4])
            if game_logic.check_validity(choices[0],choices[1],current_turn,choices) == True and game_logic.insert_check(choices) == True:
                if game_logic.check_both_players(choices) == True:
                    print("Valid")
                    game_logic.flip_vertical(choices)
                    game_logic.flip_horizontal(choices)
                    game_logic.flip_diagonal(choices)
                    current_turn = game_logic.player_turn(current_turn)
                    Othello_logic.count_of_chips(game_board)
                    Othello_logic.visual_othello_board(game_board)
                    print("Turn:",current_turn)
                else:
                    Othello_logic.winner(game_board,choices1[4])
                    break
            else:
                print("Invalid")
        else:
            Othello_logic.winner(game_board,choices1[4])
            break
Пример #3
0
 def game_logic(self):
     """
     Creates our game logic objects
     and creates us an empty board
     """
     inputs = self._game_initial_inputs
     self._game_obj = Othello_logic.GameLogic(Othello_logic.new_othello_board(inputs),inputs[2],inputs[4])
     self._game_board = Othello_logic.initial_four_chips(self._game_obj._board,inputs)
Пример #4
0
 def game_logic(self):
     """
     Creates our game logic objects
     and creates us an empty board
     """
     inputs = self._game_initial_inputs
     self._game_obj = Othello_logic.GameLogic(
         Othello_logic.new_othello_board(inputs), inputs[2], inputs[4])
     self._game_board = Othello_logic.initial_four_chips(
         self._game_obj._board, inputs)