-
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 #3 from unknownK19/midnight
logic_o3
- Loading branch information
Showing
10 changed files
with
684 additions
and
143 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 |
---|---|---|
|
@@ -4,3 +4,8 @@ version = "0.1.0" | |
edition = "2021" | ||
|
||
[dependencies] | ||
|
||
[lib] | ||
name = "logic_o3" | ||
path = "./src/lib.rs" | ||
|
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,2 +1,7 @@ | ||
# Logic-TriOxide (WIP) | ||
| ![LOGO](https://raw.githubusercontent.com/unknownK19/Logic-TriOxide/3f63015a71fca7dfea67a442c858710aee49de1c/Logo.svg) | Logic-TriOxide (WIP) | | ||
|:--- | :--- | | ||
|
||
Logic Gate API written in rust | ||
|
||
# This is Midnight Branch AKA Testing 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
use logic_o3::logic::{Circuit, LogicCircuit}; | ||
|
||
fn main() { | ||
let and1 = LogicCircuit::new(logic_o3::logic::LogicGate::AND); | ||
let not1 = LogicCircuit::new(logic_o3::logic::LogicGate::NOT); | ||
|
||
let mut nand = Circuit::new(); | ||
|
||
nand.add_logic_gate(and1); | ||
nand.add_logic_gate(not1); | ||
|
||
nand.connection_scheme((0, 1, 0)); | ||
|
||
nand.add_input_connection((true, vec![(0, 0)])); | ||
nand.add_input_connection((false, vec![(0, 1)])); | ||
|
||
nand.add_output_connection(1); | ||
|
||
nand.update(); | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
use logic_o3::logic::{Circuit, LogicCircuit}; | ||
|
||
fn main() { | ||
let or1 = LogicCircuit::new(logic_o3::logic::LogicGate::OR); | ||
let not1 = LogicCircuit::new(logic_o3::logic::LogicGate::NOT); | ||
|
||
let mut nor = Circuit::new(); | ||
|
||
nor.add_logic_gate(or1); | ||
nor.add_logic_gate(not1); | ||
|
||
nor.connection_scheme((0, 1, 0)); | ||
|
||
nor.add_input_connection((false, vec![(0, 0)])); | ||
nor.add_input_connection((false, vec![(0, 1)])); | ||
|
||
nor.add_output_connection(1); | ||
|
||
nor.update(); | ||
println!("{:?}", nor.know_output()); | ||
} |
Oops, something went wrong.