I’d like to cover an infinite plane with 1x2 tiles with randomization, which means I’d like to have a function defined for every 1x1 grid on the plane that takes a pair of integers (the coordinates) as input, and output a direction among front, back, left and right. The neighboring tile in that direction share the same 1x2 brick with the current tile.
In other words, if a = (x, y), with x and y as integers, then f(a) is from {(1, 0), (0, 1), (-1, 0), (0, -1)}. then f(a) + f(a + f(a)) = 0.
How may I get such a procedural function?