Small Wordle solver. Primarily used to learn Ruby a bit better.
ruby solver.rb
# Create a baseline
ruby tester.rb --name baseline --small
# Run this to create full baseline: ruby tester.rb --name baseline
# Make change
# Test the change
ruby tester.rb --name test --small
This solver does the following phases:
- Look at all answer possibilities, and finds the word that has the most frequently used letters, given their positions.
- When enough letters are found (3), switch to rating letters non-positionally. Also, do not give any score to letters already known.
- Once 3 letters are found, it tries to eliminate remaining possible answers. For example, given
?atch
is known, it finds a guess word that containsp
,m
,w
forpatch
,match
, andwatch
(ignoringcatch
andhatch
because those letters are already found). - When only a couple words remain, just guess.