◀ simple-quadrant

Simple Quadrant

Fill one octant with PINK using nothing but arithmetic, no comparisons allowed! (¬‿¬)

← 01-replicube-tutorial-projects

#1 on the code size leaderboard!

Simple Quadrant

GridCode SizeLeaderboardCyclesLeaderboardDate
7x7x712🏆 #19.000#113582026-02-23

Solution

return min(x,y,z)//-4*-5

How it works

min(x,y,z) is positive only when all three coordinates are positive. Floor-dividing by -4 maps positive values (1..3) to -1 and everything else (0..-3) to 0. Then multiplying by -5 turns -1 into 5 (PINK) and keeps 0 as empty.

min(x,y,z)//-4*-5Result
1 .. 3-15PINK
-3 .. 000EMPTY

Both unary minuses are free (they follow operators), so -4 and -5 each cost just 1 token ✧