From 11447f91007191a48c6232cf2ec1af70fa3d9536 Mon Sep 17 00:00:00 2001 From: Steccah Date: Sun, 23 Jun 2024 18:02:16 +0200 Subject: [PATCH] fix --- center.css | 16 ++++++++++++++++ game.js | 5 +++-- index.html | 44 +++++++++++++++----------------------------- 3 files changed, 34 insertions(+), 31 deletions(-) create mode 100644 center.css diff --git a/center.css b/center.css new file mode 100644 index 0000000..95d50c5 --- /dev/null +++ b/center.css @@ -0,0 +1,16 @@ +.center { + display: flex; + justify-content: center; +} + +.space div { + margin: 0 1em; +} + +#game table.table td { + padding: 0.5em; + width: 3em; + height: 3em; + text-align: center; + vertical-align: middle; +} \ No newline at end of file diff --git a/game.js b/game.js index 60b624b..14a6f4a 100644 --- a/game.js +++ b/game.js @@ -46,7 +46,7 @@ class Board { getColSum(col) { let sum = 0; for (let row = 0; row < this.dimension; row++) { - if (this.getCell(row, col).isEnabled() || this.getCell(row, col).isNormal()) { + if (!this.getCell(row, col).isDisabled()) { sum += this.getCell(row, col).value; } } @@ -56,7 +56,7 @@ class Board { getRowSum(row) { let sum = 0; for (let col = 0; col < this.dimension; col++) { - if (this.getCell(row, col).isEnabled() || this.getCell(row, col).isNormal()) { + if (!this.getCell(row, col).isDisabled()) { sum += this.getCell(row, col).value; } } @@ -98,6 +98,7 @@ class Game { constructor(dimension) { this.board = new Board(dimension); this.table = this.tableGenerator(dimension); + document.getElementById('game').innerHTML = ''; document.getElementById('game').appendChild(this.table); console.log(this.board); } diff --git a/index.html b/index.html index ecefcba..a5e5472 100644 --- a/index.html +++ b/index.html @@ -5,6 +5,8 @@ Sumplete + + - -
- +
+
+
+
+
+ + +
+
-
\ No newline at end of file