Skip to content

Instantly share code, notes, and snippets.

@ryanramage
Created November 30, 2019 17:23
Show Gist options
  • Save ryanramage/c057252c13aa4494ad1542fbd41fa0f8 to your computer and use it in GitHub Desktop.
Save ryanramage/c057252c13aa4494ad1542fbd41fa0f8 to your computer and use it in GitHub Desktop.
niff
library['_'] = function Operator_ (orca, x, y, passive) {
Operator.call(this, orca, x, y, '_', passive)
this.name = 'niff'
this.info = 'Reads offset, if equal to char'
this.ports.x = { x: -2, y: 0 }
this.ports.y = { x: -1, y: 0 }
this.ports.comparison = { x: 1, y: 0 }
this.ports.output = { x: 0, y: 1, bang: true }
this.operation = function (force = false) {
const x = 0 - this.listen(this.ports.x, true)
const y = 0 - (this.listen(this.ports.y, true) + 1)
this.ports.val = {x, y }
const a = this.listen(this.ports.comparison)
const b = this.listen(this.ports.val)
return a !== b
}
}
.....Z......................................
...h10xTG.GGC..DD.Cc.CD.DGGC..DD.Cc.CD.D.#..
...*:11G....................................
.........40_#...............................
...........*h...............................
............E...............................
............................................
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment