r/tinycode • u/Slackluster • Jun 16 '26
1NVADERS - SPACE INVADERS crammed into a 1K ZX81 (2026)
r/tinycode • u/Slackluster • Jun 16 '26
r/tinycode • u/woqr • Jun 14 '26
it's usually easy, but sometimes hard...
r/tinycode • u/Edev90 • Jun 12 '26
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 • u/Slackluster • Jun 12 '26
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 • u/Single-Discussion856 • Jun 08 '26
#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 • u/nanochess • Jun 08 '26
r/tinycode • u/nian2326076 • Jun 08 '26
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 • u/Slackluster • Jun 05 '26
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 • u/woqr • Jun 03 '26
r/tinycode • u/Slackluster • May 30 '26
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 • u/Slackluster • May 24 '26
i made a bluesky feed to collect posts about size coding.
r/tinycode • u/Slackluster • May 23 '26
r/tinycode • u/Slackluster • May 22 '26
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 • u/Hell__Mood • May 18 '26
r/tinycode • u/Slackluster • May 15 '26
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 • u/Slackluster • May 09 '26
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 • u/Slackluster • May 01 '26
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+1r/tinycode • u/Slackluster • Apr 24 '26
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 • u/Slackluster • Apr 18 '26
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 • u/nexe • Apr 14 '26
r/tinycode • u/Slackluster • Apr 10 '26
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*27r/tinycode • u/SchorchingEagle • Apr 09 '26
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.
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.
| Metric | SpeedMonitor-Lite | Typical Electron Utility |
|---|---|---|
| Binary Size | 31 KB | 150 MB+ |
| RAM Usage | ~7.5 MB | 200 MB+ |
| CPU Usage | ~1.0% | 1% - 5% |
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:
Example: 120 Megabytes/s (Download Icon)
🟩🟩🟩🟩⬛🟩🟩🟩🟩⬛⬛⬛⬛⬛⬛⬛
🟩🟩🟩🟩⬛🟩🟩🟩🟩⬛⬛⬛⬛⬛⬛⬛
🟩🟩🟩🟩⬛🟩🟩🟩🟩⬛⬛⬛⬛⬛⬛⬛
⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛
⬛⬛⬜⬛⬛⬛⬜⬜⬜⬜⬛⬛⬜⬜⬜⬜
⬛⬛⬜⬛⬛⬛⬛⬛⬛⬜⬛⬛⬜⬛⬛⬜
⬛⬛⬜⬛⬛⬛⬛⬛⬛⬜⬛⬛⬜⬛⬛⬜
⬛⬛⬜⬛⬛⬛⬛⬛⬛⬜⬛⬛⬜⬛⬛⬜
⬛⬛⬜⬛⬛⬛⬛⬛⬛⬜⬛⬛⬜⬛⬛⬜
⬛⬛⬜⬛⬛⬛⬜⬜⬜⬜⬛⬛⬜⬛⬛⬜
⬛⬛⬜⬛⬛⬛⬜⬛⬛⬛⬛⬛⬜⬛⬛⬜
⬛⬛⬜⬛⬛⬛⬜⬛⬛⬛⬛⬛⬜⬛⬛⬜
⬛⬛⬜⬛⬛⬛⬜⬛⬛⬛⬛⬛⬜⬛⬛⬜
⬛⬛⬜⬛⬛⬛⬜⬛⬛⬛⬛⬛⬜⬛⬛⬜
⬛⬛⬜⬛⬛⬛⬜⬛⬛⬛⬛⬛⬜⬛⬛⬜
⬛⬛⬜⬛⬛⬛⬜⬜⬜⬜⬛⬛⬜⬜⬜⬜The app uses two independent, dynamic icons—one for Download and one for Upload. Every 1s, the app:
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.
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 -lole32GitHub: SpeedMonitor-Lite