Sitemap
Better Programming

Advice for programmers.

Building a Wordle Bot In Under 100 Lines of Python

Solving puzzles is fun

10 min readJan 27, 2022

--

Press enter or click to view image in full size
Wordle bot python
Unsplash image

If you don’t know what Wordle is, get out from under your rock and check it out. It’s a simple game at surface level but does end up needing some strategy to master it. It didn’t take more than a couple of rounds of playing it before my curiosity piqued and I felt the need to build a bot to play the game and learn more about it. Let’s get going!

The Objective

Build a Python program that plays Wordle. It should make guesses of words and try and figure out the ultimate answer word in as few guesses as possible.

The Basics

The basics of the game are pretty straightforward. We need to be able to keep a list of valid words, make guesses, collect responses, and update our word list based on the data in those responses. This high-level Python code can be the baseline of our solving application.

We really only have 3 methods to build here with this simple structure. The first is make_guess. This method should take a list of…

--

--

Matt Dodge
Matt Dodge

Written by Matt Dodge

Constantly struggling to figure out whether I like software development or the Dodgers more. CTO of niolabs.

No responses yet