The program is solver for the online Worlde solver, based on the theory of information.
The program provides the following functionalities:
- generates a list of top picks and their expected informational output
- reads the word the user tried and the game's response
- adapts the list of words
- continues until the game is won (the word is guessed) or lost (6 rounds have gone by)
The program expects the following input:
- the tried word: 5-letter english word in lowercase
- the solution: 5-letter code in lowercase where:
wis white, the letter is not in the wordyis yellow, the letter is in the word, but not in this placegis green, the letter is in the right place
To use the program, run this command:
vlad@laptop:~Wordle$ cargo runThe code is spread trough five Rust source files to make reading them individually easier. The functions are divided as follows:
src/main.rs: the main function of the programsrc/file.rs: opening a file and reading the initial wordssrc/info.rs: functions that compute the bits of a word, update them and pick the words with the most bitssrc/matcher.rs: functions that update the possible words based on the last tried wordsrc/read.rs: functions that read the data from the user