如何简化这个 if 语句?它是一个加号:http: //i.stack.imgur.com/PtHO1.png
如果语句完成,则在 x 和 y 坐标处设置一个块。
for y in range(MAP_HEIGHT):
for x in range(MAP_WIDTH):
if (x%5 == 2 or x%5 == 3 or x%5 == 4) and \
(y%5 == 2 or y%5 == 3 or y%5 == 4) and \
not(x%5 == 2 and y%5 == 2) and \
not(x%5 == 4 and y%5 == 2) and \
not(x%5 == 2 and y%5 == 4) and \
not(x%5 == 4 and y%5 == 4):
...