◀ variable-outcomes

Variable Outcomes

Two crossing diagonals through a black plane, with colors that shift in the shadow side ✧˖°

← 01-replicube-tutorial-projects

Variable Outcomes

GridCode SizeLeaderboardCyclesLeaderboardDate
11x11x1130#6615.051#11132026-02-23

Solution

a=step(0,z)
return z==0 and 3 or x==-y and 9+a or x==y and 5+a

How it works

Three layers of geometry stacked with and/or:

CheckColorWhat
z==0BLACK (3)Full plane slice through the middle
x==-yYELLOW (9) or LIGHTGREEN (10)Anti-diagonal wall
x==yPURPLE (5) or RED (6)Diagonal wall

step(0,z) returns 1 when z is negative, adding 1 to the base color for the “shadow” side. The x==-y check comes first so it wins at the origin where both diagonals cross (*・ω・)ノ