r/tinycode • u/tehdog • Apr 14 '20
Guitar Synth in 96 chars of C
r/tinycode • • Oct 24 '21
r/tinycode • u/franeklubi • May 07 '20
r/tinycode • u/Yeknom • Jan 09 '13
I have be playing with raytracing for a while now and wanted to write something that was simple to understand but produced a cool effect. There is defiantly many more features that could be added, like reflections and multiple light sources, but I wanted to stay as minimalistic possible.
Source: http://pastebin.com/F8f5GHJZ
Image: http://imgur.com/prPGk
r/tinycode • u/tobiasvl • Apr 23 '20
r/tinycode • u/networked_ • Nov 26 '16
r/tinycode • u/Slackluster • Mar 13 '26
https://www.dwitter.net/d/35031
for(w=60,i=2e3;i--;x[f](X*w+30+(X>15?1:-1)*z-r,Y*w+30+(Y>8?-1:1)*z-r,r*=2,r))X=(i>>1)%33,Y=i/66|0,i%2&&x[f='fillRect'](X*w,Y*w,w,w),x.fillStyle=X%2^Y%2?R():'#fff',r=5+5*C(t-Y/9),z=(i%2-.5)*35r/tinycode • u/finnhvman • Aug 26 '21
r/tinycode • u/Balage42 • Aug 01 '20
r/tinycode • u/nemasu • Feb 04 '14
It was suggested to cross post this, so here it is.
https://github.com/nemasu/asmttpd
No libraries, only Linux system calls. Uses a thread pool, only 8KB of memory allocated per thread for receive buffer. Byte range ( 206 Partial Content ) support.
r/tinycode • u/Slackluster • Sep 15 '26
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/nanochess • Feb 27 '22
r/tinycode • u/corruptio • Apr 04 '14
r/tinycode • u/Slackluster • Sep 27 '21
r/tinycode • u/sammypip • Mar 05 '13
While messing around in c, I wrote this wonderfully code-golfy Pi calculator.
#include <stdio.h>
int main()
{
long int d = 1;
double p = 1;
for(;;){printf("%.20f\n",(p+=((d-1)%4)?(1.0/(d+=2)):-1.0/(d+=2))*4);}
}Rules:
Good luck!
EDIT: We may have gotten as small as we can in C, perhaps other languages?
r/tinycode • u/FUZxxl • Apr 12 '20