Socket
Socket
Sign inDemoInstall

boilerplate-sim

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 2.0.0

testdata/yank.json

2

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc