Use Arrays to represent Grid data instead of Objects
This commit is contained in:
parent
6e62789c89
commit
7a6e815b61
1 changed files with 3 additions and 3 deletions
|
@ -47,11 +47,11 @@ function clear() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function generate(f) {
|
function generate(f) {
|
||||||
var result = {}
|
var result = [];
|
||||||
for(var row = 0; row < grid.size; row++) {
|
for(var row = 0; row < grid.size; row++) {
|
||||||
result[row] = {};
|
result[row] = [];;
|
||||||
for(var column = 0; column < grid.size; column++) {
|
for(var column = 0; column < grid.size; column++) {
|
||||||
result[row][column] = f(row, column);
|
result[row].push(f(row, column));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in a new issue