Ejemplo n.º 1
0
    game.new_piece()
    game.place_piece()
    game.draw_area()

    while game.state == 'play!':

        print('Select your move!')
        move = input()
        while move not in constants.POSSIBLE_MOVES:
            print('Incorrect move, try to select again!')
            move = input()

        if game.avaliable_moves():

            if move == 'a':
                game.move_piece(side='left')
            elif move == 'd':
                game.move_piece(side='right')
            elif move == 'w':
                game.move_piece(side='counter_clockwise')
            elif move == 's':
                game.move_piece(side='clockwise')

        else:
            game.block_piece()

        # Remove last piece from the area
        game.clear_area()

        # Place piece with its new position
        game.place_piece()