introduce prettierrc formatting
This commit is contained in:
@@ -4,13 +4,13 @@ function Cell(i, j) {
|
||||
this.walls = [true, true, true, true];
|
||||
this.visited = false;
|
||||
|
||||
this.checkNeighbors = function() {
|
||||
this.checkNeighbors = function () {
|
||||
var neighbors = [];
|
||||
|
||||
var top = grid[index(i, j -1)];
|
||||
var right = grid[index(i+1, j)];
|
||||
var bottom = grid[index(i, j+1)];
|
||||
var left = grid[index(i-1, j)];
|
||||
var top = grid[index(i, j - 1)];
|
||||
var right = grid[index(i + 1, j)];
|
||||
var bottom = grid[index(i, j + 1)];
|
||||
var left = grid[index(i - 1, j)];
|
||||
|
||||
if (top && !top.visited) {
|
||||
neighbors.push(top);
|
||||
@@ -31,32 +31,30 @@ function Cell(i, j) {
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
this.highlight = function() {
|
||||
var x = this.i*w;
|
||||
var y = this.j*w;
|
||||
};
|
||||
this.highlight = function () {
|
||||
var x = this.i * w;
|
||||
var y = this.j * w;
|
||||
noStroke();
|
||||
fill(252, 106, 2, 100);
|
||||
rect(x, y, w, w);
|
||||
}
|
||||
};
|
||||
|
||||
this.show = function() {
|
||||
var x = this.i*w;
|
||||
var y = this.j*w;
|
||||
this.show = function () {
|
||||
var x = this.i * w;
|
||||
var y = this.j * w;
|
||||
stroke(0);
|
||||
if (this.walls[0]) {
|
||||
line(x , y , x + w, y);
|
||||
line(x, y, x + w, y);
|
||||
}
|
||||
if (this.walls[1]) {
|
||||
line(x + w, y , x + w, y + w);
|
||||
line(x + w, y, x + w, y + w);
|
||||
}
|
||||
if (this.walls[2]) {
|
||||
line(x + w, y + w, x , y + w);
|
||||
line(x + w, y + w, x, y + w);
|
||||
}
|
||||
if (this.walls[3]) {
|
||||
line(x , y + w, x , y);
|
||||
line(x, y + w, x, y);
|
||||
}
|
||||
|
||||
if (this.visited) {
|
||||
@@ -64,5 +62,5 @@ function Cell(i, j) {
|
||||
fill(242, 255, 28, 125);
|
||||
rect(x, y, w, w);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user