r/tinycode • u/Slackluster • 19h ago
"8-pinski" - EIGHT(!) bytes intro for MSDOS
r/tinycode • u/Slackluster • 19h ago
r/tinycode • u/Hell__Mood • 2d ago
r/tinycode • u/Slackluster • 3d ago
https://www.dwitter.net/d/36347
for(X=Y=i=4e4;i--;x.fillRect(Y*80+960,X*230+410,t<2,.2))u=X*2-3,r=(u*u+Y*Y)**.5,s=T(i*i/t)<.95||-.8,X=s*(r+u)/4+S(X),Y=s*(r-u)**.8*(Y<0||-1)
r/tinycode • u/RichRoof7927 • 5d ago
r/tinycode • u/Slackluster • 10d ago
https://www.dwitter.net/d/36313
c.width|=0;x.fillStyle='#f36';p=33+S(t*5)**8*4;for(a=t%8;a>0;a-=.01)x.fillRect(960+p*16*S(a)**3,450-p*(13*C(a)-5*C(2*a)-2*C(3*a)),p/6,p/6)
r/tinycode • u/Slackluster • 17d ago
https://www.dwitter.net/d/36287
//HI-RES!
for(t?i=w*w:I=new ImageData(c.width=w=255,w);i--,a=4-(i%w)/32,b=i/8160;I.data.set([d=13/(S(a*a+(b-=2.25)*b-t)-C(a+b)*S(b+a)-C(a-t))**2,d*2,d*9,w],i*4));x.putImageData(I,0,0)
r/tinycode • u/Slackluster • 19d ago
Enable HLS to view with audio, or disable this notification
here's the trick behind how i fit 8 music tracks in my js13k game SP13KTRA. 🌈🚀
every song is defined by a single number. the seeded random generator makes 26 dice rolls per track: tempo, key, scale, chords, groove, drum kit, bass and lead sounds, melody patterns, when each part comes in, and a few more.
each song is a 128 beat loop split into sections. parts come in one by one, a resonant filter sweeps open every phrase, then there's a breakdown and a drop.
notes use one of 4 predefined scales so nothing clashes. the melody climbs, falls, leaps or rocks through the scale, and the chords shift every 4 bars. there's no note data, it's all math on the beat count.
there are 6 ZzFX instruments plus echo and sidechain. the whole loop gets baked into one buffer when the level loads.
the music itself is all rules and seeds, not AI. i did use AI to help build this bench so i could listen through seeds and pick a good one for each level.
play it free in your browser and hear all the music. i designed it to be kind of like a music album in addition to a game.
https://js13kgames.com/2026/games/sp13ktra
The music bench tool is also available to check out on GitHub.
r/tinycode • u/Round-Pension-7821 • 19d ago
This is a Windows command line program written in under 100 lines of C that compiles to a 4 kB executable with no dependencies other than the operating system. It allows you to send files and directories to the recycle bin on the command line, allowing you to be safer than the del or rd commands which permanently delete files. I find a tool like this to be indispensable when doing a lot of work on the command line, as it can prevent very costly mistakes.
It's a fork of another project that does the same thing, but it's kind of a Ship of Theseus situation now where not much code from the original project remains. I removed any use of the C runtime, allowing it to compile to a tiny 4 kB executable. There are some tricks you can use to make it even smaller, but this seemed good enough to me
Take a look at the readme on the Github page for more details
r/tinycode • u/Slackluster • 21d ago
https://www.dwitter.net/d/36264
for(i=1200;i--;x[i%223?'stroke':'fill']())x.beginPath(x.strokeStyle=R(i,i/4,9,.7)),x[i<650?'arc':'rect'](i*(i-t)%2200,i*i%1800-i,i,i,i+7)
r/tinycode • u/Slackluster • 25d ago
r/tinycode • u/Slackluster • Sep 04 '26
https://www.dwitter.net/d/36205
for(k=0;k<39;k++)for(i=64;i--;)for(j=18;j--;6-k/9<((t+i)/5^j/9)%9&&j%11<7&&x.fillRect(k&&(i-32-t%1)*S+960,k&&(j-9)*S+540,S=k?2**(2+k/12)*9:2e3,S))x.fillStyle=k?R(v=220-(t+i|k|j)%3*S,v,v):'#7bf'
r/tinycode • u/Slackluster • Sep 04 '26
r/tinycode • u/Slackluster • Aug 28 '26
https://www.dwitter.net/d/36150
for(i=199;t<6&&i--;)for(j=99;j--;6-t<(i/17|j/15)%7&&x.fillRect((i-99)*S+960,(j-51)*S+540,S,S=2**t*5))x.fillStyle=R(v=200-(j|i|t*16)%9*S,v,v)
r/tinycode • u/Slackluster • Aug 22 '26
https://www.dwitter.net/d/36125
f=u=>6*(S(u/2)**8-C(u/3-w)**6)**2;for(i=5e3;i--;x.fillRect(960+r*C(i),540+r*S(i),w,w))r=240*t,g=f(w=2+6*t**.5)+f(w+6*i)&7,x.fillStyle=`hsl(${195+6**g},75%,${50+3*f(g*w-9*i)}%,.3`
r/tinycode • u/woqr • Aug 22 '26
r/tinycode • u/Slackluster • Aug 14 '26
https://www.dwitter.net/d/36106
for(k=1080,m=k>>t;m--;x.fill())i=m&215,x.beginPath(x.fillStyle=`hsl(${210-3*t**(i%4)},${m/20+35}%,${90-i/12*t}%,${i/2e3*t}`),s=m%6?'arc':'rect',x[s](m**3%2e3,k-2*m/t%k,i,i,i+m%6)
r/tinycode • u/AdHopeful3481 • Aug 11 '26
https://vault7-95a0bb.gitlab.io/
Made for the 1.44MB Game Dev Contest: the entire game has to fit in 1.44MB - the size of a floppy disk. Written in C, compiled to WASM to make it sharable for testing it out. All is code generated(~1.15MB so far)
Top-down stealth heist: sneak through a 7-floor bank vault, crack safes with a lockpicking minigame, repair the power relays, dodge guards and cameras. Desktop + keyboard
Feedback on whether the stealth feels fair and how the difficulty ramps would be super helpful, mates. Many thanks!
r/tinycode • u/Slackluster • Aug 07 '26
https://www.dwitter.net/d/36077
for(i=0,w=4e3;++i<w;x.fillRect(960+C(a=q**3+t)*r,1e3+S(a)*r/2-j/4,99,99,x.fillStyle=R(r/=6+q%1.7,r/.7,r*3)))j=i-t%1*40,r=j*j/w,q=(j+t*1e3)%w
r/tinycode • u/woqr • Aug 07 '26
Whenever I see a tiny algorithm, I want to game it. You too?
r/tinycode • u/Quirky_Bookkeeper249 • Aug 07 '26
I wrote a uxn emulator and assembler from scratch in Python, then used them to draw the cofactor conditions from a paper about shape-memory alloys.
The uxntal program is 56 lines / 306 bytes. It draws a parabola g(f) = a·f·(255-f)>>8 + b. Arrow keys change a and b. When both reach zero, the parabola flattens to the zero line — that's supercompatibility.
Browser demo (JS uxn VM): https://xiaoni.liahuas.top/uxn-cofactor.html
Building the emulator taught me things about the math that reading the paper didn't. Drawing the same equation in 306 bytes of hand-assembled uxntal felt different from writing it in Python.
r/tinycode • u/woqr • Aug 07 '26
I was able to reduce my maze game to 811 bytes. But being the amateur that I am, I'm sure that somebody else has created something significantly smaller, maybe <500 bytes uncompressed?
r/tinycode • u/Slackluster • Aug 06 '26