I wrote a very fast disk usage program for macOS
most of the popular disk usage CLIs aren't using getattrlistbulk to reduce the number of syscalls required to scan directories (it's free real estate)
I built a tiny shell with C so I could learn more about syscalls and pipes
great fun
I found C to be quite suited for the task (fork, execvp) ... until I had to manage some string lifetime stuff 🥲
I suggested to my friend that writing a semaphore is fairly trivial but when I sat down to write one I was pretty humbled
the edge cases around context cancellation are no joke
more notes and my solution below down there ⇣
I built a solver for NYT's daily Pips puzzle
I started with a brute-force search and optimized it to be 16× more efficient (by the number of nodes that need to be checked)
I made a Forth compiler and VM with some visualizations for the tokenization->bytecode->VM steps
here's the VM running (it's calculating the 10th Fib. sequence)
added sheep! they spawn when a chunk is created and then randomly walk around, avoiding obstacles (added very rudimentary 'entity system')
added torch flicker (sine wave whose phase is derived from cell coords, scales with light level so cells nearer a torch flicker a bit more)
playing around with an idea for an article called 'the algorithms behind minecraft'
probably with everything in 2d
I've just got terrain generation working in a canvas
added stone, and ore veins (based on seed, and placed via biased random walk)
added torches/BFS lighting (attenuates by 1 per cell, blocked by stone/ore)
I'm cheating a bit with the lighting because there's just a dark overlay that is reduced by the lighting effect
I made a small 2d programming language called icepath
I wanted the same vibe as the ice puzzles in the johto caves in pokemon gold and silver
🧊 sliding around a cave and hitting opcodes