-
-
Save melcor76/e87d69498e28a2417b03090936021b53 to your computer and use it in GitHub Desktop.
js-tetris - valid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
valid(p) { | |
return p.shape.every((row, dy) => { | |
return row.every((value, dx) => { | |
let x = p.x + dx; | |
let y = p.y + dy; | |
return ( | |
this.isEmpty(value) || | |
(this.insideWalls(x) && | |
this.aboveFloor(y)) | |
); | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
it's missing one ) after this.aboveFloor(y)
return ( this.isEmpty(value) || (this.insideWalls(x) && this.aboveFloor(y)) );