◀ checkerboard

Checkerboard

A flat checkerboard that never heard of modulo ꒰ᐢ˶ • ༝ •˶ᐢ꒱

← 02-intro-challenges-1

Checkerboard

GridCode SizeLeaderboardCyclesLeaderboardDate
5x5x514#364.800#70852026-02-23

Solution

return y==0 and x+z<<1&2|1

How it works

Flat plane at y==0, alternating WHITE(1) and BLACK(3) based on parity of x+z. The color expression x+z<<1&2|1 is the fun part: shift x+z left by 1 to move the parity bit into position, mask with &2 to isolate it (gives 0 or 2), then |1 to set the low bit (gives 1 or 3). No modulo, no parens around (x+z) since + naturally binds tighter than <<.