alexthescott.bad plastic

-- bad plastic
-- alexthescott 
-- 21/1/1

-- new seed every day of the year 
srand(31*stat(81)+stat(82)) 

p1={2,136,8,142,143,10,135,7}
p2={129,1,140,12,15,143,14,7}
p3={129,131,3,139,11,138,135,7}
p4={130,141,136,137,142,143,15,135}
p5={129,1,131,141,140,13,6,7}
p6={128,130,132,4,137,142,9,10}
p7={128,133,141,5,13,6,15,7}
p8={1,131,3,139,9,10,8,14}
p9={128,130,133,134,15,14,142,7}
p10={130,136,8,137,13,140,12,7}
 
p={p1,p2,p3,p4,p5,p6,p7,p8,p9,p10}
c=rnd(p)
pal(c,1)

function forward()
	v=c[1]
	del(c,v)
	c[#c+1]=v
	pal(c,1)
end

function dist(p1,p2)
	return sqrt((p1.x-p2.x)^2+(p1.y-p2.y)^2)
end

function still_r(p)
	return osc*3.2<(sin(p.x/(osc_off2*100))+cos(clock/6+p.y/(osc_off1*100))-sin(p.x/(osc_off1*200)))
end

function still_l(p)
	return osc_n/2-0.25>cos(p.x/(20+osc_off1*100))+sin(p.y/(20+osc_off2*64)-clock/10)
end

function hill(p)
	return sin(p.x/(osc_off1*100)+clock/2)+cos(p.y/(osc_off2*100))0.5+osc_n/2
end

function seltzer(p)
	return osc_n-0.25>cos(p.x/(osc_off1*128)+clock/4)+sin(p.y/(osc_off2*128)-clock/6)
end

function seltzer_slow(p)
	return osc_n-0.25>sin(p.x/(osc_off1*64)+clock/4)+cos(p.y/(osc_off2*32)-clock/12)
end

function c_circ_fuzz(p)
	return rnd()*64*((1+osc)/2)>=dist(p,{x=64,y=64})
end

function c_circ(p)
	return 64*((1+osc)/2)>=dist(p,{x=64,y=64})
end

function c_circ_hori(p)
	if (p.y%2==0) return false
	return 64*((1+osc*2)/2)>=dist(p,{x=64,y=64})
end

function c_circ_vert(p)
	if (p.x%2==0) return false
	return 64*((1+osc*2)/2)>=dist(p,{x=64,y=64})
end

function c_circ_vert_s(p)
	slant=p.x*osc_n
	d=dist(p,{x=64,y=64})
	return (slant>=32 and slant<=40) or d>=osc_n*50
end

function c_circ_hori_s(p)
	slant=p.y*osc_n
	d=dist(p,{x=64,y=64})
	return (slant>=32 and slant<=40) or d>=osc_n*50
end

function c_square(p)
	return abs(p.x-64)