open lift, fix copy paste empty line at water level
This commit is contained in:
parent
6d53b469e7
commit
cf1a6ae725
@ -14,8 +14,9 @@
|
||||
Select Map: <select id="mineGui_selectMap"></select>
|
||||
<div style="white-space: pre">Moves: <input type="text" id="mineGui_moves" value="" style="width: 80%; font-weight: bold; border: 1px solid"></input></div>
|
||||
<table align=top><tr><td style="padding-right: 50px;vertical-align:top">
|
||||
<pre id="mineGui_mineMap" style="margin-bottom: 0px"></pre>
|
||||
<pre id="mineGui_mineMapWater" style="margin-top: 0px; background: lightblue"></pre>
|
||||
<pre><span id="mineGui_mineMap" style="margin-bottom: 0px"></span>
|
||||
<span id="mineGui_mineMapWater" style="margin-top: 0px; background: lightblue"></span>
|
||||
</pre>
|
||||
</td><td style="vertical-align:top">
|
||||
<pre id="mineGui_meta"></pre>
|
||||
</td></tr></table>
|
||||
|
13
js/mine.js
13
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(); }
|
||||
|
Loading…
Reference in New Issue
Block a user