Skip to content

Commit 530f9c0

Browse files
committed
2 parents c8c2da6 + f9c6b68 commit 530f9c0

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

bss-trivia.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ h5 {
116116
}
117117

118118
.mode-details h3 {
119-
margin: 0 0 5px 0;
119+
margin: 0 0 5px;
120120
}
121121

122122
.mode-details p {

script.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ let statGuessActive = false;
6767
// Initialize stat guess mode toggle
6868
statModeToggle.checked = localStorage.getItem("statGuessMode") === "true";
6969
isStatGuessMode = statModeToggle.checked;
70+
setupGame();
7071

7172
// Add event listener for stat mode toggle
7273
statModeToggle.addEventListener("change", () => {
@@ -424,8 +425,11 @@ function updateStats(isWin, attempts) {
424425
stats.currentStreak++;
425426
stats.maxStreak = Math.max(stats.maxStreak, stats.currentStreak);
426427
stats.guessDistribution[attempts - 1]++;
427-
} else {
428+
} else { // Player lost
428429
stats.currentStreak = 0;
430+
// Add this line to record the loss in the guess distribution
431+
// 'attempts' will be maxAttempts when isWin is false, as per the calling context in submitGuess
432+
stats.guessDistribution[attempts - 1]++;
429433
}
430434
localStorage.setItem("stats", JSON.stringify(stats));
431435
displayStats();

0 commit comments

Comments
 (0)