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