4 ms·
One of my favorite things about the intcode computer was implementing the extendable memory by just appending an infinite list of zeros using haskell's lazy eva
by viceroyalbean 5y ago
One of my favorite things about the intcode computer was implementing the extendable memory by just appending an infinite list of zeros using haskell's lazy evaluation.
Unfortunately my implementation was incredibly slow (probably because of the linked lists) and I only made it about halfway through.
- gameswithgo 5y agomy fun thing was running my intcode computers in parallel
- CornCobs 5y agoI also did that year in haskell! My favorite part was using knot tying to feed the output of my intcode machine into itself! Lazy evaluation allowed me to continue expressing my intcode machine as a pure function of [Int] -> [Int] without having to restructure the entire machine to allow getting an output, then adding the next input to the machine in a step-wise manner usually accomplished with generators of some sort in other languages
- 1-more 5y agoWas this 2019? I did half of it in elm. Simulating a processor with the core states of read, eval, and write was very cool. Using setTimeout to send it clock signals was very slow until I realized I could compose the processor step function to run a few thousand clock cycles per timeout. Wild time.