def shuffleBlock(self,cells,d,tlx,tly,cols,rows,width,height):
if tlx+cols < width and tly+rows < height:
temp = []
for row in range( rows):
for col in range( cols):
temp.append(d[cells[tlx+col][tly+row]])
temp = np.array(temp)
oldState = temp.copy()
np.random.shuffle(temp)
i = 0
for row in range( rows):
for col in range( cols):
d[cells[tlx+col][tly+row]] = temp[i]
i+=1
return oldState
else:
return []
评论列表
文章目录