Skip to content

Commit cad8c9d

Browse files
Merge pull request #12 from Bhairavi-28/main
Add validation for unsupported Tower of Hanoi disk counts
2 parents 56835f6 + bbc36b1 commit cad8c9d

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"liveServer.settings.port": 5501
3+
}

web-app/js/projects.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3292,6 +3292,11 @@ function initTowerOfHanoi() {
32923292

32933293
async function solve() {
32943294
if (isAnimating) return;
3295+
3296+
if (diskCount < 3 || diskCount > 7) {
3297+
alert("Visualization supports only 3 to 7 disks");
3298+
return;
3299+
}
32953300

32963301
isAnimating = true;
32973302
solveBtn.disabled = true;

0 commit comments

Comments
 (0)