Merge pull request #300 from JustAGenericUsername/main

gate
This commit is contained in:
slweeb 2024-01-24 21:47:22 -05:00 committed by GitHub
commit bdaf4f8d31
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 42 additions and 0 deletions

View File

@ -197,6 +197,48 @@ elements.or_gate = {
}
}
}
elements.nand_gate = {
color: "#eb4034",
category: "logic",
state: "solid",
behavior: behaviors.WALL,
tick: function(pixel){
var countNeighborsResult = countNeighbors()
if (countNeighborsResult.uncharged){
chargeOutputs();
} else {
unchargeOutputs();
}
}
}
elements.nor_gate = {
color: "#eb8c34",
category: "logic",
state: "solid",
behavior: behaviors.WALL,
tick: function(pixel){
var countNeighborsResult = countNeighbors()
if (!countNeighborsResult.charged){
chargeOutputs();
} else {
unchargeOutputs();
}
}
}
elements.nxor_gate = {
color: "#ebd834",
category: "logic",
state: "solid",
behavior: behaviors.WALL,
tick: function(pixel){
var countNeighborsResult = countNeighbors()
if (!(countNeighborsResult.charged == 1)){
chargeOutputs();
} else {
unchargeOutputs();
}
}
}
elements.E2L_lever = {
color: "#b2ba75",
behavior: behaviors.WALL,