Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ["0|0", "0|1", "0|2", "0|3", "0|4"]
- ["1|0", "1|1", "1|2", "1|3", "1|4"]
- ["2|0", "2|1", "2|2", "2|3", "2|4"]
- ["3|0", "3|1", "3|2", "3|3", "3|4"]
- ["4|0", "4|1", "4|2", "4|3", "4|4"]
- ["4|0", "4|1", "4|2", "4|3", "4|4"]
- ["3|0", "3|1", "3|2", "3|3", "3|4"]
- ["2|0", "2|1", "2|2", "2|3", "2|4"]
- ["1|0", "1|1", "1|2", "1|3", "1|4"]
- ["0|0", "0|1", "0|2", "0|3", "0|4"]
- function createGrid(rowCount, columnCount) {
- for (let x = 0; x < rowCount; x++) {
- for (let y = 0; y < columnCount; y++) {
- cell(x, y);
- }
- }
- }
- function cell(x, y) {
- grid[x] = grid[x] || [];
- grid[x][y] = x + "|" + y;
- }
- var grid = [];
- createGrid(5, 5);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement