Skip to content

ColeCurrent/Wordle-Bot

Repository files navigation

Wordle Solver Bot

Wordle Logo

Could you beat the Wordle bot? Compete against a bot trained to complete the wordle in the mathematically calculated fastest way possible.

How It Works

  • Part-1: Find a good starter word
    • Analyze a dataset of all possible 5-letter words (extracted from the NYT Wordle nytimes.com/games/wordle/)
    • Record how many times each letter is used in the dataset
    • Pick the top 5 most used letters
    • Create a list of words containing all 5 of those words
    • Pick a random word from the filtered list
      (wordle returns a list of complete match (green), and partial match(yellow))
  • Part-2: Calculate the most optimal next guess
    • Create a filtered list of words containing green letters and yellow letters based off of the wordle game feedback
      • Remove all words that don't contain the complete match letters in the exact indeces
      • Remove all words that don't contain the partial matches at all
    • Calculate the most used letters in the new list (repetition of part 1) and find a word containing the top 5 letters
    • Repeat for every attempts and narrow down the possible word choices

Running Locally

  1. Clone the repository

    • First, clone the project repository to your local machine using Git. Open your terminal, navigate to the directory where you want to clone the repository, and run:
      git clone https://github.com/ColeCurrent/Wordle-Bot.git
    
  2. Navigate to project directory:

    • cd into the project directory "Wordle-Bot":
      cd Wordle-Bot
    
  3. Start React Application

    • To start the front end, type into the terminal:
      npm install
    
      npm run dev
    
  4. Run Python backend server

    • To start the backend server, type into the terminal:
      python wordle.py
    

NOTE: If getting error "import "flask_cors" could not be resolved from sourcePylance"

  • pip install flask
       pip install flask flask-cors
    
  • Change Python interpreter to "Python 3.11.5 ('base')"

React + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

Credits

@ColeCurrent @SAADMAN-N
@amoitra1
@SARRAF-5757