Giter Club home page Giter Club logo

wordle's Introduction

WORDLE

Play the addictive daily word game as much as you want in this Python variant with optional integration of artificial intelligence (AI). Inspired by the original web-based version developed by Josh Wardle.

NOTE: This repository was created for learning purposes in CSC 3510 (Introduction to Artificial Intelligence) at Florida Southern College.

Requirements

The code provided here was developed in Python 3.9.5 on Windows 10 using VS Code and a Git Bash terminal. Setup and usage may vary slightly for other operating systems or software tools. At a minimum, you will need the following Python libraries installed:

  • colorama
  • pynput
  • six
  • tqdm

In addition, the instructions that follow assume you have properly installed git on your machine. Click here if you need help doing that.

Setup

  1. The best way to use this code is to clone the repository to your local machine. To do so in VS Code, open a terminal and navigate to the parent directory of your choice using the cd command, e.g.:

     $ cd ~/Documents/csc3510
    

    Then, use git clone to create a new subdirectory called wordle with the code from this repository:

     $ git clone https://github.com/meicholtz/wordle
    

    Go into the directory and make sure the appropriate files are there by using the ls command:

     $ cd wordle
     $ ls
    
  2. Before running the code, you need to make sure the required libraries are installed. The recommended way to do this is to create a virtual environment so that you can have separate environments for different projects. To create a virtual environment, use the venv command:

     $ python -m venv /path/to/new/virtual/environment
    

    If you do not have a preferred location for your environments, try putting them in a hidden folder in your home directory, such as:

     $ python -m venv ~/.venv/wordle
    

    Next, you need to activate the virtual environment using the source command:

     $ source ~/.venv/wordle/Scripts/activate
    

    You will know that you have done it correctly if you see the environment name in parentheses in your terminal, e.g. (wordle). After you are in your virtual environment, use pip install to install the libraries you need. It is easiest to do this with the requirements.txt file provided in the repository.

     $ pip install -r requirements.txt
     $ pip list
    

    Note that the second command above will list all installed libraries, which is useful for verification purposes.

Usage

Use the following commands to play the game:

  • To play Wordle as a human player,

      $ python wordle.py
    
  • To play Wordle using an AI player,

      $ python wordle.py -ai ai_player
    

    where ai_player is the name of any file that contains the function makeguess(wordlist, guesses, feedback). As an example, the most basic AI player (i.e. random guessing) is provided in the file ai_dummy.py. To use that AI player,

      $ python wordle.py -ai ai_dummy
    

There are several additional optional parameters that can be passed to wordle.py.

  • If you want to speed up gameplay when using an AI player, use

      $ python wordle.py -ai ai_player --fast
    
  • If you do not want to track statistics when playing the game (see stats.txt), use

      $ python wordle.py --practice
    

    or

      $ python wordle.py -ai ai_player --practice
    

wordle's People

Contributors

meicholtz avatar

Stargazers

 avatar  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.