mapsize = 35 def test(x, y): if 0 <= x < mapsize and y >= 0 and y < mapsize: return 1