Here's my nomination, a "mandala" program in 24 lines running in LÖVE. All it does is rotate what you draw 48 times:
N = 48 -- numbers of axes of radial symmetry
Points = {}
Rotate = true
W, H = love.window.getMode()
function love.draw()
local g = love.graphics
g.setBackgroundColor(0.2,0.2,0.4)
g.setColor(0.8,0.8,0.8)
g.translate(W/2, H/2)
g.circle('fill', 0,0, 50)
for i=1,N do
g.line(-W,0, W,0)
if #Points >= 4 then
g.line(Points)
end
g.rotate(2*math.pi/N)
if not Rotate then break end
end
end
function love.keypressed()
Rotate = not Rotate
end
function love.mousemoved(x,y)
if not love.mouse.isDown(1) then
return
end
table.insert(Points, x-W/2)
table.insert(Points, y-H/2)
end
Why I like it:
- It takes whatever my kids throw at it and makes it beautiful. https://mastodon.social/@surprisetalk/115945522097395414
- Every run is unique, and they don't know what they're going to get.
- The code is simple and timeless as well. Easy to port to Processing or equivalent. Nothing cryptic or code golf about it.