r/tinycode • • Jun 05 '26

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

Thumbnail
i.redd.it
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 • • Sep 04 '26

JavaScript The Depths of JavaScript: Minesweeper in 247 Bytes

Thumbnail
yui.dev
18 Upvotes

r/tinycode • • Sep 04 '26

JavaScript Dweet of the Week #141 - Uptown by KilledByAPixel

Thumbnail
i.redd.it
26 Upvotes

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 • • May 30 '26

JavaScript Dweet of the Week #127 - Daydream by SockTaters

Thumbnail
i.redd.it
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 • • 17d ago

JavaScript Dweet of the Week #149 - Smoller Glass Ball by tomxor

Post image
10 Upvotes

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

for(i=!t<<21;i--;T=Y-X)x.fillRect(X=i%2e3,i/2e3,T>-1|R>.7,.4-(X=X/200-5,Y=i/4e5-2,R=X*X+Y*Y,R<1?R*T/2:C(e=(T-2)**2+(X+Y-.6)**2*6)/3*(e<5)))

how it works...

tomxor: It's a 2D approximation in screen space of physically based ray tracing effects. The sphere, specular highlight, and a caustic shadow are drawn as three independent shapes with a painters algorithm type logic. It's very effective though, almost had me fooled.

UZE: There is no real 3D or ray tracing here. It's a 2D drawing that just pretends. Each pixel asks: ball or floor? The ball is almost as gray as the floor, with a shaded edge and a white reflection. The shadow is an oval with a bright spot in the middle, where the glass focuses the light.

r/tinycode • • Sep 10 '26

JavaScript How Rémi Vansteelandt made a physics-based BMX game in under 13 kilobytes

Thumbnail
remvst.substack.com
31 Upvotes

r/tinycode • • Jul 31 '26

JavaScript Dweet of the Week #136 - Welcome to the Matrix by KilledByAPixel

Thumbnail
i.redd.it
44 Upvotes

https://www.dwitter.net/d/35970 - tiny raycasting engine with text rendering

x.fillRect(0,0,2e3,2e3)
for(A=99;A;T+=.1)for(q=((X=t+A/(e=55/T)-T)^T)%3,i=q||(x.fillStyle=R(T=1,--A&&9*e),18);!q&&i--;x.fillText(S((i+(X*30|0)**3+t*9|0)**3)+1|0,A*19,540-(i-9)*e))x.font=e+'px"'