diff options
author | Devine Lu Linvega <[email protected]> | 2018-11-27 20:12:10 +1200 |
---|---|---|
committer | Devine Lu Linvega <[email protected]> | 2018-11-27 20:12:10 +1200 |
commit | fa21a6c543a999e32275f627c3438678f73b57fe (patch) | |
tree | 8c762960b85a8f0d368c5497778b561ef4577af4 | |
parent | e561da009f40e18734eef1f8f4d99ada653c7e65 (diff) | |
download | Orca-fa21a6c543a999e32275f627c3438678f73b57fe.tar.gz Orca-fa21a6c543a999e32275f627c3438678f73b57fe.zip |
Renamed functions to operators
35 files changed, 168 insertions, 168 deletions
@@ -26,26 +26,26 @@ npm start - `E` **east**: Moves eastward, or bangs. - `F` **if**(a, b): Outputs `1` if inputs are equal, otherwise `0`. - `G` **generator**(val): Outputs a value on bang. -- `H` **halt**: Stops southward fn from operating. -- `I` **increment**(min, max): Increments southward fn. -- `J` **jump**(val): Outputs the northward fn. -- `K` **kill**: Kills southward fn. -- `L` **loop**('len): Loops a number of eastward fns. +- `H` **halt**: Stops southward operator from operating. +- `I` **increment**(min, max): Increments southward operator. +- `J` **jump**(val): Outputs the northward operator. +- `K` **kill**: Kills southward operator. +- `L` **loop**('len): Loops a number of eastward operators. - `M` **modulo**(val, mod): Outputs the modulo of inputs. - `N` **north**: Moves Northward, or bangs. -- `O` **offset**('x, 'y, val): Reads a distant fn with offset. +- `O` **offset**('x, 'y, val): Reads a distant operator with offset. - `P` **push**: Moves away on bang. -- `Q` **count**('len): Counts the number of fns present eastwardly. +- `Q` **count**('len): Counts the number of operators present eastwardly. - `R` **random**(min, max): Outputs a random value. - `S` **south**: Moves southward, or bangs. - `T` **track**('len, 'key, val): Outputs character at eastward position with offset. - `U` **uturn**('n, 'e, 's, 'w): Reverses movement on inputs. -- `V` **beam**: Bangs the nearest southward fn on bang. +- `V` **beam**: Bangs the nearest southward operator on bang. - `W` **west**: Moves westward, or bangs. - `X` **teleport**('x, 'y, val): Outputs value at offset. - `Y` **unknown**: -- - `Z` **diagonal**: Moves diagonally toward south-east. -- `*` **bang**: Bangs neighboring fns. +- `*` **bang**: Bangs neighboring operators. - `:` **midi**('velocity, 'length, channel, octave, note): Sends Midi a midi note. - `;` **udp**('len): Sends a string via UDP to localhost. - `#` **comment**: Comments a line, or characters until the next hash. diff --git a/desktop/core/library/_bang.js b/desktop/core/library/_bang.js index 75eb932..0e4571d 100644 --- a/desktop/core/library/_bang.js +++ b/desktop/core/library/_bang.js @@ -1,12 +1,12 @@ 'use strict' -const Fn = require('../fn') +const Operator = require('../operator') -function FnBang (orca, x, y, passive) { - Fn.call(this, orca, x, y, '*', true) +function OperatorBang (orca, x, y, passive) { + Operator.call(this, orca, x, y, '*', true) this.name = 'bang' - this.info = 'Bangs neighboring fns.' + this.info = 'Bangs neighboring operators.' this.draw = false this.haste = function () { @@ -15,4 +15,4 @@ function FnBang (orca, x, y, passive) { } } -module.exports = FnBang +module.exports = OperatorBang diff --git a/desktop/core/library/_comment.js b/desktop/core/library/_comment.js index e7e8ae6..c09da68 100644 --- a/desktop/core/library/_comment.js +++ b/desktop/core/library/_comment.js @@ -1,9 +1,9 @@ 'use strict' -const Fn = require('../fn') +const Operator = require('../operator') -function FnComment (orca, x, y, passive) { - Fn.call(this, orca, x, y, '#', true) +function OperatorComment (orca, x, y, passive) { + Operator.call(this, orca, x, y, '#', true) this.name = 'comment' this.info = 'Comments a line, or characters until the next hash.' @@ -26,4 +26,4 @@ function FnComment (orca, x, y, passive) { } } -module.exports = FnComment +module.exports = OperatorComment diff --git a/desktop/core/library/_midi.js b/desktop/core/library/_midi.js index a1b7700..fd12c19 100644 --- a/desktop/core/library/_midi.js +++ b/desktop/core/library/_midi.js @@ -1,9 +1,9 @@ 'use strict' -const Fn = require('../fn') +const Operator = require('../operator') -function FnMidi (orca, x, y, passive) { - Fn.call(this, orca, x, y, ':', true) +function OperatorMidi (orca, x, y, passive) { + Operator.call(this, orca, x, y, ':', true) this.name = 'midi' this.info = 'Sends Midi a midi note.' @@ -41,4 +41,4 @@ function FnMidi (orca, x, y, passive) { function clamp (v, min, max) { return v < min ? min : v > max ? max : v } } -module.exports = FnMidi +module.exports = OperatorMidi diff --git a/desktop/core/library/_null.js b/desktop/core/library/_null.js index a8b5b7e..b9b5825 100644 --- a/desktop/core/library/_null.js +++ b/desktop/core/library/_null.js @@ -1,12 +1,12 @@ 'use strict' -const Fn = require('../fn') +const Operator = require('../operator') -function FnNull (orca, x, y, passive) { - Fn.call(this, orca, x, y, '.', passive) +function OperatorNull (orca, x, y, passive) { + Operator.call(this, orca, x, y, '.', passive) this.name = 'null' this.info = 'empty' } -module.exports = FnNull +module.exports = OperatorNull diff --git a/desktop/core/library/_udp.js b/desktop/core/library/_udp.js index a282782..720a2df 100644 --- a/desktop/core/library/_udp.js +++ b/desktop/core/library/_udp.js @@ -1,9 +1,9 @@ 'use strict' -const Fn = require('../fn') +const Operator = require('../operator') -function FnMidi (orca, x, y, passive) { - Fn.call(this, orca, x, y, ';', true) +function OperatorMidi (orca, x, y, passive) { + Operator.call(this, orca, x, y, ';', true) this.name = 'udp' this.info = 'Sends a string via UDP to localhost.' @@ -33,4 +33,4 @@ function FnMidi (orca, x, y, passive) { function clamp (v, min, max) { return v < min ? min : v > max ? max : v } } -module.exports = FnMidi +module.exports = OperatorMidi diff --git a/desktop/core/library/a.js b/desktop/core/library/a.js index 187a621..2152213 100644 --- a/desktop/core/library/a.js +++ b/desktop/core/library/a.js @@ -1,9 +1,9 @@ 'use strict' -const Fn = require('../fn') +const Operator = require('../operator') -function FnA (orca, x, y, passive) { - Fn.call(this, orca, x, y, 'a', passive) +function OperatorA (orca, x, y, passive) { + Operator.call(this, orca, x, y, 'a', passive) this.name = 'add' this.info = 'Outputs the sum of inputs.' @@ -20,4 +20,4 @@ function FnA (orca, x, y, passive) { } } -module.exports = FnA +module.exports = OperatorA diff --git a/desktop/core/library/b.js b/desktop/core/library/b.js index 9a0c40e..8c36151 100644 --- a/desktop/core/library/b.js +++ b/desktop/core/library/b.js @@ -1,9 +1,9 @@ 'use strict' -const Fn = require('../fn') +const Operator = require('../operator') -function FnB (orca, x, y, passive) { - Fn.call(this, orca, x, y, 'b', passive) +function OperatorB (orca, x, y, passive) { + Operator.call(this, orca, x, y, 'b', passive) this.name = 'banger' this.info = 'Bangs if input is `1`, `N`, `S`, `W`, `E` or `Z`.' @@ -19,4 +19,4 @@ function FnB (orca, x, y, passive) { } } -module.exports = FnB +module.exports = OperatorB diff --git a/desktop/core/library/c.js b/desktop/core/library/c.js index 29c33c6..87f149b 100644 --- a/desktop/core/library/c.js +++ b/desktop/core/library/c.js @@ -1,9 +1,9 @@ 'use strict' -const Fn = require('../fn') +const Operator = require('../operator') -function FnC (orca, x, y, passive) { - Fn.call(this, orca, x, y, 'c', passive) +function OperatorC (orca, x, y, passive) { + Operator.call(this, orca, x, y, 'c', passive) this.name = 'clock' this.info = 'Outputs a constant value based on the runtime frame.' @@ -23,4 +23,4 @@ function FnC (orca, x, y, passive) { function clamp (v, min, max) { return v < min ? min : v > max ? max : v } } -module.exports = FnC +module.exports = OperatorC diff --git a/desktop/core/library/d.js b/desktop/core/library/d.js index 7f443f8..aeb980a 100644 --- a/desktop/core/library/d.js +++ b/desktop/core/library/d.js @@ -1,9 +1,9 @@ 'use strict' -const Fn = require('../fn') +const Operator = require('../operator') -function FnD (orca, x, y, passive) { - Fn.call(this, orca, x, y, 'd', true) +function OperatorD (orca, x, y, passive) { + Operator.call(this, orca, x, y, 'd', true) this.name = 'delay' this.info = 'Locks a tile with a timer.' @@ -26,4 +26,4 @@ function FnD (orca, x, y, passive) { } } -module.exports = FnD +module.exports = OperatorD diff --git a/desktop/core/library/e.js b/desktop/core/library/e.js index 902e932..f0c167e 100644 --- a/desktop/core/library/e.js +++ b/desktop/core/library/e.js @@ -1,9 +1,9 @@ 'use strict' -const Fn = require('../fn') +const Operator = require('../operator') -function FnE (orca, x, y, passive) { - Fn.call(this, orca, x, y, 'e', passive) +function OperatorE (orca, x, y, passive) { + Operator.call(this, orca, x, y, 'e', passive) this.name = 'east' this.info = 'Moves eastward, or bangs.' @@ -15,4 +15,4 @@ function FnE (orca, x, y, passive) { } } -module.exports = FnE +module.exports = OperatorE diff --git a/desktop/core/library/f.js b/desktop/core/library/f.js index 4da2f2e..2f5e000 100644 --- a/desktop/core/library/f.js +++ b/desktop/core/library/f.js @@ -1,9 +1,9 @@ 'use strict' -const Fn = require('../fn') +const Operator = require('../operator') -function FnF (orca, x, y, passive) { - Fn.call(this, orca, x, y, 'f', passive) +function OperatorF (orca, x, y, passive) { + Operator.call(this, orca, x, y, 'f', passive) this.name = 'if' this.info = 'Outputs `1` if inputs are equal, otherwise `0`.' @@ -20,4 +20,4 @@ function FnF (orca, x, y, passive) { } } -module.exports = FnF +module.exports = OperatorF diff --git a/desktop/core/library/g.js b/desktop/core/library/g.js index b44da8e..27902ac 100644 --- a/desktop/core/library/g.js +++ b/desktop/core/library/g.js @@ -1,9 +1,9 @@ 'use strict' -const Fn = require('../fn') +const Operator = require('../operator') -function FnG (orca, x, y, passive) { - Fn.call(this, orca, x, y, 'g', passive) +function OperatorG (orca, x, y, passive) { + Operator.call(this, orca, x, y, 'g', passive) this.name = 'generator' this.info = 'Outputs a value on bang.' @@ -21,4 +21,4 @@ function FnG (orca, x, y, passive) { } } -module.exports = FnG +module.exports = OperatorG diff --git a/desktop/core/library/h.js b/desktop/core/library/h.js index a494ed5..2a9f77e 100644 --- a/desktop/core/library/h.js +++ b/desktop/core/library/h.js @@ -1,12 +1,12 @@ 'use strict' -const Fn = require('../fn') +const Operator = require('../operator') -function FnH (orca, x, y, passive) { - Fn.call(this, orca, x, y, 'h', passive) +function OperatorH (orca, x, y, passive) { + Operator.call(this, orca, x, y, 'h', passive) this.name = 'halt' - this.info = 'Stops southward fn from operating.' + this.info = 'Stops southward operator from operating.' this.ports.output = { x: 0, y: 1 } @@ -15,4 +15,4 @@ function FnH (orca, x, y, passive) { } } -module.exports = FnH +module.exports = OperatorH diff --git a/desktop/core/library/i.js b/desktop/core/library/i.js index 54e59c4..9b98773 100644 --- a/desktop/core/library/i.js +++ b/desktop/core/library/i.js @@ -1,12 +1,12 @@ 'use strict' -const Fn = require('../fn') +const Operator = require('../operator') -function FnI (orca, x, y, passive) { - Fn.call(this, orca, x, y, 'i', passive) +function OperatorI (orca, x, y, passive) { + Operator.call(this, orca, x, y, 'i', passive) this.name = 'increment' - this.info = 'Increments southward fn.' + this.info = 'Increments southward operator.' this.ports.input.min = { x: 1, y: 0 } this.ports.input.max = { x: 2, y: 0 } @@ -22,4 +22,4 @@ function FnI (orca, x, y, passive) { } } -module.exports = FnI +module.exports = OperatorI diff --git a/desktop/core/library/j.js b/desktop/core/library/j.js index 469e9d6..cf8e679 100644 --- a/desktop/core/library/j.js +++ b/desktop/core/library/j.js @@ -1,12 +1,12 @@ 'use strict' -const Fn = require('../fn') +const Operator = require('../operator') -function FnJ (orca, x, y, passive) { - Fn.call(this, orca, x, y, 'j', passive) +function OperatorJ (orca, x, y, passive) { + Operator.call(this, orca, x, y, 'j', passive) this.name = 'jump' - this.info = 'Outputs the northward fn.' + this.info = 'Outputs the northward operator.' this.ports.input.val = { x: 0, y: -1 } this.ports.output = { x: 0, y: 1 } @@ -21,4 +21,4 @@ function FnJ (orca, x, y, passive) { } } -module.exports = FnJ +module.exports = OperatorJ diff --git a/desktop/core/library/k.js b/desktop/core/library/k.js index 5146263..2940ae9 100644 --- a/desktop/core/library/k.js +++ b/desktop/core/library/k.js @@ -1,12 +1,12 @@ 'use strict' -const Fn = require('../fn') +const Operator = require('../operator') -function FnK (orca, x, y, passive) { - Fn.call(this, orca, x, y, 'k', passive) +function OperatorK (orca, x, y, passive) { + Operator.call(this, orca, x, y, 'k', passive) this.name = 'kill' - this.info = 'Kills southward fn.' + this.info = 'Kills southward operator.' this.ports.output = { x: 0, y: 1 } this.haste = function () { @@ -14,4 +14,4 @@ function FnK (orca, x, y, passive) { } } -module.exports = FnK +module.exports = OperatorK diff --git a/desktop/core/library/l.js b/desktop/core/library/l.js index 6a893fc..6441eb1 100644 --- a/desktop/core/library/l.js +++ b/desktop/core/library/l.js @@ -1,12 +1,12 @@ 'use strict' -const Fn = require('../fn') +const Operator = require('../operator') -function FnL (orca, x, y, passive) { - Fn.call(this, orca, x, y, 'l', passive) +function OperatorL (orca, x, y, passive) { + Operator.call(this, orca, x, y, 'l', passive) this.name = 'loop' - this.info = 'Loops a number of eastward fns.' + this.info = 'Loops a number of eastward operators.' this.ports.haste.len = { x: -1, y: 0 } @@ -36,4 +36,4 @@ function FnL (orca, x, y, passive) { function clamp (v, min, max) { return v < min ? min : v > max ? max : v } } -module.exports = FnL +module.exports = OperatorL diff --git a/desktop/core/library/m.js b/desktop/core/library/m.js index 6e2518b..5630355 100644 --- a/desktop/core/library/m.js +++ b/desktop/core/library/m.js @@ -1,9 +1,9 @@ 'use strict' -const Fn = require('../fn') +const Operator = require('../operator') -function FnM (orca, x, y, passive) { - Fn.call(this, orca, x, y, 'm', passive) +function OperatorM (orca, x, y, passive) { + Operator.call(this, orca, x, y, 'm', passive) this.name = 'modulo' this.info = 'Outputs the modulo of inputs.' @@ -21,4 +21,4 @@ function FnM (orca, x, y, passive) { } } -module.exports = FnM +module.exports = OperatorM diff --git a/desktop/core/library/n.js b/desktop/core/library/n.js index 9f6330f..a49eb76 100644 --- a/desktop/core/library/n.js +++ b/desktop/core/library/n.js @@ -1,9 +1,9 @@ 'use strict' -const Fn = require('../fn') +const Operator = require('../operator') -function FnN (orca, x, y, passive) { - Fn.call(this, orca, x, y, 'n', passive) +function OperatorN (orca, x, y, passive) { + Operator.call(this, orca, x, y, 'n', passive) this.name = 'north' this.info = 'Moves Northward, or bangs.' @@ -15,4 +15,4 @@ function FnN (orca, x, y, passive) { } } -module.exports = FnN +module.exports = OperatorN diff --git a/desktop/core/library/o.js b/desktop/core/library/o.js index 3dfe44b..0007cd1 100644 --- a/desktop/core/library/o.js +++ b/desktop/core/library/o.js @@ -1,12 +1,12 @@ 'use strict' -const Fn = require('../fn') +const Operator = require('../operator') -function FnO (orca, x, y, passive) { - Fn.call(this, orca, x, y, 'o', passive) +function OperatorO (orca, x, y, passive) { + Operator.call(this, orca, x, y, 'o', passive) this.name = 'offset' - this.info = 'Reads a distant fn with offset.' + this.info = 'Reads a distant operator with offset.' this.ports.haste.x = { x: -2, y: 0 } this.ports.haste.y = { x: -1, y: 0 } @@ -27,4 +27,4 @@ function FnO (orca, x, y, passive) { function clamp (v, min, max) { return v < min ? min : v > max ? max : v } } -module.exports = FnO +module.exports = OperatorO diff --git a/desktop/core/library/p.js b/desktop/core/library/p.js index d1869a7..f403005 100644 --- a/desktop/core/library/p.js +++ b/desktop/core/library/p.js @@ -1,9 +1,9 @@ 'use strict' -const Fn = require('../fn') +const Operator = require('../operator') -function FnP (orca, x, y, passive) { - Fn.call(this, orca, x, y, 'p', passive) +function OperatorP (orca, x, y, passive) { + Operator.call(this, orca, x, y, 'p', passive) this.name = 'push' this.info = 'Moves away on bang.' @@ -15,4 +15,4 @@ function FnP (orca, x, y, passive) { } } -module.exports = FnP +module.exports = OperatorP diff --git a/desktop/core/library/q.js b/desktop/core/library/q.js index cfeee0c..ae37fab 100644 --- a/desktop/core/library/q.js +++ b/desktop/core/library/q.js @@ -1,12 +1,12 @@ 'use strict' -const Fn = require('../fn') +const Operator = require('../operator') -function FnQ (orca, x, y, passive) { - Fn.call(this, orca, x, y, 'q', passive) +function OperatorQ (orca, x, y, passive) { + Operator.call(this, orca, x, y, 'q', passive) this.name = 'count' - this.info = 'Counts the number of fns present eastwardly.' + this.info = 'Counts the number of operators present eastwardly.' this.ports.haste.len = { x: -1, y: 0 } this.ports.output = { x: 0, y: 1 } @@ -30,4 +30,4 @@ function FnQ (orca, x, y, passive) { function clamp (v, min, max) { return v < min ? min : v > max ? max : v } } -module.exports = FnQ +module.exports = OperatorQ diff --git a/desktop/core/library/r.js b/desktop/core/library/r.js index cfb89c5..6f5b325 100644 --- a/desktop/core/library/r.js +++ b/desktop/core/library/r.js @@ -1,9 +1,9 @@ 'use strict' -const Fn = require('../fn') +const Operator = require('../operator') -function FnR (orca, x, y, passive) { - Fn.call(this, orca, x, y, 'r', passive) +function OperatorR (orca, x, y, passive) { + Operator.call(this, orca, x, y, 'r', passive) this.name = 'random' this.info = 'Outputs a random value.' @@ -21,4 +21,4 @@ function FnR (orca, x, y, passive) { } } -module.exports = FnR +module.exports = OperatorR diff --git a/desktop/core/library/s.js b/desktop/core/library/s.js index bcdd700..28e28b8 100644 --- a/desktop/core/library/s.js +++ b/desktop/core/library/s.js @@ -1,9 +1,9 @@ 'use strict' -const Fn = require('../fn') +const Operator = require('../operator') -function FnS (orca, x, y, passive) { - Fn.call(this, orca, x, y, 's', passive) +function OperatorS (orca, x, y, passive) { + Operator.call(this, orca, x, y, 's', passive) this.name = 'south' this.info = 'Moves southward, or bangs.' @@ -15,4 +15,4 @@ function FnS (orca, x, y, passive) { } } -module.exports = FnS +module.exports = OperatorS diff --git a/desktop/core/library/t.js b/desktop/core/library/t.js index 7c7ca70..9ecb7aa 100644 --- a/desktop/core/library/t.js +++ b/desktop/core/library/t.js @@ -1,9 +1,9 @@ 'use strict' -const Fn = require('../fn') +const Operator = require('../operator') -function FnT (orca, x, y, passive) { - Fn.call(this, orca, x, y, 't', passive) +function OperatorT (orca, x, y, passive) { + Operator.call(this, orca, x, y, 't', passive) this.name = 'track' this.info = 'Outputs character at eastward position with offset.' @@ -30,4 +30,4 @@ function FnT (orca, x, y, passive) { function clamp (v, min, max) { return v < min ? min : v > max ? max : v } } -module.exports = FnT +module.exports = OperatorT diff --git a/desktop/core/library/u.js b/desktop/core/library/u.js index ce49c74..c602377 100644 --- a/desktop/core/library/u.js +++ b/desktop/core/library/u.js @@ -1,9 +1,9 @@ 'use strict' -const Fn = require('../fn') +const Operator = require('../operator') -function FnU (orca, x, y, passive) { - Fn.call(this, orca, x, y, 'u', passive) +function OperatorU (orca, x, y, passive) { + Operator.call(this, orca, x, y, 'u', passive) this.name = 'uturn' this.info = 'Reverses movement on inputs.' @@ -30,4 +30,4 @@ function FnU (orca, x, y, passive) { } } -module.exports = FnU +module.exports = OperatorU diff --git a/desktop/core/library/v.js b/desktop/core/library/v.js index a547bc7..d0a0ba0 100644 --- a/desktop/core/library/v.js +++ b/desktop/core/library/v.js @@ -1,12 +1,12 @@ 'use strict' -const Fn = require('../fn') +const Operator = require('../operator') // TODO -function FnV (orca, x, y, passive) { - Fn.call(this, orca, x, y, 'v', passive) +function OperatorV (orca, x, y, passive) { + Operator.call(this, orca, x, y, 'v', passive) this.name = 'beam' - this.info = 'Bangs the nearest southward fn on bang.' + this.info = 'Bangs the nearest southward operator on bang.' this.ports.output = { x: 0, y: 1, unlock: true } @@ -27,4 +27,4 @@ function FnV (orca, x, y, passive) { } } -module.exports = FnV +module.exports = OperatorV diff --git a/desktop/core/library/w.js b/desktop/core/library/w.js index 6f2e1e1..a11ccc3 100644 --- a/desktop/core/library/w.js +++ b/desktop/core/library/w.js @@ -1,9 +1,9 @@ 'use strict' -const Fn = require('../fn') +const Operator = require('../operator') -function FnW (orca, x, y, passive) { - Fn.call(this, orca, x, y, 'w', passive) +function OperatorW (orca, x, y, passive) { + Operator.call(this, orca, x, y, 'w', passive) this.name = 'west' this.info = 'Moves westward, or bangs.' @@ -15,4 +15,4 @@ function FnW (orca, x, y, passive) { } } -module.exports = FnW +module.exports = OperatorW diff --git a/desktop/core/library/x.js b/desktop/core/library/x.js index 23e945b..7f341df 100644 --- a/desktop/core/library/x.js +++ b/desktop/core/library/x.js @@ -1,9 +1,9 @@ 'use strict' -const Fn = require('../fn') +const Operator = require('../operator') -function FnX (orca, x, y, passive) { - Fn.call(this, orca, x, y, 'x', passive) +function OperatorX (orca, x, y, passive) { + Operator.call(this, orca, x, y, 'x', passive) this.name = 'teleport' this.info = 'Outputs value at offset.' @@ -31,4 +31,4 @@ function FnX (orca, x, y, passive) { function clamp (v, min, max) { return v < min ? min : v > max ? max : v } } -module.exports = FnX +module.exports = OperatorX diff --git a/desktop/core/library/y.js b/desktop/core/library/y.js index 4cb8acd..777b07a 100644 --- a/desktop/core/library/y.js +++ b/desktop/core/library/y.js @@ -1,9 +1,9 @@ 'use strict' -const Fn = require('../fn') +const Operator = require('../operator') -function FnY (orca, x, y, passive) { - Fn.call(this, orca, x, y, 'y', passive) +function OperatorY (orca, x, y, passive) { + Operator.call(this, orca, x, y, 'y', passive) } -module.exports = FnY +module.exports = OperatorY diff --git a/desktop/core/library/z.js b/desktop/core/library/z.js index 7316fac..d67e748 100644 --- a/desktop/core/library/z.js +++ b/desktop/core/library/z.js @@ -1,9 +1,9 @@ 'use strict' -const Fn = require('../fn') +const Operator = require('../operator') -function FnZ (orca, x, y, passive) { - Fn.call(this, orca, x, y, 'z', passive) +function OperatorZ (orca, x, y, passive) { + Operator.call(this, orca, x, y, 'z', passive) this.name = 'diagonal' this.info = 'Moves diagonally toward south-east.' @@ -15,4 +15,4 @@ function FnZ (orca, x, y, passive) { } } -module.exports = FnZ +module.exports = OperatorZ diff --git a/desktop/core/fn.js b/desktop/core/operator.js index bfd678a..1cb79d2 100644 --- a/desktop/core/fn.js +++ b/desktop/core/operator.js @@ -1,6 +1,6 @@ 'use strict' -function Fn (orca, x, y, glyph = '.', passive = false) { +function Operator (orca, x, y, glyph = '.', passive = false) { this.name = 'unknown' this.x = x this.y = y @@ -106,4 +106,4 @@ function Fn (orca, x, y, glyph = '.', passive = false) { } } -module.exports = Fn +module.exports = Operator diff --git a/desktop/core/orca.js b/desktop/core/orca.js index 3e026b1..fa39f4e 100644 --- a/desktop/core/orca.js +++ b/desktop/core/orca.js @@ -28,13 +28,13 @@ function Orca (library = {}) { this.s = this.clean(s) } - this.write = function (x, y, ch) { - if (ch.length !== 1) { return } + this.write = function (x, y, g) { + if (g.length !== 1) { return } if (!this.inBounds(x, y)) { return } - if (!this.isAllowed(ch)) { return } - if (this.glyphAt(x, y) === ch) { return } + if (!this.isAllowed(g)) { return } + if (this.glyphAt(x, y) === g) { return } const index = this.indexAt(x, y) - this.s = this.s.substr(0, index) + ch + this.s.substr(index + ch.length) + this.s = this.s.substr(0, index) + g + this.s.substr(index + g.length) } this.clean = function (str) { @@ -44,16 +44,16 @@ function Orca (library = {}) { return s } - // Fns + // Operators this.parse = function () { const a = [] for (let y = 0; y < this.h; y++) { for (let x = 0; x < this.w; x++) { const g = this.glyphAt(x, y) - const fn = this.cast(g, x, y) - if (fn) { - a.push(fn) + const operator = this.cast(g, x, y) + if (operator) { + a.push(operator) } } } @@ -67,21 +67,21 @@ function Orca (library = {}) { return new library[g.toLowerCase()](this, x, y, passive) } - this.operate = function (fns) { + this.operate = function (operators) { this.release() - for (const id in fns) { - const fn = fns[id] - if (this.lockAt(fn.x, fn.y)) { continue } - if (fn.passive || fn.bang()) { - fn.haste() - fn.permissions() + for (const id in operators) { + const operator = operators[id] + if (this.lockAt(operator.x, operator.y)) { continue } + if (operator.passive || operator.bang()) { + operator.haste() + operator.permissions() } } - for (const id in fns) { - const fn = fns[id] - if (this.lockAt(fn.x, fn.y)) { continue } - if (fn.passive || fn.bang()) { - fn.run() + for (const id in operators) { + const operator = operators[id] + if (this.lockAt(operator.x, operator.y)) { continue } + if (operator.passive || operator.bang()) { + operator.run() } } } @@ -2,9 +2,9 @@ const lib = require('./desktop/core/library') console.log("## Functions\n") for(const id in lib){ - const fn = new lib[id]() - if(fn.glyph === '.'){ continue; } - console.log(`- ${fn.docs()}`) + const operator = new lib[id]() + if(operator.glyph === '.'){ continue; } + console.log(`- ${operator.docs()}`) } console.log("\n")
\ No newline at end of file |