r/tinycode • • Jun 16 '26

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

Thumbnail
youtube.com
9 Upvotes

r/tinycode • • Jun 14 '26

CodeGolfed: a codegolfed golf game in 1020 bytes

Thumbnail
github.com
9 Upvotes

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


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 12 '26

JavaScript Dweet of the Week #129 - untitled by taupelink

Post image
32 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 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
8 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

Post image
23 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
15 Upvotes

r/tinycode • • May 30 '26

JavaScript Dweet of the Week #127 - Daydream by SockTaters

Post image
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 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 23 '26

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

Thumbnail
youtu.be
11 Upvotes

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
23 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
9 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'

r/tinycode • • May 01 '26

JavaScript Dweet of the Week #123 - Sierpinski Metamorphosis by dee-gomma

Post image
7 Upvotes

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

for(f=r=a=128,c.width=448;r;x.fillRect(f+C(g=a+.78)*r,f*q+S(g)*r,!(r&((q-1.3)*S(a*2)*(200+r*C(a)+r*S(a)))),1))a=a>6.3?0*r--:a+1/r,q=C(t)/9+1

r/tinycode • • Apr 24 '26

JavaScript Dweet of the Week #122 - 3D Vase Spin by KilledByAPixel

Post image
18 Upvotes

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

for(k=3e4;k--;i>79|j<269&&x.fillRect(960+99*(3+S(i/15))*C(j/=48),930-i*8+99*S(j),9,9))i=k%99,j=k/99,x.fillStyle=R(v=i*4-j,v*=S(i^j+t*60),v)

r/tinycode • • Apr 21 '26

Pipes2K - Pipes Screensaver demo in about 2k of JS

Post image
8 Upvotes

r/tinycode • • Apr 18 '26

JavaScript Dweet of the Week #121 - The Spine by katkip

Post image
5 Upvotes

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

c.style.filter=`invert()`
for(𝕏=X=Y=i=3e4;i--;𝕏=X,x.fillRect(Y*999+999,X*999,t<3,.02))
X=T(X*X-Y*Y/2)%(9/t)+.298,Y=C(2*𝕏*Y*1.1+1.942)

r/tinycode • • Apr 14 '26

Tutorial Andrej Karpathy - microgpt - 200 loc

Thumbnail karpathy.github.io
32 Upvotes

r/tinycode • • Apr 10 '26

JavaScript Dweet of the Week #120 - Easter Eggs by KilledByAPixel

Post image
21 Upvotes

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

for(t*=60,k=1e5;k--;x.fillRect(210+t%4*500+C(a=k/3e4)*r/2,40+(t>>2)*520+i,3,2,x.fillStyle=R(f(2),f(t),f(5))))i=k%480,r=(58e3-(i-240)**2)**.5*(i/3e3+.7)<<1,f=f=>(i/19-a*9-t*9&i/19+a*9^f+t)%7*a*27

r/tinycode • • Apr 09 '26

SpeedMonitor-Lite: A 31KB Internet Speed Widget built with raw C++ and Win32 API

8 Upvotes

I built a network monitor for Windows because I was tired of simple utility apps consuming hundreds of megabytes of RAM. SpeedMonitor-Lite is the result of going back to basics: raw C++, the Win32 API, and zero dependencies.

Why?

Modern system widgets are often built on Electron or high-level frameworks, leading to massive resource bloat for a background task. SpeedMonitor-Lite is designed for power users who want telemetry without sacrificing clock cycles or memory.

Efficiency Comparison

MetricSpeedMonitor-LiteTypical Electron Utility
Binary Size31 KB150 MB+
RAM Usage~7.5 MB200 MB+
CPU Usage~1.0%1% - 5%

The 16x16 Pixel Challenge

Windows system tray icons are restricted to 16x16 pixels. Fitting readable numbers and units into this space required a custom-built 4x12 bitmapped font. Because there is no room for "MB/s" or "KB/s" text, the app uses a header-block system at the top of the icon to indicate units:

  • Bytes/s (B): Solid bar across the top.
  • Kilobytes/s (K): One block at the top-left.
  • Megabytes/s (M): Two blocks at the top-left.
  • Gigabytes/s (G): Three blocks across the top.

Example: 120 Megabytes/s (Download Icon)

🟩🟩🟩🟩⬛🟩🟩🟩🟩⬛⬛⬛⬛⬛⬛⬛
🟩🟩🟩🟩⬛🟩🟩🟩🟩⬛⬛⬛⬛⬛⬛⬛
🟩🟩🟩🟩⬛🟩🟩🟩🟩⬛⬛⬛⬛⬛⬛⬛
⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛
⬛⬛⬜⬛⬛⬛⬜⬜⬜⬜⬛⬛⬜⬜⬜⬜
⬛⬛⬜⬛⬛⬛⬛⬛⬛⬜⬛⬛⬜⬛⬛⬜
⬛⬛⬜⬛⬛⬛⬛⬛⬛⬜⬛⬛⬜⬛⬛⬜
⬛⬛⬜⬛⬛⬛⬛⬛⬛⬜⬛⬛⬜⬛⬛⬜
⬛⬛⬜⬛⬛⬛⬛⬛⬛⬜⬛⬛⬜⬛⬛⬜
⬛⬛⬜⬛⬛⬛⬜⬜⬜⬜⬛⬛⬜⬛⬛⬜
⬛⬛⬜⬛⬛⬛⬜⬛⬛⬛⬛⬛⬜⬛⬛⬜
⬛⬛⬜⬛⬛⬛⬜⬛⬛⬛⬛⬛⬜⬛⬛⬜
⬛⬛⬜⬛⬛⬛⬜⬛⬛⬛⬛⬛⬜⬛⬛⬜
⬛⬛⬜⬛⬛⬛⬜⬛⬛⬛⬛⬛⬜⬛⬛⬜
⬛⬛⬜⬛⬛⬛⬜⬛⬛⬛⬛⬛⬜⬛⬛⬜
⬛⬛⬜⬛⬛⬛⬜⬜⬜⬜⬛⬛⬜⬜⬜⬜

Technical Implementation

The app uses two independent, dynamic icons—one for Download and one for Upload. Every 1s, the app:

  1. Polls the network stack via IPHLPAPI.
  2. Calculates throughput.
  3. Renders a new 16x16 ARGB icon in memory.
  4. Updates the tray state via NIM_MODIFY.

Setup Note

The first time you run the app, Windows will likely place the icons in the "Hidden Icons" (chevron) menu. For the best experience, click the chevron and drag the Download and Upload icons directly onto your taskbar. Windows will remember this placement.

Compilation

For those who want to audit the code and build it themselves using MinGW:

Bash

g++ -Os -s -ffunction-sections -fdata-sections "-Wl,--gc-sections" main.cpp -o SpeedMonitor.exe -mwindows -lgdi32 -lshell32 -liphlpapi -lole32

GitHub: SpeedMonitor-Lite