Okay, so today I’m gonna walk you through how I tackled this “Wordle Junior” thing. It wasn’t as straightforward as I thought, but hey, that’s coding, right?
First things first: the concept. Basically, a simplified Wordle. Shorter words, maybe easier to guess. My brain went straight to “how do I even start?”. I decided to keep it super simple.
Step 1: The Word List. I knew I needed a list of valid words. Scraped a list of 3-letter words off the internet (you can find them pretty easily). Tossed it into a text file. Crude, but effective.

Step 2: Picking a Word. Wrote a quick little script (Python, because that’s my jam). It just opens the text file, reads all the words into a list, and then randomly picks one. Boom, secret word generated.
Step 3: Getting the User’s Guess. Super basic input prompt. “Enter your guess: “. Made sure to force it to lowercase, just to avoid any case-sensitivity issues. Also added a check to make sure the guess was the right length (3 letters in this case).
Step 4: The Core Logic – Checking the Guess. This is where it got a little tricky. I needed to:
- See if letters were in the right spot.
- See if letters were in the word, but the wrong spot.
- See if letters weren’t in the word at all.
So, I iterated through each letter of the guess. Compared it to the secret word. If the letters matched and the positions matched, I marked it as “correct”. If the letter was in the secret word, but the position was wrong, I marked it as “present”. Otherwise, it was “absent”.
Step 5: Giving Feedback. I needed to show the user the results. I decided to use colors (because, Wordle!). Green for “correct”, yellow for “present”, and grey for “absent”. Used ANSI escape codes in Python to print colored text to the terminal. Looked kinda cool.

Step 6: The Game Loop. Put everything inside a `while` loop. The loop keeps running until:
- The user guesses the word.
- The user runs out of guesses (I set it to 6, like the real Wordle).
Step 7: Win/Loss Condition. After the loop, I checked if the user guessed correctly. If they did, I printed a “You win!” message. If they ran out of guesses, I printed a “You lose!” message and revealed the correct word.
The Problems I Ran Into:
Problem 1: Double Letters. Let’s say the word was “bee” and the guess was “ebb”. The second ‘b’ in “ebb” was getting marked as “present” even though there was only one ‘b’ available in the secret word. I had to add some extra logic to keep track of which letters in the secret word had already been “claimed”.
Problem 2: Input Validation. I originally just checked the length of the guess. But people were entering numbers and symbols! I added a check to make sure the guess only contained letters.

The Result:
It’s not perfect, but it works! It’s a command-line version, so no fancy graphics. But you enter your guess, it tells you which letters are correct, present, or absent, and it keeps track of your guesses. It was a fun little project to build.
What I Learned:
This was a good reminder that even simple games can have surprising complexity. Especially when you start dealing with edge cases (like those double letters!). It also reinforced the importance of breaking down a problem into smaller, manageable steps. And, of course, the value of using Google when you’re stuck!
I might try adding a GUI next time. Or maybe expand it to handle different word lengths. Who knows? For now, I’m happy with my little Wordle Junior clone.
