My implementation of the Wordle game (inspired by https://www.powerlanguage.co.uk/wordle/) and my interactive solving machine for the Wordle game. The strategy is originated from this blog post Best Wordle Strategy — Explore or Exploit and I'm still working on some optimization over that.
shell
git clone https://github.com/KevinXuxuxu/wordle_machine.git
cd wordle_machine
$ python3.9 wordle.py
Welcome to Wordle!
Guess 1: aeros # <- your input
Result: !__!
Guess 2: unlit # <- your input
Result: ____?
Guess 3: techs # <- your input
Result: ?!?!
Guess 4: heets # <- your input
Guess must be a proper word with 5 letters!
Guess 4: hetts # <- your input
Guess must be a proper word with 5 letters!
Guess 4: herts # <- your input
Guess must be a proper word with 5 letters!
Guess 4: hetes # <- your input
Result: !!!!!
Congrats!
```
$ python3.9 wordle_machine.py Interactive mode: Guess 1: aeros Result: ?___ # <- your input Number of possible words: 568 Guess 2: unlit Result: ?? # <- your input Number of possible words: 52 Guess 3: binge Result: !!! # <- your input Number of possible words: 7 Guess 4: jinne Result: !!! # <- your input Number of possible words: 6 Guess 5: mince Result: _!!!! # <- your input Number of possible words: 2 Guess 6: wince Result: !!!!! # <- your input Congrats! ```
Success rate around 86% for now.
shell
$ python3.9 benchmark.py
max 6 guesses, 10000 plays
Success stats: {1: 0, 2: 1, 3: 1674, 4: 3382, 5: 2332, 6: 1228}
Success distro: {1: 0.0, 2: 0.0001, 3: 0.1674, 4: 0.3382, 5: 0.2332, 6: 0.1228}
Failed count and rate: 1383 0.1383