Code a Word Game That Gets Double Letters Right
Description: APPLE has two P’s. Your guess, PUPPY, has three. Which P turns green, which turns amber, and which stays grey?
Build a Wordle-style scoring function in Python that gets repeated letters right. You’ll reserve exact matches first, then use a dictionary to keep track of the letters each guess can still claim. Along the way, you’ll fix a one-line bug that gives out an extra amber tile and discover how a grey tile can tell you exactly how many copies of a letter are in the secret word.
Chapters
00:00 The APPLE and PUPPY puzzle
01:44 Build the Python scorer
03:37 Match tile positions to Python list indices
05:26 Reserve green tiles first
05:57 Use spare letters for amber tiles
06:46 Count repeated letters with a dictionary
11:42 Debug the extra amber tile
17:00 Test three guesses against PEAR
19:21 Check letter positions and counts
20:52 Work out what a grey tile proves Close description
Build a Wordle-style scoring function in Python that gets repeated letters right. You’ll reserve exact matches first, then use a dictionary to keep track of the letters each guess can still claim. Along the way, you’ll fix a one-line bug that gives out an extra amber tile and discover how a grey tile can tell you exactly how many copies of a letter are in the secret word.
Chapters
00:00 The APPLE and PUPPY puzzle
01:44 Build the Python scorer
03:37 Match tile positions to Python list indices
05:26 Reserve green tiles first
05:57 Use spare letters for amber tiles
06:46 Count repeated letters with a dictionary
11:42 Debug the extra amber tile
17:00 Test three guesses against PEAR
19:21 Check letter positions and counts
20:52 Work out what a grey tile proves Close description
