hack emulator
A nand2tetris Hack computer running in the browser.
Conway's Game of Life โ a cellular automaton where cells live, die, or reproduce based on their neighbours.
The Hack computer is a 16-bit machine designed for the nand2tetris course. It has a CPU, ROM, RAM, a memory-mapped 512ร256 monochrome screen, and a keyboard. Programs are written in Hack assembly and compiled to binary .hack files โ one 16-bit instruction per line. This emulator runs those binaries directly in the browser using a high-performance CPU simulation built with @r2/hack-emulator.
// programs
life.hackConway's Game of Life โ a cellular automaton where cells live, die, or reproduce based on their neighbours.
โ sourcer2.hackDraws "R2" in big block letters on the screen by writing pixel data directly to memory-mapped I/O.
โ sourcewaves.hackAn infinite animation that spawns random bars at the top of the screen and shifts them downward, creating a waves effect.
โ sourcepixel.hackDraws a single pixel to the screen โ the simplest possible graphical program.
โ source