summaryrefslogtreecommitdiff
path: root/mines.js
diff options
context:
space:
mode:
authorCCGKyle <corechg@gmail.com>2019-08-25 21:03:47 -0400
committerGitHub <noreply@github.com>2019-08-25 21:03:47 -0400
commit7aea84ee27c4cf111ab5d9570b4db854398c9e31 (patch)
tree31b6f1529a537bf6a64a6f215f2f2973c6c39d33 /mines.js
parenta3c90a433906851daeaa625ef9442e820bd082ca (diff)
[FINAL] Get rid of my stupid errorsHEADmaster
switch a x with a y like an i with a j
Diffstat (limited to 'mines.js')
-rw-r--r--mines.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/mines.js b/mines.js
index 872bf51..5585bb6 100644
--- a/mines.js
+++ b/mines.js
@@ -77,7 +77,7 @@ Board.prototype = {
while(!flag){
for(let i = 0; i < this.boardDim[1] && !flag; i++){
for(let j = 0; j < this.boardDim[0] && !flag; j++){
- if(!this.isMine(i, j) && !this.closeToStart(j, i, sx, sy) && Math.floor(Math.random()*4) == 0){
+ if(!this.isMine(j, i) && !this.closeToStart(j, i, sx, sy) && Math.floor(Math.random()*4) == 0){
this.mines[i].push(j);
flag = true;
}
@@ -487,4 +487,4 @@ function download(data, filename, type) {
window.URL.revokeObjectURL(url);
}, 0);
}
-} \ No newline at end of file
+}