Skip to content

Everything you need for implementing AIs for the game Wordle

License

Notifications You must be signed in to change notification settings

Kinkelin/WordleCompetition

Repository files navigation

Wordle AI Competition

In this repository you can find everything you need to hold Wordle AI competitions. Implement and test your own AIs to find the optimal wordle strategy!

Leaderboard

Nr AI Author Points per round Success rate
1 OutcomeBasedAI da Finnci 3.816 100.0%
2 EntropyAI Akshaylive 4.091 100.0%
3 RubzipAI rubzip 4.569 97.2%
4 LetterPopularityAI example 4.653 93.6%
5 BruugleAI Bruugle 6.120 97.0%
6 MonkeyAI example 10.000 0.0%

The leaderboard shows how AIs contained in this repository perform against offical wordles, using the first 1000 words found here.

You can submit your own implementation by creating a pull request or sending it to me directly. The leaderboard will be updated accordingly.

AIs should use the word list provided in the constructor call and must not use the solution list directly. It is allowed (and encouraged) to use a common words list to mimic inherint human knowledge. See WordleJudge for details.

How to implement your own AI

Inherit from the abstract WordleAI class and implement its guess() method. You can find detailed documentation about this interface in the WordleAI class itself.

See the Monkey AI and LetterPopularityAI classes for example implementations. Feel free to reuse any code in your own implementations, for example the remaining_options() method.

Run the test competition

  • Run Competition.py.
  • By default, the same configuration is run that is used for the Leaderboard. All AIs found in ai_implementations will compete for 1000 wordles. Hard mode is not enforced.
  • You can pass True for the print_details argument in the Competition.fight() calls in the main method if you want to see guesses and scoring by round.

Community

Feel free to hop onto our Discord to discuss strategy, ask for help or boast about your AI's playing strength!

Wordle rules

  • In each round of wordle you try to guess a random 5-letter word
  • Words only contain letters a-z and are lower case.
  • You have 6 guesses
  • After each guess you will receive information about which letters of your guess were correct

AI Competition rules

  • The goal is to collect as few points as possible. A round gives points equal the number of guesses or 10 points if the word was not found within the 6 guesses.
  • The winner of a competition is the competitor with the least amount of points over all rounds combined.

InteractivePlayer.py

Executing this file allows playing the game in the browser with AI support. Simply relay the ingame information to the AI via console input.

Word lists

The word list of the official wordle game consists of 12972 words: combined_wordlist.txt
Around 2500 of them are used as the daily wordles: shuffled_real_wordles.txt

In this repository is also a list of 5-letter English words ordered by usage frequency common_words.txt that was extracted from a wictionary.org list of 100k common words.

Also a list with words that are difficult for AIs to solve can be found under difficult_words.txt for testing purposes.

WordleJudge.py

Analysis has shown that the daily wordles are significantly more frequently used words than the average allowed-guess word. This is something human players automatically adjust for - they are more likely to guess 'water' than 'pekoe' (a specific tea).

The WordleJudge class takes into account how common words are in the English language. Use an instance of this class and call is_wordle_probability(word) to factor word usage frequency into your decision-making.

Hard Mode rules

This is an optional setting in the official game.

  • Standard rules apply
  • Guesses must follow already known information. Revealed letters have to be part of the guess, if possible at the right position.

About

Everything you need for implementing AIs for the game Wordle

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages