Skip to content

Commit 7be0a28

Browse files
fix(N-Queens):Remove malformed validation code
1 parent 1ec32f8 commit 7be0a28

2 files changed

Lines changed: 2 additions & 16 deletions

File tree

‎public/N_Queen/index.html‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,7 @@
1212
<body>
1313

1414
<a href="/" class="project-back-button">← Back to Home</a>
15-
fix-nqueen-input-validation
16-
<div class="borad-details">
17-
<div class="board-size">
18-
<label for="boardSize">Choose Board Size (N):</label>
19-
<input type="number" id="boardSize" min="4" max="12" value="4" required > </div>
20-
<div class="start-reset-button">
21-
<button id="startGame">Start Game</button>
15+
2216
<main class="container">
2317
<header class="game-header">
2418
<div class="game-header__title-group">
@@ -68,7 +62,7 @@ <h1 class="game-header__title">N-Queens</h1>
6862
<button id="toggleMark" class="btn btn--secondary" disabled>Mark Cells</button>
6963
<button id="hintBtn" class="btn btn--secondary" disabled>Hint</button>
7064
<button id="solveBtn" class="btn btn--secondary" disabled>Auto-Solve</button>
71-
Main
65+
7266
</div>
7367
<label for="showInvalid" class="controls__checkbox">
7468
<input type="checkbox" id="showInvalid" disabled>

‎public/N_Queen/script.js‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,6 @@ document.addEventListener('DOMContentLoaded', () => {
9191
boardEl.style.gridTemplateColumns = `repeat(${boardSize}, ${cellPx}px)`;
9292
boardEl.style.setProperty('--cell-size', `${cellPx}px`);
9393

94-
fix-nqueen-input-validation
95-
function startGame() {
96-
const n = parseInt(boardInput.value);
97-
if (isNaN(n) || n < 4 || n > 12) {
98-
alert("Please enter a valid board size between 4 and 12.");
99-
return;
100-
}
10194
for (let r = 0; r < boardSize; r++) {
10295
for (let c = 0; c < boardSize; c++) {
10396
const sq = document.createElement('button');
@@ -117,7 +110,6 @@ function startGame() {
117110
}
118111
}
119112
};
120-
Main
121113

122114
// ── Click handler ─────────────────────────────────────────────────
123115

0 commit comments

Comments
 (0)