Coder Social home page Coder Social logo

adversarial-wordle's Introduction

Adversarial Wordle

Building and Install

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

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.

An Example:

Step 1

Step 2

Step 3

Step 4

The Optimal Solution:

Optimal Solution

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.

Class Structure

The class structure is as shown: Class Diagram

Addressed Rubric Conditions for Udacity C++ Nanodegree Capstone Project

  1. The project reads data from a file and process the data, or the program writes data to a file: See file_reader.ccp, 30.
  2. The project accepts user input and processes the input: See game_loop.ccp, 73 and display.cpp, 151.
  3. The project demonstrates an understanding of C++ functions and control structures. See code in src and class structure above.
  4. 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.
  5. The project uses Object Oriented Programming techniques. See code in include.
  6. Classes encapsulate behavior. See opponent.h as an example.
  7. The project makes use of references in function declarations. See opponent.cpp, 7 as an example of use of references.
  8. 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 the Opponent 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 of Opponent is then managed by Game.

adversarial-wordle's People

Contributors

shellofnuts avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.