From 2d93730c0b28788fdbc70d39ebafb6c4c5459446 Mon Sep 17 00:00:00 2001 From: Karan <50290386+Sonawane-Karan26@users.noreply.github.com> Date: Wed, 24 Nov 2021 19:38:41 +0530 Subject: [PATCH] Exercise 5.5 --- Chapter 5/Exercise 5.5 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Chapter 5/Exercise 5.5 diff --git a/Chapter 5/Exercise 5.5 b/Chapter 5/Exercise 5.5 new file mode 100644 index 0000000..0e46e7d --- /dev/null +++ b/Chapter 5/Exercise 5.5 @@ -0,0 +1,17 @@ +const grid = []; +const cells = 64; +let counter = 0; +let row; +for (let x = 0; x < cells + 1; x++) { + if (counter % 8 == 0) { + if (row != undefined) { + grid.push(row); + } + row = []; + } + counter++; + let temp = counter; + row.push(temp); + +} +console.table(grid);