aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDevine Lu Linvega <[email protected]>2018-10-19 09:58:58 +1200
committerDevine Lu Linvega <[email protected]>2018-10-19 09:58:58 +1200
commit49c5e2e52aaec8a81ab17a7faff103ee4ed68181 (patch)
tree423a288a797a4738c838ad7c0aaa432f57a3aadd
parent0cf47bb77c26805b6fb5f97bc09c954759464a1c (diff)
downloadOrca-49c5e2e52aaec8a81ab17a7faff103ee4ed68181.tar.gz
Orca-49c5e2e52aaec8a81ab17a7faff103ee4ed68181.zip
Improved docs
-rw-r--r--README.md19
-rw-r--r--desktop/core/lib.js6
-rw-r--r--desktop/core/lib/_bang.js2
-rw-r--r--desktop/core/lib/_move.js109
-rw-r--r--desktop/core/lib/_wiref.js14
-rw-r--r--desktop/core/lib/_wireh.js14
-rw-r--r--desktop/core/lib/_wiren.js14
-rw-r--r--desktop/core/lib/_wirev.js14
-rw-r--r--desktop/core/lib/e.js5
-rw-r--r--desktop/core/lib/n.js5
-rw-r--r--desktop/core/lib/s.js5
-rw-r--r--desktop/core/lib/w.js5
-rw-r--r--docs.js2
13 files changed, 24 insertions, 190 deletions
diff --git a/README.md b/README.md
index 3094609..357f04d 100644
--- a/README.md
+++ b/README.md
@@ -9,27 +9,36 @@
### alpha functions
- `A`, **add**(math): Creates the result of the addition of east and west fns, southward.
+- `B`, **<missing name>**: Missing docs.
+- `C`, **<missing name>**: Missing docs.
+- `D`, **<missing name>**: Missing docs.
- `E`, **east**(direction): Moves eastward, or bangs.
- `F`, **if**(math): Bangs if east and west fns are equal, southward.
- `G`, **generator**(transport): Generates a direction fn from bang.
- `H`, **halt**(stopper): Stops southward fn from operating.
- `I`, **increment**(trigger): Increments southward numeric fn on bang.
+- `J`, **jump**: Copies the northward fn, southwardly.
- `K`, **kill**(trigger): Kills southward fns, on bang.
- `L`, **loop**(list): Loop a number of characters ahead.
- `M`, **modulo**(math): Creates the result of the modulo operation of east and west fns, southward.
- `N`, **north**(direction): Moves Northward, or bangs.
+- `O`, **<missing name>**: Missing docs.
- `P`, **push**(direction): Moves away, on bang.
+- `Q`, **query**: Call a function by name, freezes 3 characters eastward.
- `R`, **raycast**(transport): Sends a bang to the nearest fn following the direction of the bang.
- `S`, **south**(direction): Moves southward, or bangs.
+- `T`, **trigger**: Bangs southward in the presence of `1`, `N`, `S`, `W`, `E` or `Z` northward.
+- `U`, **<missing name>**: Missing docs.
+- `V`, **value**: Creates a numerical value between 0 and 5 based on the number of present _fns_ westward.
- `W`, **west**(direction): Moves westward, or bangs.
+- `X`, **split**: [FIX]Bangs eastward when westward fn is 0, and southward when fn is 1.
- `Y`, **type**(math): 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.
### special functions
-- `-`, **wire-h**(wire): Send data along the wire, horizontally.
-- `|`, **wire-v**(wire): Send data along the wire, vertically.
-- `~`, **wire-n**(wire): Send data along the wire, entry or exit.
-- `+`, **wire-f**(wire): Send data along the wire, across an intersection.
+- `.`, **null**: void
+- `*`, **bang**: Bangs!
### queries functions
@@ -40,12 +49,12 @@
### Functions(By Type)
- **maths**: `a` `f` `m` `y`.
+- **miscs**: `.` `.` `.` `j` `.` `:` `t` `.` `v` `x` `z` `.` `*`.
- **directions**: `e` `n` `p` `s` `w`.
- **transports**: `g` `r`.
- **stoppers**: `h`.
- **triggers**: `i` `k`.
- **lists**: `l`.
-- **wires**: `-` `|` `*` `-`.
## CLI
diff --git a/desktop/core/lib.js b/desktop/core/lib.js
index fe9aba4..84324be 100644
--- a/desktop/core/lib.js
+++ b/desktop/core/lib.js
@@ -43,11 +43,7 @@ module.exports = {
},
special: {
'.': require('./lib/_null'),
- '*': require('./lib/_bang'),
- '-': require('./lib/_wireh'),
- '|': require('./lib/_wirev'),
- '~': require('./lib/_wiren'),
- '+': require('./lib/_wiref')
+ '*': require('./lib/_bang')
},
queries: {
'bpm': require('./lib/__bpm'),
diff --git a/desktop/core/lib/_bang.js b/desktop/core/lib/_bang.js
index 9e17ac8..ecbde8e 100644
--- a/desktop/core/lib/_bang.js
+++ b/desktop/core/lib/_bang.js
@@ -9,7 +9,7 @@ function FnBang (pico, x, y, passive) {
this.glyph = '*'
this.info = 'Bangs!'
- this.operation = function () {
+ this.haste = function () {
this.remove()
}
}
diff --git a/desktop/core/lib/_move.js b/desktop/core/lib/_move.js
deleted file mode 100644
index 740c073..0000000
--- a/desktop/core/lib/_move.js
+++ /dev/null
@@ -1,109 +0,0 @@
-'use strict'
-
-const FnBase = require('./_base')
-
-function FnMove (pico, x, y, passive) {
- FnBase.call(this, pico, x, y, passive)
-
- this.direction = true
-
- this.proceed = function (ahead, behind, paralG, perpeG, posAhead, moveLeft, moveAcross, moveRight) {
- const wireAhead = ahead && ahead.glyph === paralG
- const wireBehind = behind && (behind.glyph === paralG || behind.glyph === '~' || behind.glyph === '+')
-
- // Is On Wire
- if (wireAhead && wireBehind) {
- pico.add(posAhead.x, posAhead.y, this.glyph)
- this.replace(paralG)
- return true
- }
- // Entering Wire
- else if (!wireBehind && ahead && (ahead.glyph === '~' || ahead.glyph === '+')) {
- pico.add(moveAcross.x, moveAcross.y, moveAcross.glyph)
- this.remove()
- return true
- }
- // At Splitter
- else if (ahead && ahead.glyph === '~') {
- let eject = true
- // Left Turn
- if (pico.glyphAt(moveLeft.x, moveLeft.y) === perpeG) {
- pico.add(moveLeft.x, moveLeft.y, moveLeft.glyph)
- eject = false
- }
- // Right Turn
- if (pico.glyphAt(moveRight.x, moveRight.y) === perpeG) {
- pico.add(moveRight.x, moveRight.y, moveRight.glyph)
- eject = false
- }
- // Exiting
- if (eject || pico.glyphAt(moveAcross.x, moveAcross.y) === paralG) {
- pico.add(moveAcross.x, moveAcross.y, moveAcross.glyph)
- }
- this.replace(paralG)
- return true
- } else if (ahead && ahead.glyph === '+') {
- // Move across
- if (pico.glyphAt(moveAcross.x, moveAcross.y) === paralG) {
- pico.add(moveAcross.x, moveAcross.y, moveAcross.glyph)
- this.replace(paralG)
- return true
- }
- // Or, turn clockwise
- else if (pico.glyphAt(moveRight.x, moveRight.y) === perpeG) {
- pico.add(moveRight.x, moveRight.y, moveRight.glyph)
- this.replace(paralG)
- return true
- }
- // Or, turn anti-clockwise
- else if (pico.glyphAt(moveLeft.x, moveLeft.y) === perpeG) {
- pico.add(moveLeft.x, moveLeft.y, moveLeft.glyph)
- this.replace(paralG)
- return true
- }
- }
- return false
- }
-
- this.signal = function () {
- const e = this.east()
- const w = this.west()
- const n = this.north()
- const s = this.south()
-
- // East Signal
- if (this.glyph === 'e') {
- const posAhead = { x: this.x + 1, y: this.y }
- const moveLeft = { x: this.x + 1, y: this.y - 1, glyph: 'n' }
- const moveRight = { x: this.x + 1, y: this.y + 1, glyph: 's' }
- const moveAcross = { x: this.x + 2, y: this.y, glyph: this.glyph }
- return this.proceed(e, w, '-', '|', posAhead, moveLeft, moveAcross, moveRight)
- }
- // West Signal
- if (this.glyph === 'w') {
- const posAhead = { x: this.x - 1, y: this.y }
- const moveLeft = { x: this.x - 1, y: this.y + 1, glyph: 's' }
- const moveRight = { x: this.x - 1, y: this.y - 1, glyph: 'n' }
- const moveAcross = { x: this.x - 2, y: this.y, glyph: this.glyph }
- return this.proceed(w, e, '-', '|', posAhead, moveLeft, moveAcross, moveRight)
- }
- // North Signal
- if (this.glyph === 'n') {
- const posAhead = { x: this.x, y: this.y - 1 }
- const moveLeft = { x: this.x - 1, y: this.y - 1, glyph: 'w' }
- const moveRight = { x: this.x + 1, y: this.y - 1, glyph: 'e' }
- const moveAcross = { x: this.x, y: this.y - 2, glyph: this.glyph }
- return this.proceed(n, s, '|', '-', posAhead, moveLeft, moveAcross, moveRight)
- }
- // South Signal
- if (this.glyph === 's') {
- const posAhead = { x: this.x, y: this.y + 1 }
- const moveLeft = { x: this.x + 1, y: this.y + 1, glyph: 'e' }
- const moveRight = { x: this.x - 1, y: this.y + 1, glyph: 'w' }
- const moveAcross = { x: this.x, y: this.y + 2, glyph: this.glyph }
- return this.proceed(s, n, '|', '-', posAhead, moveLeft, moveAcross, moveRight)
- }
- }
-}
-
-module.exports = FnMove
diff --git a/desktop/core/lib/_wiref.js b/desktop/core/lib/_wiref.js
deleted file mode 100644
index 73a32dd..0000000
--- a/desktop/core/lib/_wiref.js
+++ /dev/null
@@ -1,14 +0,0 @@
-'use strict'
-
-const FnBase = require('./_base')
-
-function FnWireF (pico, x, y, passive) {
- FnBase.call(this, pico, x, y, passive)
-
- this.type = 'wire'
- this.name = 'wire-f'
- this.glyph = '-'
- this.info = 'Send data along the wire, across an intersection.'
-}
-
-module.exports = FnWireF
diff --git a/desktop/core/lib/_wireh.js b/desktop/core/lib/_wireh.js
deleted file mode 100644
index 746def3..0000000
--- a/desktop/core/lib/_wireh.js
+++ /dev/null
@@ -1,14 +0,0 @@
-'use strict'
-
-const FnBase = require('./_base')
-
-function FnWireH (pico, x, y, passive) {
- FnBase.call(this, pico, x, y, passive)
-
- this.type = 'wire'
- this.name = 'wire-h'
- this.glyph = '-'
- this.info = 'Send data along the wire, horizontally.'
-}
-
-module.exports = FnWireH
diff --git a/desktop/core/lib/_wiren.js b/desktop/core/lib/_wiren.js
deleted file mode 100644
index fdd877c..0000000
--- a/desktop/core/lib/_wiren.js
+++ /dev/null
@@ -1,14 +0,0 @@
-'use strict'
-
-const FnBase = require('./_base')
-
-function FnWireN (pico, x, y, passive) {
- FnBase.call(this, pico, x, y, passive)
-
- this.type = 'wire'
- this.name = 'wire-n'
- this.glyph = '*'
- this.info = 'Send data along the wire, entry or exit.'
-}
-
-module.exports = FnWireN
diff --git a/desktop/core/lib/_wirev.js b/desktop/core/lib/_wirev.js
deleted file mode 100644
index 812a6ee..0000000
--- a/desktop/core/lib/_wirev.js
+++ /dev/null
@@ -1,14 +0,0 @@
-'use strict'
-
-const FnBase = require('./_base')
-
-function FnWireH (pico, x, y, passive) {
- FnBase.call(this, pico, x, y, passive)
-
- this.type = 'wire'
- this.name = 'wire-v'
- this.glyph = '|'
- this.info = 'Send data along the wire, vertically.'
-}
-
-module.exports = FnWireH
diff --git a/desktop/core/lib/e.js b/desktop/core/lib/e.js
index 6099860..ca6d608 100644
--- a/desktop/core/lib/e.js
+++ b/desktop/core/lib/e.js
@@ -1,9 +1,9 @@
'use strict'
-const FnMove = require('./_move')
+const FnBase = require('./_base')
function FnE (pico, x, y, passive) {
- FnMove.call(this, pico, x, y, passive)
+ FnBase.call(this, pico, x, y, passive)
this.type = 'direction'
this.name = 'east'
@@ -11,7 +11,6 @@ function FnE (pico, x, y, passive) {
this.info = 'Moves eastward, or bangs.'
this.haste = function () {
- if (this.signal()) { return }
if (this.is_free(1, 0) !== true) { this.replace('*'); this.lock(); return }
this.move(1, 0)
}
diff --git a/desktop/core/lib/n.js b/desktop/core/lib/n.js
index a0c3bf6..77417f4 100644
--- a/desktop/core/lib/n.js
+++ b/desktop/core/lib/n.js
@@ -1,9 +1,9 @@
'use strict'
-const FnMove = require('./_move')
+const FnBase = require('./_base')
function FnN (pico, x, y, passive) {
- FnMove.call(this, pico, x, y, passive)
+ FnBase.call(this, pico, x, y, passive)
this.type = 'direction'
this.name = 'north'
@@ -11,7 +11,6 @@ function FnN (pico, x, y, passive) {
this.info = 'Moves Northward, or bangs.'
this.haste = function () {
- if (this.signal()) { return }
if (this.is_free(0, -1) !== true) { this.replace('*'); this.lock(); return }
this.move(0, -1)
}
diff --git a/desktop/core/lib/s.js b/desktop/core/lib/s.js
index 4e05e11..9a4c25d 100644
--- a/desktop/core/lib/s.js
+++ b/desktop/core/lib/s.js
@@ -1,9 +1,9 @@
'use strict'
-const FnMove = require('./_move')
+const FnBase = require('./_base')
function FnS (pico, x, y, passive) {
- FnMove.call(this, pico, x, y, passive)
+ FnBase.call(this, pico, x, y, passive)
this.type = 'direction'
this.name = 'south'
@@ -11,7 +11,6 @@ function FnS (pico, x, y, passive) {
this.info = 'Moves southward, or bangs.'
this.haste = function () {
- if (this.signal()) { return }
if (this.is_free(0, 1) !== true) { this.replace('*'); return }
this.move(0, 1)
}
diff --git a/desktop/core/lib/w.js b/desktop/core/lib/w.js
index ac98603..1ea6e95 100644
--- a/desktop/core/lib/w.js
+++ b/desktop/core/lib/w.js
@@ -1,9 +1,9 @@
'use strict'
-const FnMove = require('./_move')
+const FnBase = require('./_base')
function FnW (pico, x, y, passive) {
- FnMove.call(this, pico, x, y, passive)
+ FnBase.call(this, pico, x, y, passive)
this.type = 'direction'
this.name = 'west'
@@ -11,7 +11,6 @@ function FnW (pico, x, y, passive) {
this.info = 'Moves westward, or bangs.'
this.haste = function () {
- if (this.signal()) { return }
if (this.is_free(-1, 0) !== true) { this.replace('*'); this.lock(); return }
this.move(-1, 0)
}
diff --git a/docs.js b/docs.js
index 434d9dd..7450d4d 100644
--- a/docs.js
+++ b/docs.js
@@ -8,7 +8,6 @@ for(const type in lib){
console.log(`\n### ${type} functions\n`)
for(const id in lib[type]){
const fn = new lib[type][id]()
- if(fn.type === 'misc'){ continue; }
if(type !== 'queries'){
if(!types[fn.type]){types[fn.type] = []}
types[fn.type].push(fn)
@@ -19,7 +18,6 @@ for(const type in lib){
console.log("\n### Functions(By Type)\n")
for(const id in types){
- if(id === 'misc'){ continue; }
console.log(`- **${id}s**: ${types[id].reduce((acc,val) => { return `${acc}\`${val.glyph}\` `},"").trim()}.`)
}
console.log("\n") \ No newline at end of file