Sean's Tweetcarts - 2016

PICO-8 in 140 characters or less

--1. Untitled

a=sin(time())*1 
b=cos(time())*10 
for x=a,127,2 do 
for y=b,127,2 do 
c=pget(x,y) 
if c!=0 then 
pset(x+a,y+b,c+1) 
end 
end 
end 
run()
--2. Marching

a=0 b=0::s::cls()a+=b%2*2-1
b+=flr(abs(a)/8)
for x=-1,16 do
for y=-1,22 do
t=y*6+b%6
color(t%7+8)print("\140",x*8+a,t)end
end
flip()goto s
--3. Double Spiral

r=64::q::cls()for t=0,1,0.01 do
v=time()y=(t+v)%1-sin(v/5)a=y*r
s=sin(t)c=cos(t)pset(r+c*-a,r+s*a,y+8)pset(r+c*a,r+s*-a,y+8)end
flip()goto q
--4. Conical

::q::cls()v=time()for t=1-v/999%.0005,0,-.0005 do
a=t*99pset(cos(a)*a*(sin(v/3)+2)+64,sin(a)*a+a*2+cos(v/5)*9+23,t*8-v*3)end
flip()goto q
--5. Untitled

poke(24364,7)::q::t=time()print("/")color(t*9%8+8)s=2+sin(t/3)c=1+.5*cos(t/2)x=40+24*sin(t)y=40+24*cos(t/7)rect(s*x,s*y,c*x,c*y)flip()goto q
--6. Ring

s=sin
r=64::q::t=time()
for i=0,999 do
a=rnd()b=rnd(r)x=b*cos(a)y=b*s(a)color((a+t)*9%3)line(r+x*s(t/5),r+y*s(t/4),r+x,r+y)end
flip()goto q
--7. Ring Again

s=sin
r=64::q::t=time()cls()
for i=0,500 do
a=rnd()b=r
x=b*cos(a)y=b*s(a)color((a+t)*9%3)line(r+x*s(t/2),r+y*s(t/4),r+x,r+y)end
flip()goto q
--8. Pulse

cls()r=64::q::
t=time()/2
x=flr(rnd(r))*2.25-r
y=flr(rnd(r))*2.25-r
color((x*x*sin(t*2)+y*y*cos(t+y/r))/999%3+5)circ(x+r,y+r,1)goto q
--9. Current

::q::t=time()for i=0,999 do x=rnd(127) a=i/999 y=a*130 color(pget(x,y))line(x,y,x+cos(a/3)*sin(t/4)*9,y+sin(a/2)*cos(t/6)*9)end flip()goto q
--10. Untitled

s=sin::q::print('')t=time()for i=0,99 do
x=s(t/9+i/999)x=x*x*35-9*s(t)x=64+x*sgn(i%2-.5)circ(x+16*s(t/9),124,3,(i+x)/8%8-5)
end
flip()goto q
--11. Untitled

s=sin::q::print('')t=time()
for i=0,999 do
a=s(t/4+i/999+t/4)
b=a*a*35-20*s(t)
pset(b+9*s((b+a+t)/99)+45,i/999*128,i)
end
flip()goto q
--12. Hole

cls()t=time()/2
r=20
for x=-0,128,r do
for y=-0,128,r do
a=x-64+sin(t)*r
b=y-64+cos(t)*r
s=sqrt(a*a+b*b)
circ(x,y,s-8,7)  
end
end
run()
--13. rectfill

t=time()/2
r=20
for x=-0,140,r do
for y=-0,140,r do
a=x-64+sin(t)*r
b=y-64+cos(t)*r
s=sqrt(a*a+b*b)rectfill(x,y,s-8,s,x+y-t)  
end
end
run()
--14. Untitled

cls()t=time()q=84
for x=9,q,2 do
for y=9,q,3 do
a=x-q+32*sin(t)b=y-q+32*cos(t)s=sqrt(a*a+b*b)
line(x,y,s,s,(s*s/q/10+t)%5-2)  
end
end
run()
--15. Levy

t=time()n={0,0,3,cos(t)}cls()for i=1,10 do
l=#n
for j=1,l,2 do
c=n[j+1]d=n[j]add(n,n[l-1]-c)add(n,n[l-2]+d)pset(84+c,44+d,j*i)end
end
run()
--16. Sand

x=64
y=64
r=0
t=time()/9
a=t
for i=0,999 do
a+=i/(sin(t)+999)
r+=0.1
x+=cos(a)*r
y+=sin(a)*r
pset(x,y,(i%9-4)/i)
end
run()
--17. Untitled

cls()x,y,r,t=64,64,0,time()a=t/9
for i=0,999 do
a+=i/999
r+=i/999
x+=r*cos(a)
y+=r*sin(a)
c=(i-t*99)/16
circfill(x,y,c%8,(c-t)%8-5)end
run()
--18. Untitled

cls()x,y,r,t=64,64,0,time()a=t/4
for i=0,99 do
a+=sin(i/99)/9
r+=sin(i/99)/9
x+=r*cos(a)
y+=r*sin(a)
c=i/9-t*8
circfill(x,y,c%8,c)end
run()
--19. Spiral Launcher

cls()x,y,r,t=64,64,0,time()a=t/8
for i=0,999 do
a+=i/9^9
r+=i/11^4
x+=r*cos(a)
y+=r*sin(a)
c=(i-t*128)/16
circfill(x,y,c%8,c-i/99)end
run()
--20. Glyphs

s,p="\135\152\149",64::q::t=time()
x,y=rnd(128)-p,rnd(128)-p
c=abs(x)+abs(y)>sin(t/2)*p and y or x
b=t%3+1
?sub(s,b,b),x+p,y+p,c/32
goto q
--21. Untitled

::q::
cls()a,b,x,y,t=64,64,64,64,time()/9
for i=sin(t),99,cos(t)+1.1 do
x+=i*sin(i)
y+=i*cos(i)
line(a,b,x,y,i%5-8)
a,b=x,y
end
flip()goto q
--22. Untitled

::q::t=time()/3
for z=1,9,.1 do
y,a=9,0
for x=9,128,9 do
y+=sin(t+x/z)/z*99
rect(a,b,x,y,(z+x)%8-5)
a,b=x+1,y+z
end
end
flip()goto q
--23. Untitled

::q::z=time()s,c=9*sin(z),9*cos(z)for t=z,z+1,0.01 do
x,y=sin(t)*32+64,cos(t)*32+64line(x-s,y-c,x+s,y+c,7)circfill(x,y,7,0)
end
flip()goto q
--24. Loom

t,s,a=0,0,99
::q::
?""
t+=.004
s+=.003
for y=0,4 do
line(0,a+sin(t)*9+y,a,a+cos(t)*9+y,y)
line(0,a+cos(s)*9+y,a,a+sin(s)*9+y,y*7)
end
goto q
--25. Circle Trails

::q::
circ(64,64,32*(sin(time()/9)+1),15)
for i=0,99 do
x,y=rnd(127),rnd(127)
c=pget(x,y)*0.99
circ(x,y,2,c)
circfill(x,y,1,c)
end
goto q
--26. Square Trails

::q::
r=32*(sin(time()/9)+1)
rect(64-r,64-r,64+r,64+r,15)
for i=0,99 do
x,y=rnd(127),rnd(127)rect(x-1,y-1,x+1,y+1,pget(x,y)*0.99)
end
goto q
--27. Rebound

::q::cls()line(a,b,x,y,2)
a,b=x,y
t=rnd()x,y=64+43*sin(t),64+43*cos(t)
for x=x-2,x+2 do
for y=y-2,y+2 do
line(a,b,x,y,8)end
end
flip()goto q
--28. Untitled

c=0::q::
for x=0,128,8 do
for y=0,128,8 do
r=rnd(4)
c=peek((sin(time()/4)+1)*9999+9000+x*y)+8-c
rect(x-r,y-r,x+r,y+r,c)
end
end
flip()goto q
--29. Spiral Moire

r,t=2,0::q::cls()t+=1
for x=-(t/99%r),128,r do
for y=-(t/99%r),128,r do
rect(x,y,x+r,y+r,x*y/r)
end
end
flip()goto q
--30. Falling Moire

r,t=2,0::q::cls()t+=1
for x=-(t/8%r),128,r do
for y=-(t/8%r),128,r do
rect(x,y,x+r,y+r,x*2+y/8%4+y*x/300)
end
end
flip()goto q
--31. Fungi

cls()::q::t=time()q=127
for i=0,999 do
x=flr(rnd(32))*4
y=flr(rnd(32))*4
s=rnd(1.42)
circfill(x,y,s*s,pget(x,y)/7+14)
end
flip()goto q
--32. Islands

cls()a,b,r,f,t=0,0,rnd,flr,30
while t>0 do
a+=r(2)-r(2)
b+=r(2)-r(2)
for i=0,t do
circ(f(r()+a+8)*8,f(r()+b+8)*8,r(5),r(3)+5)
end
t-=1
end
--33. Warmup

s,t="=\134x",2::q::g,y=time(),(t*t)%129-4
t+=min(1,t/10000)
for i=-32,200,8 do
c=flr(i+g)%3+1
?sub(s,c,c),i+sin(g*2)*16,y,c+7
end
goto q
--34. Voronoi

r,s,v=rnd,srand,64
d=r()
::q::
x,y,m,c=r(v),r(v),v*v,0
for p=0,15 do
s(p+d)a,b=x-r(v),y-r(v)t=a*a+b*b
if(t

--35. Waterfall

cls()
::q::
for i=0,3000 do
x=rnd(127)
y=rnd(127)
circ(x,y+2,1,(pget(x,y)+1)%4+13)
end
flip()
goto q
--36. Waves

cls()
::q::
for i=0,999 do
x=flr(rnd(64))*2
y=flr(rnd(64))*2
circfill(x,y,1,
(pget(x+sin(time()/16)*8,y)+2)%4+13)
end
flip()
goto q
--37. Untitled

cls(2)::q::for i=0,3000 do
x=rnd(44)*3y=rnd(44)*3
x-=x%3
y-=y%3
c=pget(x-sgn(y%32-9),y+1)/3+
x%y/64+time()
rect(x,y,x+2,y+2,c%2-1)end
goto q
--38. Not Windows Solitaire

z=0::q::
z+=0.2
s=9*sin(z*2)
c=9*cos(z*3)
circfill(
sin(z+s)*64+64,
cos(z+c)*64+64,
5,
z%2*7)
goto q
--39. Snow

x,y=0,0::q::
cls()
srand()
x+=1
y+=1
for i=0,99 do
a=rnd(127)+x+sin(i/32+time())
b=rnd(127)+y
circfill(a%127,b%127,1,7)
end
flip()
goto q
--40. Untitled

cls()::q::for i=0,128 do
x=rnd(127)y=i
x-=x%6+1
y-=y%6+1
c=(((x+y))/16+time()*8)%7-5
rect(x,y,x+2,y+3,c)circ(x+1,y+1,2,c+1)
end
flip()goto q
--41. Explosions

r,c,p=rnd,circfill,64
for d=r(p),-300,-2 do
for i=0,999 do
a=r(128)
b=i/3
c(a,b,1,max(pget(a+(p-a)/3,b+(p-b)/3)-4))
end
c(p,p,d,d)
end
run()
--42. Sweaters

y,x,s=-10,-20,flr(rnd(999))
cls(3)::q::
y+=s%8+1
if(y>128)y,x=0,x+s%3+3,flip()
if(x>200)run()
?s,x,y,(x*y+s+y)%4-2
?s,120,122,10
goto q
--43. Tetronimos

cls()
p="2356545259"
i=rnd(#p)
i-=i%2
p="01"..sub(p,i+1,i+2)
d=sgn(rnd(2)-1)
for i=1,#p do
t=sub(p,i,i)
pset(64+flr(t/4)*d,64+t%4,7)
end
--44. XOR

::q::for i=1,128,3 do
x=rnd(127)y=i
x-=x%3
c=(bxor(sqrt(x),abs(y-64)/16)+time()*4)%11+7
rect(x,y,x+1,y+1,c)rect(x,y,x-1,y-1,c+1)end
goto q
--45. Rain

cls(1)::q::t=time()*16%4
for i=0,999 do
x=flr(rnd(64))*4+t
y=flr(rnd(64))*4+t
line(x,y,x-3,y-3,pget(x,y)/2+15)
end
flip()goto q
--46. Metaballs

r,z=rnd,99o=r()::q::srand(a)x=r(z)y=r(z)v=0srand(o)
for j=1,6 do
a=x-r(z)b=y-r(z)d=max(1-(a*a+b*b)/999)v+=d*d*4
end
a*=b
circ(x,y,1,v)goto q
--47. FUNCTION

camera(-48)cls()r=rnd::q::color(z)z=127,r()<.005 and print(cd)
for i=0,z do
x=r(z)y=r(z)c=pget(x,y) 
pset(x+(x-16)/16,y,c*.7)
end
goto q
--48. Spirographs

cls()r=rnd
s=r()for t=0,32767 do
x=64
y=64
a=0
srand(s)for i=1,r(4) do
d=r(64)
a+=r()/99*t
x+=d*cos(a)
y+=d*sin(a)
end
pset(x,y,a%3-r(9))end
--49. Fun Factory

i=0::q::cls(7)i+=.05
for x=-64,64,4 do
for y=-64,64,4 do
c=(x*x*sin(i/y)+y*y/cos(i/x))/999
circfill(x+64,y+64,c%3,c%5+8)end
end
flip()goto q
--50. Happy New Year!

memcpy(0,24576,300)::q::t=8*time()for x=0,127 do
for y=46,80 do
pset(x,y+sin(t/18+x/999)*48,sget((x/4+t)%64+24,y/4%9-4)+y/8+t)end
end
goto q