initial commit

master
Niggeroni 2022-11-10 23:26:41 +01:00
commit 1f880d3027
18 changed files with 68 additions and 0 deletions

BIN
assets/and.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
assets/loff.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 897 B

BIN
assets/lon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
assets/nand.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
assets/nor.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
assets/not.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
assets/off.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 424 B

BIN
assets/on.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 389 B

BIN
assets/or.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
assets/xor.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

10
gates/gate.js Normal file
View File

@ -0,0 +1,10 @@
class Gate {
constructor(type) {
switch (type) {
case 'logic':
break;
default:
break;
}
}
}

0
gates/light/light.js Normal file
View File

16
gates/logic/not.js Normal file
View File

@ -0,0 +1,16 @@
class Not {
constructor() {
this.inputs = 1;
this.outputs = 1;
this.values = NULL;
}
calculate() {
if (this.values && this.inputs == this.outputs) {
for (let i= 0; i < this.values.length; i++) {
}
}
}
}

0
gates/switch/switch.js Normal file
View File

BIN
images/example.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

14
index.html Normal file
View File

@ -0,0 +1,14 @@
<script src="p5.min.js"></script>
<script src="sketch.js"></script>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Logic gate simulator</title>
</head>
<body style="margin: 0;">
</body>
</html>

2
p5.min.js vendored Normal file

File diff suppressed because one or more lines are too long

26
sketch.js Normal file
View File

@ -0,0 +1,26 @@
//preload images
function preload() {
and = loadImage('assets/and.png');
not = loadImage('assets/not.png');
or = loadImage('assets/or.png');
xor = loadImage('assets/xor.png');
nand = loadImage('assets/nand.png');
nor = loadImage('assets/nor.png');
on = loadImage('assets/on.png');
off = loadImage('assets/off.png');
lon = loadImage('assets/lon.png');
loff = loadImage('assets/loff.png');
}
function setup() {
createCanvas(displayWidth, displayHeight);
}
function draw() {
background(0);
stroke(255);
}
function mousePressed() {
}