Light the led unless both switches are on.
5 comments
I drew inspiration from the circuit simulator in SICP and a tool called Logisim,
and used Lisp to design a circuit simulation library.
The core concept was:
Each function could generate a circuit module,
that accepted multiple input lines—each consisting of multiple bits,
and produced a single output line, which also consisted of multiple bits.
For example, an adder would take two $n$-bit lines as input and output a single $n$-bit line.
Using this simulation library, I also built a simple CPU and implemented a factorial function using its machine language.
I was also heavily inspired by the Steam game 'Turing Complete' but wanted something code based to not need to manually wire in the GUI. Thanks for taking a look
https://github.com/mindChickey/circuit/tree/master/cirlisp
There is no documentation, but I think the design is worth a look.
The specific language doesn't matter much; using TypeScript to run it in the browser is a good choice.
As for a graphical interface for wires and gates—I don't think it's necessary;
Expressing it directly in code is more efficient..
Read the full thread on Hacker News →
Related stories
- Hacker News · 1 points · 6 days ago
- DEV Community · 3 points · 12 days ago
- Hacker News · 1 points · 8 days ago
- DEV Community · 3 points · 8 days ago
- Show HN: A 3D Mac window switcher with browser tab support and searchbetterwindowswitcher.comHacker News · 2 points · 10 days ago
- Hacker News · 1 points · 3 days ago