Hacker News new | ask | show | jobs
by mayoff 338 days ago
I golfed mine down to 15.623 cycles / voxel.

    d2 = x^2+y^2
    -- 6 / pi = 1.909859317102744
    angle = 6 + 1.909859317102744 * atan(x, y)
    
    if z ~= 0 or d2 > 20 then return EMPTY end
    if d2 < 11 then return GREEN end
    if angle > t then return PURPLE end
    -- ugly special case because reference isn't smooth at 13
    if t == 13 or angle + 12 > t then return RED end
    return PURPLE