feat: add 7th guess with 60s unlock and update docs

This commit is contained in:
Hördle Bot
2025-11-21 19:25:38 +01:00
parent 7ce45be90d
commit 95a3b09f52
4 changed files with 20 additions and 9 deletions

View File

@@ -17,6 +17,7 @@ export interface Statistics {
solvedIn4: number;
solvedIn5: number;
solvedIn6: number;
solvedIn7: number;
failed: number;
}
@@ -64,7 +65,12 @@ export function useGameState() {
// Load statistics
const storedStats = localStorage.getItem(STATS_KEY);
if (storedStats) {
setStatistics(JSON.parse(storedStats));
const parsedStats = JSON.parse(storedStats);
// Migration for existing stats without solvedIn7
if (parsedStats.solvedIn7 === undefined) {
parsedStats.solvedIn7 = 0;
}
setStatistics(parsedStats);
} else {
const newStats: Statistics = {
solvedIn1: 0,
@@ -73,6 +79,7 @@ export function useGameState() {
solvedIn4: 0,
solvedIn5: 0,
solvedIn6: 0,
solvedIn7: 0,
failed: 0,
};
setStatistics(newStats);
@@ -98,6 +105,7 @@ export function useGameState() {
case 4: newStats.solvedIn4++; break;
case 5: newStats.solvedIn5++; break;
case 6: newStats.solvedIn6++; break;
case 7: newStats.solvedIn7++; break;
}
} else {
newStats.failed++;
@@ -112,7 +120,7 @@ export function useGameState() {
const newGuesses = [...gameState.guesses, guess];
const isSolved = correct;
const isFailed = !correct && newGuesses.length >= 6;
const isFailed = !correct && newGuesses.length >= 7;
const newState = {
...gameState,