Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/361.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/list/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
有人能解释一下刚才发生了什么吗(Python)_Python_List_Pygame_Artificial Intelligence - Fatal编程技术网

有人能解释一下刚才发生了什么吗(Python)

有人能解释一下刚才发生了什么吗(Python),python,list,pygame,artificial-intelligence,Python,List,Pygame,Artificial Intelligence,我正在进行我的AI寻路(你不需要理解), 出于某种原因,当我在shell中执行此操作时,我的[3]列表正在扩展: templast.append([On[1]-1]) (节目搞砸后)为什么 程序没有崩溃,但这不是我的问题。 屏幕截图(忽略多余的打印,我试图缩小导致它的代码范围。) [1]上的是我的Y坐标 正在讨论的代码位于#Find Path (在底部部分下方。) 我的代码(超过200行长。:/) #设置Python---------------------------------------

我正在进行我的AI寻路(你不需要理解), 出于某种原因,当我在shell中执行此操作时,我的[3]列表正在扩展:

templast.append([On[1]-1])
(节目搞砸后)为什么

程序没有崩溃,但这不是我的问题。 屏幕截图(忽略多余的打印,我试图缩小导致它的代码范围。)

[1]上的
是我的Y坐标

正在讨论的代码位于#Find Path (在底部部分下方。) 我的代码(超过200行长。:/)

#设置Python------------------------------------------#
导入pygame、sys、random、time、webbrowser、os
从日期时间导入日期时间
#版本-------------------------------------------#
版本='1.0'
#设置pygame/窗口-----------------------------------------#
x=100
y=100
导入操作系统
操作系统环境['SDL\u视频窗口位置]=%d,%d%(x,y)
mainClock=pygame.time.Clock()
从pygame.locals导入*
pygame.init()
pygame.display.set_标题('寻路'+(版本)+'')
窗宽=200
窗高=200
screen=pygame.display.set_模式((窗口宽度,窗口高度),pygame.NOFRAME)
#字体--------------------------------------------#
basicFont=pygame.font.SysFont(无,20)
#图片------------------------------------------#
#音频------------------------------------------#
#颜色------------------------------------------#
白色=(255255)
黑色=(0,0,0)
灰色3=(105105)
格雷=(195)
灰色2=(127127)
红色=(255,0,0)
绿色=(0255,0)
蓝色=(0,0255)
黄金=(255215,0)
紫色=(115,0242)
#变量-------------------------------------------#
Map=['0000000000',
'0300000000',
'0000000000',
'0200000000',
'0000000000',
'0000000000',
'0000000000',
'0000000000',
'0000000000',
'0000000000']
列=0
行=0
节点={}
对于地图中的内容:
对于地图[行]中的内容VS2:
节点[''+(str(列))+','+(str(行))+'']=[列,行,int(whatevs2)]
如果whatevs2==“3”:
On=[列,行,[[列,行]]
列+=1
如果列==10:
列=0
行+=1
打开={}
闭合={}
#Rects-------------------------------------------#
#辩护-----------------------------------------#
def距离(位置、终点):
如果是位置!=[]:
如果int(位置[0])>>> x=[1,2,3]
>>> y=x
>>> y.append(10)
>>> x
[1, 2, 3, 10]
>>> y
[1, 2, 3, 10]
>>>