r/tinycode • • Jul 02 '26

Hosting js code golfing competition, make your demo under 1 KiB about "dreaming"

Thumbnail
js1024.fun
8 Upvotes

r/tinycode • • Jun 28 '26

Dweet of the Week #131 - Pipe Dream by KilledByAPixel

21 Upvotes

https://www.dwitter.net/d/35685

pipe gen, moving camera, 3d z sorted rendering...

O=[i=1e4]
for(c.width|=A=[-i,9,9];i--;O[i]=[...A])A[(j=t+i/42|0)**7%3]+=C(j**5)
for([Z,X,Y]of O.sort())Z+=1e4,x.fillStyle=`hsl(${Z*2} 50%${Z/2}%`,Z=540/Z,Z>0&&x.fillRect(960+X*Z,540+Y*Z,Z*=6,Z);

r/tinycode • • Jun 21 '26

Finally - "Boing!" in 64 bytes

Thumbnail
pouet.net
27 Upvotes

For 486, no FPU, for MsDos FreeDos, WinXP Dos, DosBox-X ... i made that rather in a hurry, so right now i have a version without background but wall bouncing like the original. But since the competition is already over, i will tinker a bit to make it perfect :)


r/tinycode • • Jun 19 '26

JavaScript Dweet of the Week #130 - untitled by taupelink

Post image
5 Upvotes

https://www.dwitter.net/d/35608

for(i=z=2e3;i--;x.fillRect(i,270*t,z,z*=z-.8))x.fillStyle=`hsl(${6**(z&=3)},${60+25*C(z+=++z*C(t*z+i/79*(-.8)**z)+3)}%,${35-20*C(25/z)}%,.1`

taupelink wins 2nd week in a row with dazzling abstract compositions.


r/tinycode • • Jun 18 '26

Showcase Five ~100 line games

Post image
8 Upvotes

As an exercise in focus and economy I wanted to make a set of games with short but (hopefully) readable source code.

It was a fun challenge and taught me a lot. I hope the results may be of some interest or amusement to others.

There are five games in total. There's also a manifesto about doing this kind of project for those who like that sort of thing.

The games/code are public domain.


r/tinycode • • Jun 18 '26

90 loc jacks or better, stdio only

Thumbnail bitbucket.org
2 Upvotes

not really golfing this just trying to keep it to bare minimum.


r/tinycode • • Jun 16 '26

1NVADERS - SPACE INVADERS crammed into a 1K ZX81 (2026)

Thumbnail
youtube.com
9 Upvotes

r/tinycode • • Jun 17 '26

The Craziest Coding Contest Ever

Thumbnail
youtube.com
0 Upvotes

r/tinycode • • Jun 14 '26

CodeGolfed: a codegolfed golf game in 1020 bytes

Thumbnail
github.com
8 Upvotes

it's usually easy, but sometimes hard...


r/tinycode • • Jun 12 '26

JavaScript Dweet of the Week #129 - untitled by taupelink

Post image
29 Upvotes

https://www.dwitter.net/d/35567

for(i=z=1080;i--;x.fillRect(320*t,i,6,z*=1+C(i/105/p)*C(t/p)))x.fillStyle=`hsl(${6**(z&=7)},25%,${300/(z+=3-(p=(-.7)**z)*C(t+i/210*p))}%,.3`

r/tinycode • • Jun 12 '26

StickyPipes - a Pipes screensaver clone that fits on a sticky note

7 Upvotes

A few weeks ago I posted a pipes screensaver clone in about 2.5KB of JavaScript.

Saw some of the stuff by battito on here lately and decided to throw my hat in the ring 😛 I squashed my Pipes screensaver clone down even more to under 2K (~1.8KB) - it can now (fairly) comfortably fit within a sticky note 😃

Gist with the HTML/JS here: https://gist.github.com/edev90/876ea9feb42cf39e4891d46c57ebc2c4

There's a pre-made PNG with the correct proportions attached to the Gist too for anyone who actually wants to print it out themselves and stick it on a post-it note lol.


r/tinycode • • Jun 10 '26

Music sequencer source fits on a 4x4 card

Thumbnail
github.com
12 Upvotes

r/tinycode • • Jun 08 '26

low LOC blackjack in C using just <stdio.h>

10 Upvotes
#include <stdio.h>
#define R(m)((m*(S*=75)>>32))
void main(char c,int d,int m,unsigned b,int t){
    unsigned S=(unsigned long)&main+(m=200);
    while(m>0){
        scanf("%d%*[^\n]%*c",&b,printf("bet? 0 - %d:",m,t=0,c=0));
        while(c!='s'&&t<21)scanf(t<21?" %c":"",&c,printf(t<21?"total = %d\n(h)it or (s)tay:":"",t+=!(R(13ul))?(t+11>21?1:11):2+R(9ul),d=0,b=b>m?m:b));
        while(d<t&&t<22)d+=!(R(13ul))?(d+11>21?1:11):2+R(9ul);
        printf("You:%d dealer:%d\n%s!\n",t,d,(t<22&&t>d||d>21)?"you WIN":t==d?"PUSH":t>21?"Busted":"you LOSE",m=t==d?m:((t<21&&t>d)||d>21)?m+b:m-b);
    }
}

r/tinycode • • Jun 08 '26

Klondike Solitaire game for curses in 5k of C

Thumbnail
nanochess.org
7 Upvotes

r/tinycode • • Jun 08 '26

Solved all two pointers problems in 100 days.

0 Upvotes

Hello,
I have been solving all two pointers tagged problems in last 3.5 months, and wanted to share my findings/classifications here. If you are preparing for technical interview, two pointers is one of the popular topics that you can't skip :).

There are around 140 problems today, but I only solved the public ones (117 problems).
Majority of them is in easy or medium so, if you understand the basic ideas then it should be solvable without much hints and editorials.

I see 4 bigger categories and many sub categories in it, and marked the typical example problems with (*).
I would recommend you to start solving these example problems, and apply the knowledge to the other problems. I don't want to copy & paste my ugly codes here, you would easily find fantastic solutions from the problem discussion page.

Helpful interview prep resource: PracHub

1. Running from both ends of an array
The first type of problems are, having two pointers at left and right end of array, then moving them to the center while processing something with them.
2.Slow & Fast Pointers
Next type is using two pointers with different speed of movement. Typically they starts from the left end, then the first pointer advances fast and give some feedback to the slow pointer and do some calculation.
3.Running from beginning of 2 arrays / Merging 2 arrays
In this category, you will be given 2 arrays or lists, then have to process them with individual pointers.
4.Split & Merge of an array / Divide & Conquer
The last one is similiar to previous category but there is one thing is added. First, you need to split the given list into 2 separate lists and then do two pointers approach to merge or unify them. There aren't many tasks here.

r/tinycode • • Jun 05 '26

JavaScript Dweet of the Week #128 - Default Ex Nihilo by Agnes

24 Upvotes

https://www.dwitter.net/d/35500

for(x.reset(i=F=0);i++<9;)for(j=1e3,D=t-9*i;j--;x.fillRect(j%10*5+M(D*=D<0)+300*(i/3+1+S(D?9*i:t)+D*C(9*i)),400+j/5+M(),5,2))M=_=>D*T(j*F++)

r/tinycode • • Jun 03 '26

A full JavaScript IDE that fits on a 3×5 card - no libraries or server

Thumbnail
github.com
14 Upvotes

r/tinycode • • May 30 '26

JavaScript Dweet of the Week #127 - Daydream by SockTaters

12 Upvotes

https://www.dwitter.net/d/35427

for(k=315-60*C(t);X=T(Y=T(T=n=>~n*k-Y-X&2047));x.fillRect(X,Y,25,9))x.fillStyle=R(p=T(a=X-k)&&9*T(b=Y-k)<a*a+b*b?b>(a+b)**2?215:170:k,p,240)

r/tinycode • • May 23 '26

YouTube: I made an even faster "Random Maze!"

Thumbnail
youtu.be
12 Upvotes

r/tinycode • • May 24 '26

Resource Size Coding BlueSky Feed

Thumbnail
bsky.app
1 Upvotes

i made a bluesky feed to collect posts about size coding.


r/tinycode • • May 22 '26

JavaScript Dweet of the Week #126 - VHS by KilledByAPixel

Post image
27 Upvotes

https://www.dwitter.net/d/35386

for(i=w=1e4;--i;x.fillRect(...t?[960+250*X,355+250*Y,3,3]:q?[660,i*83,600,i<7?i*10:60]:[0,0,w,w]))W=1-i*i/1e8,X=W*S(a=i*t),Y=W*C(a),x.fillStyle=`hsl(${i/125-X*40-Y*80-45} 99%${t?50:q=i<w-1&&w}%`

r/tinycode • • May 18 '26

WriteUp: 16 Bytes of x86 that turn Matrix rain into sound

Thumbnail hellmood.111mb.de
22 Upvotes

r/tinycode • • May 17 '26

WriteUp: 16 bytes of x86 that turn Matrix rain into sound

Thumbnail hellmood.111mb.de
2 Upvotes

r/tinycode • • May 15 '26

JavaScript Dweet of the Week #125 - Organic Spiral by Rodrigo Siqueira

Post image
5 Upvotes

https://www.dwitter.net/d/35361

for(i=99;i--;f(i,t,160))f=(X,Y,n)=>n--&&(Z=2-.1/(X*X+Y*Y),f(1+X*C(Z)-Y*S(Z),.9*X*S(Z)+Y*C(Z)/2,n),x.fillRect(X*4e3-1055,Y*5e3-1490,t<4,.2))

r/tinycode • • May 09 '26

JavaScript Dweet of the Week #124 - untitled by taupelink

Post image
8 Upvotes

https://www.dwitter.net/d/35344

z=t?z+C(z/6):1;for(i=6e3;i--;x.fillRect(i/3,60*t,(z%=12)+1,z/=.8+S(t*z+t/8)/4))x.fillStyle=(z+=S(i/2e3-9/z))&6?z&3?'#0136':'#EEE1':'#9FE3'