This project requires Cmake >= v3.16 to build.
mkdir build
cd build
If using MS Visual Studio compiler, to build the Release version use:
cmake ..
cmake --build . --config Release
If using Unix Makefiles, ensure it is set to Release:
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
Only standard library (STL) packages are used. These are listed in dOxygen documents found in the diagrams
folder.
Adversarial Wordle is a game inspired by Wordle, a popular five letter word guessing game. This spin on Wordle was originally created by qntm
in their game Absurdle, where technical insight was gleaned from qntm
's insightful blog post.
Adversarial Wordle is an adversarial (as the name implies) version of Wordle. The player inputs guesses of five letter words and the computer aims to give the player the least useful information as possible.
In contrast to Wordle, this program does not pick a single hidden word. It instead maintains a list of words that conform to the player's guesses. The program aims to prune this list as little as possible on each guess.
Type help
for more information and how to play, including meaning of colours.
This game is completely deterministic, where the randomness of the solution is entirely dependent of the randomness of the player input. You can verify these examples by following the guesses exactly in order.
The optimal strategy here is to choose words that eliminate as many letters as possible, as quickly as possible. The player needs to narrow the program down to one word quickly.
The class structure is as shown:
- The project reads data from a file and process the data, or the program writes data to a file: See file_reader.ccp, 30.
- The project accepts user input and processes the input: See game_loop.ccp, 73 and display.cpp, 151.
- The project demonstrates an understanding of C++ functions and control structures. See code in
src
and class structure above. - Overloaded functions allow the same function to operate on different parameters. See display.cpp, 130-139 and word_score.cpp, 32-47 for overloaded operators.
- The project uses Object Oriented Programming techniques. See code in
include
. - Classes encapsulate behavior. See opponent.h as an example.
- The project makes use of references in function declarations. See opponent.cpp, 7 as an example of use of references.
- The project uses scope / Resource Acquisition Is Initialization (RAII) where appropriate. All data structures are declared using
unique_ptr
or are managed by a class. See game_loop.h. An exception to this occurs in the constructor of theOpponent
class (see opponent.cpp, 7), where a a vector of pointers to an outside object is managed. This was done to reduce copying a large dataset. The scope ofOpponent
is then managed byGame
.