Here's a tiny tweetcart!
188 chars of pixelated punch~
Here it is on twitter, if you want more ♥
https://twitter.com/k10x10x10/status/1297998450408267782
I stumbled upon this very odd behaviour while making this tweetcart :
https://www.lexaloffle.com/bbs/?tid=39326
After loosing some sleep over why a pixel than can randomly go in any of the 4 direction always build staircases, here is what the poor souls of the #help channel on the pico8 discord server and I have found out :
- When trying to have randomly one of these results :
dx=0 dy=1
dx=0 dy=-1
dx=1 dy=0
dx=-1 dy=0
I wrote this :
dx=rnd({-1,1}) dy=0
-- %50 chance to swap them
if(rnd({true,false})) then dy=dx dx=0 end
The behaviour disappears if I use any other method of achieving this result
- HOWEVER, the distribution of dx and dy with this method appears to really be random
- The pattern rnd({foo,bar}) appears to yield odd results, even on it's own
- if I swap out +dy and +dy2 with a -dy and -dy2 in the pset() calls, the staircase pattern is reversed.
Which makes no sense, considering the sign of dy is supposed to be 50/50
So, if anyone can explain why this behaviour happens, I'd be very grateful!
Finally took the time to make a #tweetcart of this cute effect I found!
It makes me think of bacteria on a Petri dish c:
Credit to @Naxane_ on the #pico8 discord server for the help fixing a particularly /w e i r d/ bug with rnd() on tables, and for golfing it into a tweet!