aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDevine Lu Linvega <[email protected]>2018-10-18 10:03:45 +1200
committerDevine Lu Linvega <[email protected]>2018-10-18 10:03:45 +1200
commit61ae575172077d36e2400a538e679f427b8e195e (patch)
tree3a456f9995c026e6227de0e4d39fb3c2934492cd
parent51511851813f0da6b6b6b905ced6d42105c069e2 (diff)
downloadOrca-61ae575172077d36e2400a538e679f427b8e195e.tar.gz
Orca-61ae575172077d36e2400a538e679f427b8e195e.zip
Flagged functions to improve
-rw-r--r--README.md10
-rw-r--r--desktop/core/lib/c.js2
-rw-r--r--desktop/core/lib/d.js2
-rw-r--r--desktop/core/lib/g.js2
-rw-r--r--desktop/core/lib/j.js20
-rw-r--r--desktop/core/lib/r.js5
-rw-r--r--desktop/core/lib/t.js4
-rw-r--r--desktop/core/lib/x.js2
8 files changed, 20 insertions, 27 deletions
diff --git a/README.md b/README.md
index 46de638..c65e32d 100644
--- a/README.md
+++ b/README.md
@@ -23,14 +23,14 @@
- `A`, **add**: Creates the result of the addition of east and west fns, southward.
- `B`, **bang**: The bang is used to trigger various fns, only lasts one cycle.
-- `C`, **clamp**: Clamp the northern fn between the westward and eastward fn bang.
-- `D`, **deflect**: Converts neighboors into direction fns.
+- `C`, **clamp**: [FIX]Clamp the northern fn between the westward and eastward fn bang.
+- `D`, **deflect**: [FIX]Converts neighboors into direction fns.
- `E`, **east**: Moves eastward, or bangs.
- `F`, **if**: Bangs if east and west fns are equal, southward.
-- `G`, **generator**: Generates a direction fn from bang.
+- `G`, **generator**: [FIX]Generates a direction fn from bang.
- `H`, **halt**: Stops southward fn from operating.
- `I`, **increment**: Increments southward numeric fn on bang.
-- `J`, **jump**: [TODO]Moves the westward fn to eastward, or the eastward fn westward, on bang.
+- `J`, **jump**: Copies the northward fn, southwardly.
- `K`, **kill**: [TODO]Kills southward fns, on bang.
- `L`, **loop**: Loop a number of characters ahead.
- `M`, **modulo**: Creates the result of the modulo operation of east and west fns, southward.
@@ -44,7 +44,7 @@
- `U`, **idle**: [TODO]Nothing..
- `V`, **value**: Creates a numerical value between 0 and 5 based on the number of present _fns_ westward.
- `W`, **west**: Moves westward, or bangs.
-- `X`, **split**: Bangs eastward when westward fn is 0, and southward when fn is 1.
+- `X`, **split**: [FIX]Bangs eastward when westward fn is 0, and southward when fn is 1.
- `Y`, **type**: Compares the type(num/alpha/special) of westward and eastward fns, and return 1 or 0 southward.
- `Z`, **creep**: Moves to a the next available location in a cycle of E, S, W, N based on the runtime frame.
diff --git a/desktop/core/lib/c.js b/desktop/core/lib/c.js
index 784b400..7ba709d 100644
--- a/desktop/core/lib/c.js
+++ b/desktop/core/lib/c.js
@@ -6,7 +6,7 @@ function FnC (pico, x, y) {
this.name = 'clamp'
this.glyph = 'c'
- this.info = 'Clamp the northern fn between the westward and eastward fn bang.'
+ this.info = '[FIX]Clamp the northern fn between the westward and eastward fn bang.'
this.ports = [{ x: 0, y: 0, bang: true }, { x: 1, y: 0, output: true }, { x: -1, y: 0 }]
this.operation = function () {
diff --git a/desktop/core/lib/d.js b/desktop/core/lib/d.js
index 136fe27..f360ae1 100644
--- a/desktop/core/lib/d.js
+++ b/desktop/core/lib/d.js
@@ -7,7 +7,7 @@ function FnD (pico, x, y) {
this.name = 'deflect'
this.glyph = 'd'
- this.info = 'Converts neighboors into direction fns.'
+ this.info = '[FIX]Converts neighboors into direction fns.'
this.ports = [{ x: 0, y: 1 }, { x: 0, y: -1 }, { x: 1, y: 0 }, { x: -1, y: 0 }]
this.operation = function () {
diff --git a/desktop/core/lib/g.js b/desktop/core/lib/g.js
index 66acdc9..32581bf 100644
--- a/desktop/core/lib/g.js
+++ b/desktop/core/lib/g.js
@@ -7,7 +7,7 @@ function FnG (pico, x, y) {
this.name = 'generator'
this.glyph = 'g'
- this.info = 'Generates a direction fn from bang.'
+ this.info = '[FIX]Generates a direction fn from bang.'
this.ports = [{ x: 0, y: 1, output: true }, { x: 0, y: 0, bang: true }]
diff --git a/desktop/core/lib/j.js b/desktop/core/lib/j.js
index fa5f09d..ea4e99c 100644
--- a/desktop/core/lib/j.js
+++ b/desktop/core/lib/j.js
@@ -8,24 +8,16 @@ function FnJ (pico, x, y) {
// TODO
this.name = 'jump'
this.glyph = 'j'
- this.info = '[TODO]Moves the westward fn to eastward, or the eastward fn westward, on bang.'
+ this.info = 'Copies the northward fn, southwardly.'
- this.ports = [{ x: -1, y: 0 }, { x: 1, y: 0, output: true }, { x: 0, y: 0, bang: true }]
+ this.ports = [{ x: 0, y: -1, input: true }, { x: 0, y: 1, output: true }]
this.operation = function () {
- if (!this.bang()) { return }
+ const n = this.north()
+ if (!n) { return }
- if (this.west()) {
- pico.add(this.x + 1, this.y, this.west().glyph)
- pico.remove(this.x - 1, this.y)
- pico.lock(this.x - 1, this.y)
- pico.lock(this.x + 1, this.y)
- } else if (this.east()) {
- pico.add(this.x - 1, this.y, this.east().glyph)
- pico.remove(this.x + 1, this.y)
- pico.lock(this.x - 1, this.y)
- pico.lock(this.x + 1, this.y)
- }
+ pico.add(this.x, this.y + 1, n.glyph)
+ pico.lock(this.x, this.y + 1)
}
}
diff --git a/desktop/core/lib/r.js b/desktop/core/lib/r.js
index 45ab684..454f411 100644
--- a/desktop/core/lib/r.js
+++ b/desktop/core/lib/r.js
@@ -17,9 +17,10 @@ function FnR (pico, x, y) {
let prev = beam
while (pico.inBounds(beam.x, beam.y)) {
beam = { x: beam.x + vector.x, y: beam.y + vector.y }
- if (pico.glyphAt(beam.x, beam.y) !== '.' || !pico.inBounds(beam.x, beam.y)) {
+ const busy = pico.glyphAt(beam.x, beam.y) !== '.' && pico.glyphAt(beam.x, beam.y) !== 'b'
+ const outside = !pico.inBounds(beam.x, beam.y)
+ if (busy || outside) {
pico.add(prev.x, prev.y, 'b')
- pico.lock(prev.x, prev.y)
break
}
prev = beam
diff --git a/desktop/core/lib/t.js b/desktop/core/lib/t.js
index dadc4ce..b30a2da 100644
--- a/desktop/core/lib/t.js
+++ b/desktop/core/lib/t.js
@@ -8,10 +8,10 @@ function FnT (pico, x, y) {
this.name = 'trigger'
this.glyph = 't'
this.info = 'Bangs southward in the presence of `1`, `N`, `S`, `W`, `E` or `Z` northward.'
- this.ports = [{ x: 0, y: -1 }, { x: 0, y: 1, output: true }]
+ this.ports = [{ x: -1, y: 0, bang: true }, { x: 0, y: 1, output: true }]
this.operation = function () {
- const n = this.north()
+ const n = this.west()
if (!n) { return }
diff --git a/desktop/core/lib/x.js b/desktop/core/lib/x.js
index e248fb5..7edb8eb 100644
--- a/desktop/core/lib/x.js
+++ b/desktop/core/lib/x.js
@@ -7,7 +7,7 @@ function FnX (pico, x, y) {
this.name = 'split'
this.glyph = 'x'
- this.info = 'Bangs eastward when westward fn is 0, and southward when fn is 1.'
+ this.info = '[FIX]Bangs eastward when westward fn is 0, and southward when fn is 1.'
this.ports = [{ x: -1, y: 0 }, { x: 0, y: 1, output: true }, { x: 1, y: 0, output: true }]
this.operation = function () {