# circuit-sim **Repository Path**: CharlieLUO/circuit-sim ## Basic Information - **Project Name**: circuit-sim - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-04-29 - **Last Updated**: 2026-04-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Circuit Sim A small C++ desktop MVP for editing and simulating NAND-based digital circuits. ## Build ```sh cmake -S . -B build cmake --build build ctest --test-dir build --output-on-failure ``` Run the app: ```sh ./build/circuit_sim ``` If you only want the core tests: ```sh cmake -S . -B build-core -DCIRCUIT_SIM_BUILD_APP=OFF cmake --build build-core ctest --test-dir build-core --output-on-failure ``` ## Controls - Use the `Game` tab for the Nandgame-style level flow. - Use the `Playground` tab for developer exploration and free editing. - Add unlocked/available components from the left toolbar. - Click an `Input` gate to toggle `0/1`. - Drag from an output pin to an input pin to create a wire. - Drag an already-connected input pin to modify its connection. - Select a wire and use `Disconnect Selected Wire`, press Delete, or right-click the wire to disconnect its fanout inputs. - A selected wire highlights its source output pin and all connected input pins. - Drag gates with the left mouse button. - Pan with the middle mouse button. - Zoom with the mouse wheel. - Press Delete to remove the selected gate. - Use File > Save / Load for JSON persistence. - Add unlocked built-in components from the toolbar. - Use `Save As Component` to save the current circuit as a reusable user component. - Use `Expand To NAND` to replace reusable components with their primitive NAND-level implementation. ## Game Mode The first level set introduces `NOT`, `AND`, `OR`, and `XOR`. Each level provides fixed input/output ports, limits the available parts by unlock state, runs truth-table tests, and unlocks the completed component for later levels.