# Circuit Artist – Circuit simulator with propagation animati…

Hello, Circuit Artist is a game about drawing digital circuits as pixel art — like MS Paint, but pixels are wires and little triangles are NANDs. Hit play and the simulation runs in real time. It's fully white-box: every wire's state is visible. I launched it last year with a unit-delay simulation…

- **Page:** https://magpie.gallery/i/circuit-artist-circuit-simulator-with-propagation-ohq8
- **Type:** Link to an idea elsewhere
- **Category:** Games
- **Runs on:** web
- **Tags:** circuits, simulation, pixel-art, logic-gates, puzzle

## Source

Web · rafinha: Circuit Artist – Circuit simulator with propagation animation, rewind

- **Original:** https://news.ycombinator.com/item?id=46445412

> Hello, Circuit Artist is a game about drawing digital circuits as pixel art — like MS Paint, but pixels are wires and little triangles are NANDs. Hit play and the simulation runs in real time. It's fully white-box: every wire's state is visible. I launched it last year with a unit-delay simulation that ran until convergence on each update. It worked, but I realized it had some fundamental problems: (i) It hid what was actually happening. Players couldn't tell the difference between a ripple carry adder and a look-ahead adder — everything just resolved instantly. (ii) Design bugs became "game bugs." When players had non-converging wires (like A = not(A)), the game couldn't explain why or where the error was. (iii) Layout didn't matter. A NAND on one side of the map would instantly propagate to the opposite side, making spatial decisions meaningless. Unit delay probably works better for schematic-based simulators like Logisim, not a layout-focused game like this. (iv) Propagation visualization couldn't be added on top of the unit-delay engine — there was no notion of direction or distance. So I rebuilt the engine with variable-delay event-based simulation using an adaptation of Elmore delay. The delay for each wire depends on distance and fanout — longer wires are slower, higher fanout adds delay, branching wires are faster. For the implementation: I compute Elmore delay over wire trees. Each pixel has resistance and capacitance, with NAND inputs as nodes to account for fanout. For non-tree wire graphs, I build a Dijkstra-based spanning tree (driver as root) and interpolate for edges outside the tree. I calculate the delay for each node and project it back to the image so every pixel has a distance. This lets me animate propagation with a glow effect during simulation. The shader knows when each wire was triggered, the current time, and the Elmore distance of each pixel, so it resolves state per-pixel in real time. On top of that: - Time rewind: the simulation is now

## GitHub projects

- https://github.com/lets-all-be-stupid-forever/circuit-artist

## Rules for reuse

- Build your own version: don't copy another product's code, look, icons, colours or copy.
- The original belongs to its author; Magpie only links to it.
- The original content's copyright belongs to its creator. Magpie doesn't download or re-upload it; we only show the link and the official preview.
