From cf1a6ae725437d029a6f0b1b01dad277f7342535 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BChler?= Date: Sat, 14 Jul 2012 11:47:44 +0200 Subject: [PATCH] open lift, fix copy paste empty line at water level --- js/index.html | 5 +++-- js/mine.js | 13 +++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/js/index.html b/js/index.html index 7863d54..3336f5b 100644 --- a/js/index.html +++ b/js/index.html @@ -14,8 +14,9 @@ Select Map:
Moves:
-

-			

+			

+
+			

 		
diff --git a/js/mine.js b/js/mine.js index 195d596..2d3d08b 100644 --- a/js/mine.js +++ b/js/mine.js @@ -107,7 +107,8 @@ var Mine = function() { case ' ': case '.': case '\\': return true; - case 'L': return 0 == this.lambdas; + case 'L': return false; + case 'O': return true; case '*': if (this.robot.x + 2*n < 0) return false; if (this.robot.x + 2*n >= this.width) return false; @@ -124,7 +125,8 @@ var Mine = function() { case ' ': case '.': case '\\': return true; - case 'L': return 0 == this.lambdas; + case 'L': return false; + case 'O': return true; case '*': return false; " style="} break; @@ -153,7 +155,7 @@ var Mine = function() { this.lambdas--; this.found_lambdas++; break; - case 'L': + case 'O': this._foundLift(); break; } @@ -169,7 +171,7 @@ var Mine = function() { this.lambdas--; this.found_lambdas++; break; - case 'L': + case 'O': this._foundLift(); break; } @@ -182,6 +184,9 @@ var Mine = function() { } } this.moves++; + if (0 == this.lambdas) { + if (false !== this.lift) this.map[this.lift.y][this.lift.x] = 'O'; + } var newMap = [], x, y, below; for (y = 0; y < this.height; ++y) { newMap[y] = this.map[y].slice(); }