aboutsummaryrefslogtreecommitdiffhomepage
path: root/desktop/sources/scripts/programs/s.js
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/sources/scripts/programs/s.js')
-rw-r--r--desktop/sources/scripts/programs/s.js18
1 files changed, 6 insertions, 12 deletions
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