You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
maettleship/models/Grid.js

22 lines
358 B

const { Case } = require("./Case");
const GRID_SIZE = 10;
class Grid {
constructor() {
this.gridSize = GRID_SIZE;
this.cases = [];
for (let i = 0; i < GRID_SIZE; i++) {
let row = [];
for (let j = 0; j < GRID_SIZE; j++) {
row.push(new Case());
}
this.cases.push(row);
}
}
}
module.exports = {
Grid,
};