s = rnd(-1) -- seed for entropy locking
pal({[0]=0,-8,8,9,10,11,12,-4,0,-8,8,9,10,11,12,-4}, 1)
-- function to draw a regular polygon with any number of sides
-- x,y = center of polygon
-- r = radius of polygon
-- n = number of sides
-- a = angle of rotation, in turns (0-1)
function poly(x,y,r,n,a,c)
local i
for i=0,n-1 do
local t = i/n+a
local x1 = x+r*cos(t)
local y1 = y+r*sin(t)
local x2 = x+r*cos(t+1/n)
local y2 = y+r*sin(t+1/n)
line(x1,y1,x2,y2,c)
end
end
cls()
rot_angle = 0
::_:: -- draw loop start
if(rnd()>.9)poly(80,80,32,3,rot_angle,9) -- draw triangle
rot_angle += 0.0001 -- rotate triangle
-- dither
for i=0,200 do
local x = rnd(129)
local y = rnd(129)
local c = pget(x,y)-1
pset(x-1,y-1,c)
end
-- if rot_angle goes back to 0 (modulo) reset the seed
if(rot_angle%1==0)srand(s)
goto _
The description has the details but basically this is a #tootcart, with the source being able to fit within a mastodon post. Clicking/tapping the screen gets you a new generated ring of fire.
Generative Art
Hot