My best friend in high school, John Alvarado, and I, loved the game BoulderDash. John reproduced the algorithm for it in Action!
https://github.com/greggman/rockfall/blob/main/ROCK4.ACT
I've since ported that code multiple times. Once to Gameboy (unshipped, it was just for learning when I was hired to make a gameboy game). Once to C. Once to Java for a feature phone software interview. A couple of years ago to JavaScript