You basically break up the 5x5 binary pattern. Here's the explicit expression:
pattern = [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 1, 0], [0, 0, 1, 1, 1], [0, 0, 0, 1, 0]] for y in range(MAP_HEIGHT): for x in range(MAP_WIDTH): if pattern[x%5][y%5]: ...
This is a very simple and general approach, making it easy to modify the template.
martineau
source share