Implement Specials feature, Admin UI enhancements, and Database Rebuild tool

This commit is contained in:
Hördle Bot
2025-11-22 16:09:45 +01:00
parent c270f2098f
commit 903d626699
16 changed files with 816 additions and 37 deletions

View File

@@ -25,7 +25,7 @@ export interface Statistics {
const STORAGE_KEY = 'hoerdle_game_state';
const STATS_KEY = 'hoerdle_statistics';
export function useGameState(genre: string | null = null) {
export function useGameState(genre: string | null = null, maxAttempts: number = 7) {
const [gameState, setGameState] = useState<GameState | null>(null);
const [statistics, setStatistics] = useState<Statistics | null>(null);
@@ -115,6 +115,10 @@ export function useGameState(genre: string | null = null) {
case 5: newStats.solvedIn5++; break;
case 6: newStats.solvedIn6++; break;
case 7: newStats.solvedIn7++; break;
default:
// For custom attempts > 7, we currently don't have specific stats buckets
// We could add a 'solvedInOther' or just ignore for now
break;
}
} else {
newStats.failed++;
@@ -129,7 +133,7 @@ export function useGameState(genre: string | null = null) {
const newGuesses = [...gameState.guesses, guess];
const isSolved = correct;
const isFailed = !correct && newGuesses.length >= 7;
const isFailed = !correct && newGuesses.length >= maxAttempts;
const newState = {
...gameState,