boilerplate-sim
Advanced tools
Comparing version 1.1.0 to 2.0.0
{ | ||
"name": "boilerplate-sim", | ||
"version": "1.1.0", | ||
"version": "2.0.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "simulator.js", |
@@ -115,5 +115,3 @@ // Generated by CoffeeScript 1.7.1 | ||
Simulator.prototype.tryMove = function(points, dx, dy) { | ||
var isMe, shuttle, x, y, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2, _ref3; | ||
dx = dx < 0 ? -1 : dx > 0 ? 1 : 0; | ||
dy = dy < 0 ? -1 : dy > 0 ? 1 : 0; | ||
var ddx, ddy, isMe, moved, p, shuttle, x, y, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2; | ||
if (dx && dy) { | ||
@@ -143,21 +141,32 @@ throw new Error('one at a time, fellas'); | ||
} | ||
for (_j = 0, _len1 = points.length; _j < _len1; _j++) { | ||
_ref1 = points[_j], x = _ref1.x, y = _ref1.y; | ||
if (!isMe(x + dx, y + dy)) { | ||
if (this.get(x + dx, y + dy) !== 'nothing') { | ||
return false; | ||
moved = false; | ||
while (dx || dy) { | ||
ddx = sign(dx); | ||
ddy = sign(dy); | ||
for (_j = 0, _len1 = points.length; _j < _len1; _j++) { | ||
_ref1 = points[_j], x = _ref1.x, y = _ref1.y; | ||
if (!isMe(x + ddx, y + ddy)) { | ||
if (this.get(x + ddx, y + ddy) !== 'nothing') { | ||
return moved; | ||
} | ||
} | ||
} | ||
shuttle = {}; | ||
for (_k = 0, _len2 = points.length; _k < _len2; _k++) { | ||
_ref2 = points[_k], x = _ref2.x, y = _ref2.y; | ||
shuttle["" + x + "," + y] = this.get(x, y); | ||
this.set(x, y, 'nothing'); | ||
} | ||
for (_l = 0, _len3 = points.length; _l < _len3; _l++) { | ||
p = points[_l]; | ||
x = p.x, y = p.y; | ||
this.set(x + ddx, y + ddy, shuttle["" + x + "," + y]); | ||
p.x += ddx; | ||
p.y += ddy; | ||
} | ||
dx -= ddx; | ||
dy -= ddy; | ||
moved = true; | ||
} | ||
shuttle = {}; | ||
for (_k = 0, _len2 = points.length; _k < _len2; _k++) { | ||
_ref2 = points[_k], x = _ref2.x, y = _ref2.y; | ||
shuttle["" + x + "," + y] = this.get(x, y); | ||
this.set(x, y, 'nothing'); | ||
} | ||
for (_l = 0, _len3 = points.length; _l < _len3; _l++) { | ||
_ref3 = points[_l], x = _ref3.x, y = _ref3.y; | ||
this.set(x + dx, y + dy, shuttle["" + x + "," + y]); | ||
} | ||
return true; | ||
return moved; | ||
}; | ||
@@ -164,0 +173,0 @@ |
@@ -23,3 +23,2 @@ {"2,0":"thinsolid","3,0":"thinsolid","2,1":"nothing","3,1":"thinsolid","2,2":"shuttle","3,2":"thinsolid","1,3":"nothing","2,3":"shuttle","3,3":"thinsolid","1,4":"shuttle","2,4":"shuttle","3,4":"thinsolid","6,4":"negative","16,4":"thinsolid","17,4":"negative","18,4":"negative","1,5":"negative","2,5":"shuttle","3,5":"thinsolid","4,5":"thinsolid","5,5":"thinsolid","6,5":"nothing","7,5":"nothing","8,5":"shuttle","9,5":"nothing","10,5":"nothing","11,5":"nothing","12,5":"nothing","13,5":"nothing","14,5":"nothing","15,5":"nothing","16,5":"nothing","17,5":"nothing","18,5":"thinsolid","2,6":"shuttle","4,6":"thinsolid","0,7":"negative","1,7":"thinsolid","2,7":"shuttle","4,7":"thinsolid","0,8":"negative","1,8":"thinsolid","2,8":"shuttle","3,8":"thinsolid","4,8":"thinsolid","2,9":"thinshuttle","2,10":"shuttle","1,11":"nothing","2,11":"shuttle","0,12":"negative","1,12":"shuttle","2,12":"shuttle"} | ||
{"2,0":"thinsolid","3,0":"thinsolid","2,1":"nothing","3,1":"thinsolid","2,2":"shuttle","3,2":"thinsolid","1,3":"nothing","2,3":"shuttle","3,3":"thinsolid","1,4":"shuttle","2,4":"shuttle","3,4":"thinsolid","6,4":"negative","16,4":"thinsolid","17,4":"negative","18,4":"negative","1,5":"negative","2,5":"shuttle","3,5":"thinsolid","4,5":"thinsolid","5,5":"thinsolid","6,5":"shuttle","7,5":"nothing","8,5":"nothing","9,5":"nothing","10,5":"nothing","11,5":"nothing","12,5":"nothing","13,5":"nothing","14,5":"nothing","15,5":"nothing","16,5":"nothing","17,5":"nothing","18,5":"thinsolid","2,6":"shuttle","4,6":"thinsolid","0,7":"negative","1,7":"thinsolid","2,7":"shuttle","4,7":"thinsolid","0,8":"negative","1,8":"thinsolid","2,8":"shuttle","3,8":"thinsolid","4,8":"thinsolid","2,9":"thinshuttle","2,10":"shuttle","1,11":"nothing","2,11":"shuttle","0,12":"negative","1,12":"shuttle","2,12":"shuttle"} | ||
{"2,0":"thinsolid","3,0":"thinsolid","2,1":"nothing","3,1":"thinsolid","2,2":"shuttle","3,2":"thinsolid","1,3":"nothing","2,3":"shuttle","3,3":"thinsolid","1,4":"shuttle","2,4":"shuttle","3,4":"thinsolid","6,4":"negative","16,4":"thinsolid","17,4":"negative","18,4":"negative","1,5":"negative","2,5":"shuttle","3,5":"thinsolid","4,5":"thinsolid","5,5":"thinsolid","6,5":"nothing","7,5":"shuttle","8,5":"nothing","9,5":"nothing","10,5":"nothing","11,5":"nothing","12,5":"nothing","13,5":"nothing","14,5":"nothing","15,5":"nothing","16,5":"nothing","17,5":"nothing","18,5":"thinsolid","2,6":"shuttle","4,6":"thinsolid","0,7":"negative","1,7":"thinsolid","2,7":"shuttle","4,7":"thinsolid","0,8":"negative","1,8":"thinsolid","2,8":"shuttle","3,8":"thinsolid","4,8":"thinsolid","2,9":"thinshuttle","2,10":"shuttle","1,11":"nothing","2,11":"shuttle","0,12":"negative","1,12":"shuttle","2,12":"shuttle"} | ||
{"2,0":"thinsolid","3,0":"thinsolid","2,1":"nothing","3,1":"thinsolid","2,2":"shuttle","3,2":"thinsolid","1,3":"nothing","2,3":"shuttle","3,3":"thinsolid","1,4":"shuttle","2,4":"shuttle","3,4":"thinsolid","6,4":"negative","16,4":"thinsolid","17,4":"negative","18,4":"negative","1,5":"negative","2,5":"shuttle","3,5":"thinsolid","4,5":"thinsolid","5,5":"thinsolid","6,5":"nothing","7,5":"nothing","8,5":"shuttle","9,5":"nothing","10,5":"nothing","11,5":"nothing","12,5":"nothing","13,5":"nothing","14,5":"nothing","15,5":"nothing","16,5":"nothing","17,5":"nothing","18,5":"thinsolid","2,6":"shuttle","4,6":"thinsolid","0,7":"negative","1,7":"thinsolid","2,7":"shuttle","4,7":"thinsolid","0,8":"negative","1,8":"thinsolid","2,8":"shuttle","3,8":"thinsolid","4,8":"thinsolid","2,9":"thinshuttle","2,10":"shuttle","1,11":"nothing","2,11":"shuttle","0,12":"negative","1,12":"shuttle","2,12":"shuttle"} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
231940
18
1211
0