Page 1 2 3 4 5 6 7

Cart [#23842#] | Copy | Code | 2016-06-29 | Link
44

better etchasketch! ~118 characters (110 w/o clear-screen or random color)

 ```cls() x=0 y=0 while 1 do if(btn(0)) x-=1 if(btn(1)) x+=1 if(btn(2)) y-=1 if(btn(3)) y+=1 pset(x,y,7+rnd(9)) flip() end ```
P#23825 2016-06-29 12:20

:: guerragames

random circles might be fun too :)

P#23828 2016-06-29 12:33

:: Benjamin Soulé

Cart [#23833#] | Copy | Code | 2016-06-29 | Link
2

 ```t=0 while true do t+=1 cls(1) for x=0,63 do for y=0,63 do pset(x*2+y%2,y*2,8+(t/16+((x-32)/(y-32)))%8) end end flip() end ```
P#23834 2016-06-29 12:42

:: Blokatt

Cool!

You can just do "if(btn(0))x-=2", btw!
I'll have to try making something like this too, haha.
Also, thanks for retweeting my thing the other day!

P#23836 2016-06-29 12:45

ok here's a weird version of the etchasketch that makes a fat worm thing

Cart [#23843#] | Copy | Code | 2016-06-29 | Link
1

 ```cls() x=0 y=0 while 1 do if(btn(0)) x-=1 if(btn(1)) x+=1 if(btn(2)) y-=1 if(btn(3)) y+=1 circ(x,y,rnd(6),7+rnd(9)) flip() end ```
P#23844 2016-06-29 13:07

:: Blokatt

You can save 4 chars by getting rid of spaces in lines 4-7.

P#23845 2016-06-29 13:12

:: Blokatt

0 chars left.

 ```cls() x=0y=0 while 1 do if(btn(0))x-=1 if(btn(1))x+=1 if(btn(2))y-=1 if(btn(3))y+=1 circfill(x,y,sin(time())*3+5,7+sin(time())*5) flip() end ```

Alternatively:

 ```cls() x=0y=0t=0 while 1 do t+=.03 if(btn(0))x-=1 if(btn(1))x+=1 if(btn(2))y-=1 if(btn(3))y+=1 circfill(x,y,sin(t)*3+5,7+sin(t)*5) flip() end ```
P#23846 2016-06-29 13:17

whoa thats fuckin righteous :D love it! creates freaky noby noodles <3 so good

Cart [#23848#] | Copy | Code | 2016-06-29 | Link
0

P#23847 2016-06-29 13:26

:: Blokatt

Aww, thanks!
But it's still mostly your code, haha.

P#23849 2016-06-29 13:30

:: Danjen

What is the benefit of calling flip() here?

P#23850 2016-06-29 13:35

:: Mozz

im trying to shave 70 characters off of this:

 ```p={0x00,0x50,0x05,0x56,0x65,0x66,0x76,0x77} t=0 t+=0 cls() for x=0,64 do for y=0,120 do c=p[flr((rnd(4)+4-(((x - 32)^2+(y/2 - 28)^2))/(abs((64-t%128))+192))+1)] poke((0x6000+x+(y*0x40)), c) end end flip() ```

also, it seems to run only once then quit, so I might not understand how the first program in this thread works :P

edit - aaah I have to put the "while" to keep it going :P
edit edit - I also dont need to flip because im poking

P#23851 2016-06-29 13:35

:: zep

Cart [#23852#] | Copy | Code | 2016-06-29 | Link
7

 ```t=0 function _draw() cls()x=64 y=64 r=1 a=0 for i=0,150 do circfill(x,y,r/2,6+i%3) x+=cos(a)*r y+=sin(a)*r r+=1/4 a+=t/5 end t+=0.001 end ```
P#23853 2016-06-29 13:38

flip() is being called inside a while loop to draw the backbuffer to the screen. i havent actually counted characters to see if "while 1 do // flip() end" is less than the more proper "function _draw() // end" - they're pretty close so probably not saving much at this point?

ok i just counted and function _draw() saves 1 character!

trust zep to do it right <3

UPDATE - if you don't have to call flip() (because poke, memset, etc) then its def less space to just do "while 1 do /**/ end"

P#23854 2016-06-29 13:48

:: arnodick

This is a great idea!
Here is a weird static thing. I think it fits in 140 characters?

Cart [#23855#] | Copy | Code | 2016-06-29 | Link
0

 ```cls() while 1 do memset(0,rnd(3)+5,16) spr(0,rnd(256),rnd(256)) memset(0x3200,rnd(3)+5,128) sfx(1) end ```
P#23856 2016-06-29 13:53

whoa thats awesome :D

P#23857 2016-06-29 13:54

:: Mozz

Cart [#23858#] | Copy | Code | 2016-06-29 | Link
1

haha static all over today :p

 ```p={0x00,0x50,0x05,0x56,0x65,0x66,0x76}t=0 while 1 do t+=0 for x=0,63 do for y=0,127 do poke((0x6000+x+(y*0x40)),p[flr(rnd(7))])end end end ```
P#23860 2016-06-29 13:58

:: arnodick

A slightly different one, sounds like a broken computer :D

Cart [#23859#] | Copy | Code | 2016-06-29 | Link
0

 ```cls() while 1 do memset(0,rnd(16),16) spr(0,rnd(128),rnd(128)) memset(0x3200,rnd(256),128) sfx(1) end ```
P#23861 2016-06-29 13:58

:: arnodick

Oh, Mozz yours looks much more authentically static than mine!

P#23862 2016-06-29 13:59

:: Mozz

I really like how "smooth" that effect looks in yours though!

P#23863 2016-06-29 14:01

yea im expecting a lot of rnd based screensavers for this, button input just dominates your code otherwise. i wanna try some one-button stuff tho, thats at least interactive and still leaves lots of code space...

like these programs that just go straight to the front buffer too :D LIVIN LIFE ON THE EDGE

hmmm

how close can i get to canabalt-esque runner

P#23864 2016-06-29 14:03

:: arnodick

Oh good idea with one button

P#23865 2016-06-29 14:06

here's a little jumping circle hmmmm

 ```x=-4y=0j=0 function _draw() cls() if(btnp(2))j=-10 j+=1 y+=j y=min(99,y) circfill(10,y,4,11) x-=2 if(x<-4)x=99 circfill(x,99,4,12) end ```

updated to add a little obstacle hrrmmm

would be more efficient to make it run upside down haha

P#23867 2016-06-29 14:11

:: arnodick

A kind of controllable one

Cart [#23868#] | Copy | Code | 2016-06-29 | Link
0

 ```x=2 while 1 do if(btnp(4))x+=0.01 if(btnp(5))x-=0.01 y=rnd(abs(x)) memset(0,y,y) spr(0,rnd(128),rnd(128)) memset(0x3200,y,128) sfx(1) end ```
P#23869 2016-06-29 14:18

:: arnodick

Whoops, makes more sense if it's btn instead of btnp :P

P#23870 2016-06-29 14:20

kind of a proto-Helicopter in 139c

 ```x=-4y=64r=0 function _draw() cls() y+=1 if(btn(2))y-=2 circfill(10,y,3,11) x-=2 if(x<-4) then x=123r=10+rnd(108) end circfill(x,r,9,12) end ```
P#23871 2016-06-29 14:31

:: Blokatt

Cart [#23872#] | Copy | Code | 2016-06-29 | Link
1

 ```while 1 do print("") for i=0,3 do z=time() t=sin(z-i*.25)*4 camera(0,sin(t/180)*50) circfill(64+sin(z+i*.15)*55,100,t+7,10+t) end flip() end ```
P#23873 2016-06-29 14:33

:: Blokatt

Cart [#23875#] | Copy | Code | 2016-06-29 | Link
4

 ```while 1 do for x=8127,0,-1 do o=0x6000+x v=peek(o) if(v!=0)then if(peek(o+64)=0)then poke(o+64,v) poke(o,0) end end end end ```
P#23876 2016-06-29 14:56

:: Mozz

Oh my god that's really great

P#23878 2016-06-29 15:02

NIIIIICE!!

P#23880 2016-06-29 16:05

:: jefferycampbell

Cart [#23885#] | Copy | Code | 2016-06-29 | Link
0

 ```s=-9 function _update() c1=flr(rnd(16)) if btn(4) and c1==8 then s+=1 end end function _draw() cls() print("<3",60,s,8) circ(64,64,9,c1) end ```

Taking a stab at this with something super simple. When the circle and heart are the same color, press the button(4) and they come together... or just hold the button down.

P#23886 2016-06-29 16:44

:: TRASEVOL_DOG

Cart [#23889#] | Copy | Code | 2016-06-29 | Link
1

 ```function _draw() for x=0,127 do for y=0,127 do c=pget(x-2,y-2) if c>0 then c+=flr(rnd(9)/8) pset(x+rnd(3)-1,y+rnd(3)-1,c) end end end end ```
P#23890 2016-06-29 18:15

:: qbicfeet

Cart [#23891#] | Copy | Code | 2016-06-29 | Link
1

 ```a=64 camera(-a,-a)b=1 c=1 t=0 function _draw() for i=0,16 do d=(t/4+i*8)%128 line(a*b,a*b-d*b,a*c-d*c,-a*c,i)b=-b if(b<0)c=-c end t+=1 end ```

138/140
nothing fancy

P#23892 2016-06-29 18:29

:: lines guerragames

Cart [#23894#] | Copy | Code | 2016-06-29 | Link
1

 ```t=0 bt=1 c=0 l=127 while 1 do bt+= (btn(4) and 2 or -1) for t=1,l do c=1+(bt+t/5)%15 line(t,0,l-t,l,c) line(0,l-t,l,t,c) end flip() end ```

hold <z> to reverse the rotation
135/140

P#23893 2016-06-29 18:42

:: Blokatt

Cart [#23897#] | Copy | Code | 2016-06-29 | Link
0

 ```while 1 do t=time() s=(sin(t/5)+1)/2*40 memcpy(24576,24643,8128) memset(32704,0,64) line(s,127,128-s,127,s+sin(t*(t*.001))*6) flip() end ```
P#23898 2016-06-29 19:04

:: circles guerragames

Cart [#23906#] | Copy | Code | 2016-06-29 | Link
0

Here's another:

 ```b=0 l=99 a={7,6,5,0} function _draw() b+=.5 for t=1,l do c=flr(1+(b+t/4)%#a) p=(b+t)/30 circfill(63+4*sin(p),63+4*cos(p),l-t,a[c]) end end ```

138/140

P#23907 2016-06-29 20:26

:: RhythmLynx

Cart [#23909#] | Copy | Code | 2016-06-29 | Link
1

This is an awesome thread so I thought I'd join in. This is just drawing a line between points on two circles rotating at different speeds. 134/140 chars.

 ```cls() t=0 c=1 while 1 do m=64 x=30*cos(t) y=30*sin(t) z=60*cos(1.5*t) w=60*sin(1.5*t) line(m+x,m+y,m+z,m+w,c) t+=0.00003 c+=0.0003 end ```
P#23911 2016-06-29 20:46

:: hcnt

by hcnt
Cart [#23919#] | Copy | Code | 2016-06-29 | Link
1

Having fun with lissajous. Had to really cut it down to make it work.

 ```t=0k=64 function _draw()cls()t+=.05 for i=1,k do x=k+cos(i/10+t)*k/2 y=k+sin(i/20+t)*k d=sin(i/10+t) circ(x,y,4+d,12)circ(x,y,2+d,7) end end ```
P#23920 2016-06-29 21:41

:: solar

Cart [#23921#] | Copy | Code | 2016-06-29 | Link
2

 ```i=0 function _draw() i+=.01 y=24576 memcpy(y,y+(sin(i/3)+sin(i))*4,7200) for t=y+7296,y+8190,2 do memset(t,rnd(2)+i,2) end end ```

127 characters

P#23922 2016-06-29 22:03

:: otrain13

I've been loving going through these experiments! I started fooling around with drawing circles of different sizes and colours with small random offsets and ended up with a thing that looks like a cartoon smoke trail for fireworks or something. :)

Cart [#23930#] | Copy | Code | 2016-06-29 | Link
0

 ```cls() x=64 y=64 c=7 s=7 function _draw() x=(x+rnd(6)-3)%128 y=(y+rnd(6)-3)%128 c=(c+rnd(2)-1)%16 s=(s+rnd(2)-1)%12 circfill(x,y,s,c) end ```

136 chars

P#23931 2016-06-29 22:57

:: solar

Cart [#23933#] | Copy | Code | 2016-06-29 | Link
2

 ```i=0 function _draw() i-=1 for x=0,37,.5 do for y=0,11,.1+x%1 do pset((i+x*3)%128,23+y*8+sin((x+i)/50)*5,pget(x,y)) end end end ```

127 characters.

P#23934 2016-06-29 23:50

:: Felice

@solar:

Great idea using the system logo. :)

I played around a bit to see if I could get the character count down. I had to change the look a bit, but technically you can get a similar effect in 99 chars if you use this and don't hit enter. :)

 ```i=0 function _draw()i+=1 for a=0,6559 do poke(a+25698,pget((a+i)%64,sin((a-i)/64)+a/512)*17)end end ```

If you wanna be a stickler for formatting, the prettified code is 106 chars. :)

All credit to you for the idea, though. I'm just a relentless approximating optimizer.

P#23936 2016-06-30 01:01

:: solar

Cart [#23937#] | Copy | Code | 2016-06-30 | Link
0

 ```i=0 n=12800 m={221,210,3,0,0,151,200,0} function _draw() i+=1 if i%4==0 then a=i/4%8+1 if(btn(4))m[a]=rnd(n) memset(n,m[a],n) sfx(1) end end ```

140 characters.

WARNING, if you download this: This code has the absolute nerve to go overwriting a heap of RAM that it doesn't need to, and usually makes PICO-8 unusable afterwards. If you do run it... once you've hit escape, you can blindly type "reboot" and hit enter to reset.

This one extends on the idea above where we generate SFX on the fly. This loops over an array of 8 SFX setups, on loop. If you press Z during the moment an SFX starts to play, the setup for it will be randomised. So basically you build up a whacky beat by pressing Z at appropriate moments.

@Felice:

That's some impressive looking optimisation!

P#23938 2016-06-30 02:17

:: Blokatt

Cart [#23942#] | Copy | Code | 2016-06-30 | Link
3

 ```poke(24364,5)while 1 do t=time()line(63,0,63,128,8+sin(t)*sin(t/10)*7)for a=0,63 do for b=0,128 do pset(a-rnd(2),b,pget(a,b)/.67)end end end ```
P#23943 2016-06-30 07:52

:: ilkke

Cart [#23945#] | Copy | Code | 2016-06-30 | Link
2

 ```i=0 function _update() cls()for y=0,128,6 do for x=0,128,1 do line(x+(cos(i)),y,x+sin(x/y+i)*3,y+cos(y/x+i)*3,9) i+=x*y/20000 end end end ```
P#23946 2016-06-30 08:52

:: Benjamin Soulé

Cart [#23947#] | Copy | Code | 2016-06-30 | Link
1

 ```t=0 function _draw()cls(2)t+=0.01 for k=0,16 do for n=1,9 do h=k/16+t circ(64+cos(h+t/3)*n*8,64+sin(h)*(n*n+cos(t)*16),n,11-n/3)end end end ```
P#23948 2016-06-30 09:14

:: solar

All of those are f'n rad

P#23949 2016-06-30 09:43

:: RhythmLynx

Cart [#23950#] | Copy | Code | 2016-06-30 | Link
1

129/140

 ```poke(24364,7) t=0 while 1 do x=20*cos(t) y=20*sin(t) z=50*cos(0.3*t) w=50*sin(0.3*t) line(30+x,30+y,30+z,30+w,t*2) t+=0.00003 end ```
P#23951 2016-06-30 09:53

:: kometbomb

Cart [#23953#] | Copy | Code | 2016-06-30 | Link
1

 ```function _draw()p={1,1,13,12,14,15,7}cls()srand(0) for i=0,256 do z=flr(i/40+1)circfill((rnd(128)-time()*z*z)%140-8,rnd(128),z,p[z])end end ```

A bit lame but I thought I'll join you!

P#23954 2016-06-30 10:21

:: Blokatt

Cart [#23956#] | Copy | Code | 2016-06-30 | Link
0

 ```t=0 while 1 do t+=.2 for y=0,32 do for x=0,32 do o=x*y*.1+t c=cos(o)*4 s=sin(o)*4 x=x*4 d=y*4 line(x+c,d+s,x-c,d-s,8+(o/3)%7) end end end ```
P#23957 2016-06-30 10:22

:: zep

Cart [#23960#] | Copy | Code | 2016-06-30 | Link
4

 ```for i=12868,12935 do poke(i,i)end sfx(1)c=0 poke(24364,7)function _draw()cls()for i=49,95 do circ(cos(c+i/43)*i,c^4,i,i%8+8)end c-=0.003 end ```
P#23961 2016-06-30 11:13
 Page 1 2 3 4 5 6 7