-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from unknownK19/main
Adding Stable Documentation to midnight branch
- Loading branch information
Showing
5 changed files
with
60 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Rust | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- midnight | ||
pull_request: | ||
branches: | ||
- main | ||
- midnight | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Build | ||
run: cargo build --verbose | ||
- name: Run tests | ||
run: cargo test --verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,4 @@ | |
|
||
Logic Gate API written in rust | ||
|
||
# This is Midnight Branch AKA Testing Branch | ||
|
||
# Stable Branch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,23 @@ | ||
use logic_o3::logic::{Circuit, LogicCircuit}; | ||
|
||
fn main() { | ||
// Create new Logic Gate | ||
// Add Two Logic Gate | ||
let and1 = LogicCircuit::new(logic_o3::logic::LogicGate::AND); | ||
let not1 = LogicCircuit::new(logic_o3::logic::LogicGate::NOT); | ||
|
||
// Create Empty Circuit | ||
// Create New Circuit | ||
let mut nand = Circuit::new(); | ||
|
||
// Add Two Logic Gate AKA Component | ||
// Insert Two Logic Gate | ||
nand.add_logic_gate(and1); | ||
nand.add_logic_gate(not1); | ||
|
||
// Connect wire between two component (from_comp_id, to_comp_id, to_comp_input_index) | ||
// Connect wire between Two Gate | ||
nand.connection_scheme((0, 1, 0)); | ||
|
||
// Add Two Input Signal | ||
// Add Input Signal on Circuit | ||
nand.add_input_connection((true, vec![(0, 0)])); | ||
nand.add_input_connection((false, vec![(0, 1)])); | ||
|
||
// Add One Output Signal | ||
// Add Output Signal to know Output of this Circuit | ||
nand.add_output_connection(1); | ||
|
||
// Refreshing for change | ||
// Update Cicuit in According to Input | ||
nand.update(); | ||
|
||
// And Done | ||
// TADA !! | ||
println!("{:?}", nand.know_output()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters