DevangThakkar / wordle_archive

MIT License
280 stars 159 forks source link

FR: Show guess distribution record, like real Wordle #52

Open joeyparrish opened 2 years ago

joeyparrish commented 2 years ago

The archive could show the player's guess distribution, like real Wordle does:

Example:

Screenshot of Wordle guess distribution

joeyparrish commented 2 years ago

Here's a quick and dirty histogram I pulled together in the JS console. I haven't spent enough time in the source yet to integrate it:

gameStates = JSON.parse(localStorage.gameStateList);
// 0-based - "0" means "1 guess", etc
numGuesses = gameStates
    .filter(game => game.state == 'won')
    .map(game => game.board.map(letters => letters.join(''))
    .findLastIndex(word => !!word));
distribution = [0, 0, 0, 0, 0, 0];
numGuesses.forEach(score => distribution[score] += 1);
distribution