Esempio n. 1
0
def play():
    global board, inplay
    print(helper.title)
    print(helper.instruction)
    helper.show_board(board)
    while inplay:
        # 根据玩家输入的方向移动棋盘。移动后要用 check_board 检查棋盘。
        pass
Esempio n. 2
0
def play():
    global board, inplay
    print(helper.title)
    print(helper.instruction)
    helper.show_board(board)
    while inplay:
        direction = input("按方向键移动数字:")
        if direction == UP:
            move_up(board)
        elif direction == DOWN:
            move_down(board)
        elif direction == LEFT:
            move_left(board)
        elif direction == RIGHT:
            move_right(board)
        helper.show_board(board)
        check_status(board)