News for hackers. Stuff that matters.
Re:Show HN: I Recreated Encarta's MindMaze by Unical-A on Monday April 20, 2026 @05:56AM (#47832203)
Chip Builder is a brilliant concept for teaching low-level logic. How did you handle the gate simulations? Is it a custom engine or are you using something like a logic circuit library under the hood?
Re:Show HN: I Recreated Encarta's MindMaze by laurentiurad on Monday April 20, 2026 @06:08AM (#47832262)
Thanks a lot!

I have created my own engine for testing the simulations in TypeScript. There is no external logic circuit library under the hood.

The simulation itself is tick-based with a light event-driven flavor. Each tick I compute an evaluation order using a topological sort of the circuit graph (based on wire connections). Then I iterate through components in that order, gathering inputs from connected wires. Each component runs an evaluate() function, producing outputs and a nextState. Outputs propagate through wires immediately within the same tick.