Skip to content

Commit

Permalink
Merge pull request #3 from unknownK19/midnight
Browse files Browse the repository at this point in the history
logic_o3
  • Loading branch information
unknownK19 authored May 19, 2024
2 parents 5cc4470 + d42c238 commit d3883e7
Show file tree
Hide file tree
Showing 10 changed files with 684 additions and 143 deletions.
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ version = "0.1.0"
edition = "2021"

[dependencies]

[lib]
name = "logic_o3"
path = "./src/lib.rs"

324 changes: 324 additions & 0 deletions Logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion README.md
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

21 changes: 21 additions & 0 deletions examples/example01.rs
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());
}
21 changes: 21 additions & 0 deletions examples/example02.rs
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());
}
Loading

0 comments on commit d3883e7

Please sign in to comment.