aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDevine Lu Linvega <[email protected]>2018-06-07 09:52:25 +1200
committerDevine Lu Linvega <[email protected]>2018-06-07 09:52:25 +1200
commit4f00b522677b37f71049cfa055de56b69b15d7bb (patch)
treea6b238b8c0b57defd46b4b3289833c52ac67b4cb
parent54695e55b49fded452fc7948da34b9641324fee2 (diff)
downloadOrca-4f00b522677b37f71049cfa055de56b69b15d7bb.tar.gz
Orca-4f00b522677b37f71049cfa055de56b69b15d7bb.zip
F program doesn't require bang
-rw-r--r--README.md2
-rw-r--r--desktop/sources/scripts/keyboard.js1
-rw-r--r--desktop/sources/scripts/lib/logo.js2
-rw-r--r--desktop/sources/scripts/programs/f.js2
-rw-r--r--desktop/sources/scripts/programs/g.js2
-rw-r--r--desktop/sources/scripts/programs/n.js2
-rw-r--r--desktop/sources/scripts/programs/s.js18
7 files changed, 13 insertions, 16 deletions
diff --git a/README.md b/README.md
index e4d516e..1aadfed 100644
--- a/README.md
+++ b/README.md
@@ -20,7 +20,7 @@ Moves southward.
Fires bangs in nearby available cells, on **bang**.
### If `F`
-This function expects 2 functions, if the functions corresponds, F bangs southward, on **bang**. Erases function westward.
+This function expects 2 functions, if the functions corresponds, F bangs southward. Erases function westward.
### Generator `G`
Generates a `D` on **bang**.
diff --git a/desktop/sources/scripts/keyboard.js b/desktop/sources/scripts/keyboard.js
index 3cd5bd7..0aa57db 100644
--- a/desktop/sources/scripts/keyboard.js
+++ b/desktop/sources/scripts/keyboard.js
@@ -16,6 +16,7 @@ function Keyboard()
if(event.key == "Backspace"){ pico.grid.cursor.insert("."); return; }
if(event.key == "Space"){ pico.grid.cursor.insert("."); return; }
+ if(event.key == "Escape"){ logo.remove(); return; }
if(event.key.length == 1){
pico.grid.cursor.insert(event.key);
diff --git a/desktop/sources/scripts/lib/logo.js b/desktop/sources/scripts/lib/logo.js
index fc6a4d3..0e5c6ea 100644
--- a/desktop/sources/scripts/lib/logo.js
+++ b/desktop/sources/scripts/lib/logo.js
@@ -46,6 +46,8 @@ function Logo(is_looping = false)
this.remove = function()
{
+ if(this.canvas.style.opacity == 0){ return; }
+
this.canvas.style.opacity = 0;
setTimeout(() => { this.el.style.opacity = 0; },500)
setTimeout(() => { document.body.removeChild(this.el); },1500)
diff --git a/desktop/sources/scripts/programs/f.js b/desktop/sources/scripts/programs/f.js
index 07ce9fc..121905f 100644
--- a/desktop/sources/scripts/programs/f.js
+++ b/desktop/sources/scripts/programs/f.js
@@ -8,7 +8,7 @@ function program_F(x,y)
this.operation = function()
{
- if(!this.left() || !this.right() || !this.bang()){ return; }
+ if(!this.left() || !this.right()){ return; }
if(this.left(this.right().glyph)){
pico.program.remove(this.x-1,this.y)
diff --git a/desktop/sources/scripts/programs/g.js b/desktop/sources/scripts/programs/g.js
index 8eb847b..ecbbab5 100644
--- a/desktop/sources/scripts/programs/g.js
+++ b/desktop/sources/scripts/programs/g.js
@@ -16,6 +16,6 @@ function program_G(x,y)
this.fire = function()
{
pico.program.add(this.x,this.y+1,"d")
- pico.program.lock(this.x,this.y+1)
+ // pico.program.lock(this.x,this.y+1)
}
} \ No newline at end of file
diff --git a/desktop/sources/scripts/programs/n.js b/desktop/sources/scripts/programs/n.js
index ac9d6c9..04f84bd 100644
--- a/desktop/sources/scripts/programs/n.js
+++ b/desktop/sources/scripts/programs/n.js
@@ -8,6 +8,6 @@ function program_N(x,y)
this.operation = function()
{
- pico.program.add(this.x,this.y+1,(pico.f % 9)+"");
+ pico.program.add(this.x,this.y+1,(pico.f % 10)+"");
}
} \ No newline at end of file
diff --git a/desktop/sources/scripts/programs/s.js b/desktop/sources/scripts/programs/s.js
index ea33fc3..9ca4fa0 100644
--- a/desktop/sources/scripts/programs/s.js
+++ b/desktop/sources/scripts/programs/s.js
@@ -9,18 +9,12 @@ function program_S(x,y)
this.operation = function()
{
var n = this.neighbor();
+
+ if(!n){ return; }
- if(n && n.glyph == "r"){
- pico.program.add(n.x,n.y,"d");
- }
- if(n && n.glyph == "d"){
- pico.program.add(n.x,n.y,"l");
- }
- if(n && n.glyph == "l"){
- pico.program.add(n.x,n.y,"u");
- }
- if(n && n.glyph == "u"){
- pico.program.add(n.x,n.y,"r");
- }
+ if(n.glyph == "r"){ pico.program.add(n.x,n.y,"d"); }
+ if(n.glyph == "d"){ pico.program.add(n.x,n.y,"l"); }
+ if(n.glyph == "l"){ pico.program.add(n.x,n.y,"u"); }
+ if(n.glyph == "u"){ pico.program.add(n.x,n.y,"r"); }
}
} \ No newline at end of file