猫史档案馆


[求助]求大佬帮我查个虫

用户:关灯_黑_柚子关灯_黑_柚子查看:4 回复:3 评论:4 创建时间:2022-12-26T15:33:50


center_image

#2022年11月20日11:21:29
#Python

#变量
xy=[0,1,2,3,\
    0,0,0,0,\
    0,0,0,0,\
    0,0,0,0]
return_direction=False
temp_xy=False

def mobile(direction):
    global xy
#//////////ERROR//////////#
    if direction =='a'or'w':
        temp_xy=15
    if direction =='s'or'd':
        temp_xy=0
#//////////ERROR//////////#
    print('temp_xy='+str(temp_xy))
    print('direction='+direction)
    if temp_xy != False:
        print('Ln:21 True')
        if xy[temp_xy] == 0:
            print('Ln:23 True')
            if xy[temp_xy+1] == 0:
                print('Ln:25 True')
                if xy[temp_xy+2] == 0:
                    xy[temp_xy+2]=xy[temp_xy+3]
                    xy[temp_xy+3]=0
            else:
                print('Ln:25 False')
                xy[temp_xy+1]=xy[temp_xy+3]
                xy[temp_xy+3]=0
        else:
            print('Ln:23 False')
            print(xy[temp_xy])
            xy[temp_xy]=xy[temp_xy+3]
            xy[temp_xy+3]=0
    else:
        print('Ln:21 False')
def merge():
    pass
mobile('a')
print('xy='+str(xy))

center_image

(真麻烦,发个帖还要翻代码库,翻帖子)

(链接被屏蔽了,只能发图片)


回复

上一页1 页 / 共 1下一页
无敌版滑稽战神无敌版滑稽战神

???

点赞0


评论


SCS_user_LoeheodVOQSCS_user_LoeheodVOQ

#2022年11月20日11:21:29
#Python

#变量
xy=[0,1,2,3,\
    0,0,0,0,\
    0,0,0,0,\
    0,0,0,0]
return_direction=False
temp_xy=False

def mobile(direction):
    global xy
#//////////ERROR//////////#
    if direction == 'a' or direction == 'w':  # 第一种写法
        temp_xy=15
    if direction in ['s', 'd']:  # 第二种写法
        temp_xy=0
#//////////ERROR//////////#
    print('temp_xy='+str(temp_xy))
    print('direction='+direction)
    if temp_xy != False:
        print('Ln:21 True')
        if xy[temp_xy] == 0:
            print('Ln:23 True')
            if xy[temp_xy+1] == 0:
                print('Ln:25 True')
                if xy[temp_xy+2] == 0:
                    xy[temp_xy+2]=xy[temp_xy+3]
                    xy[temp_xy+3]=0
            else:
                print('Ln:25 False')
                xy[temp_xy+1]=xy[temp_xy+3]
                xy[temp_xy+3]=0
        else:
            print('Ln:23 False')
            print(xy[temp_xy])
            xy[temp_xy]=xy[temp_xy+3]
            xy[temp_xy+3]=0
    else:
        print('Ln:21 False')
def merge():
    pass
mobile('a')
print('xy='+str(xy))

点赞1


评论


伴雪纷飞伴雪纷飞

or衔接的是布尔式

点赞2


评论