standalone rng for all grids
This commit is contained in:
parent
6fca8014bf
commit
0f84743019
16
index.js
16
index.js
@ -72,12 +72,16 @@ function randomizetable(){
|
||||
for (let j = 0; j < h; j++) {
|
||||
let r = Math.floor(Math.random() * 2);
|
||||
if (r == 0) {
|
||||
lgrid[i][j] = x;
|
||||
rgrid[i][j] = o;
|
||||
} else {
|
||||
lgrid[i][j] = o;
|
||||
rgrid[i][j] = x;
|
||||
}
|
||||
r = Math.floor(Math.random() * 2);
|
||||
if (r == 0) {
|
||||
lgrid[i][j] = o;
|
||||
} else {
|
||||
lgrid[i][j] = x;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -87,12 +91,16 @@ function randomizeaux(){
|
||||
for (let j = 0; j < haux; j++) {
|
||||
let r = Math.floor(Math.random() * 2);
|
||||
if (r == 0) {
|
||||
lauxgrid[i][j] = x;
|
||||
rauxgrid[i][j] = o;
|
||||
} else {
|
||||
lauxgrid[i][j] = o;
|
||||
rauxgrid[i][j] = x;
|
||||
}
|
||||
r = Math.floor(Math.random() * 2);
|
||||
if (r == 0) {
|
||||
lauxgrid[i][j] = o;
|
||||
} else {
|
||||
lauxgrid[i][j] = x;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user