aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDevine Lu Linvega <[email protected]>2018-10-15 16:55:48 +1200
committerDevine Lu Linvega <[email protected]>2018-10-15 16:55:48 +1200
commit3300c3ca6a9773111ec597fc40663163ef98e994 (patch)
treeec47bc8134544d0ccfd40e727eab84ab160563ce
parent76b1f2035beacc8fbcb0d301cb4fda880582fcd3 (diff)
downloadOrca-3300c3ca6a9773111ec597fc40663163ef98e994.tar.gz
Orca-3300c3ca6a9773111ec597fc40663163ef98e994.zip
Tightened interface
-rw-r--r--desktop/core/lib/_port.js2
-rw-r--r--desktop/sources/index.html2
-rw-r--r--desktop/sources/scripts/terminal.js3
-rw-r--r--examples/loop.pico38
4 files changed, 24 insertions, 21 deletions
diff --git a/desktop/core/lib/_port.js b/desktop/core/lib/_port.js
index ac8a202..0a5ec0a 100644
--- a/desktop/core/lib/_port.js
+++ b/desktop/core/lib/_port.js
@@ -9,6 +9,8 @@ function FnPort (pico, x, y) {
this.glyph = ':'
this.info = 'Call a function by name, freeze 3 characters eastward.'
+ this.ports = [{ x: 1, y: 0, bang: true },{ x: 2, y: 0, bang: true },{ x: 3, y: 0, bang: true }]
+
this.haste = function () {
pico.lock(this.x + 1, this.y)
pico.lock(this.x + 2, this.y)
diff --git a/desktop/sources/index.html b/desktop/sources/index.html
index 6654976..fa09315 100644
--- a/desktop/sources/index.html
+++ b/desktop/sources/index.html
@@ -21,7 +21,7 @@
const Pico = require('../core/pico')
const Terminal = require('./scripts/terminal')
- const pico = new Pico(39, 27)
+ const pico = new Pico(59, 27)
const terminal = new Terminal(pico)
terminal.install(document.body)
diff --git a/desktop/sources/scripts/terminal.js b/desktop/sources/scripts/terminal.js
index 9e29d97..9945f5f 100644
--- a/desktop/sources/scripts/terminal.js
+++ b/desktop/sources/scripts/terminal.js
@@ -6,7 +6,7 @@ function Terminal (pico) {
this.controller = new Controller();
this.theme = new Theme(this.theme = new Theme({ background: '#111111', f_high: '#ffffff', f_med: '#333333', f_low: '#000000', f_inv: '#000000', b_high: '#ffb545', b_med: '#72dec2', b_low: '#444444', b_inv: '#ffffff'}));
this.is_paused = false
- this.tile = { w: 15, h: 20 }
+ this.tile = { w: 10, h: 20 }
this.debug = "hello."
this.cursor = {
@@ -142,6 +142,7 @@ function Terminal (pico) {
const fns = pico.findFns()
for (const id in fns) {
const g = fns[id]
+ if(pico.isLocked(g.x,g.y)){continue;}
for (const id in g.ports) {
const port = g.ports[id]
h[`${g.x + port.x}:${g.y + port.y}`] = port.output ? 2 : port.bang ? 1 : 3
diff --git a/examples/loop.pico b/examples/loop.pico
index 939033c..1da01ab 100644
--- a/examples/loop.pico
+++ b/examples/loop.pico
@@ -1,19 +1,19 @@
-..................................................................
-..................................................................
-..................................................................
-..................................................................
-..................................................................
-........................s......+------+...........................
-...............................|......|...........................
-...............................|......|...........................
-...............................|......|...........................
-........................+------+------+....w......................
-........................|......|..................................
-........................|......|..................................
-........................|......|..................................
-........................+------+..................................
-..................................................................
-..................................................................
-..................................................................
-..................................................................
-.................................................................. \ No newline at end of file
+..................................................
+..................................................
+..................................................
+..................................................
+..................................................
+................s......+------+...................
+.......................|......|...................
+.......................|......|...................
+.......................|......|...................
+................+------+------+....w..............
+................|......|..........................
+................|......|..........................
+................|......|..........................
+................+------+..........................
+..................................................
+..................................................
+..................................................
+..................................................
+.................................................. \ No newline at end of file