Prog 6: Wordle

Write a Python program to play the Wordle game where a player has six attempts to guess a five-letter word, getting feedback after each guess. You will work on this program in two stages, a design stage and a coding stage:

  1. Prog 6a: Design of Wordle: Develop your program design as comments, detailing what you will be trying to do in your program, doing this in Replit project Prog 6: Design of Wordle. You should have a comment that corresponds to each section of code. This will be graded separately from your code. This is worth 0..3 points as follows: 1. Overall structure is there; 2. Mostly complete, with indentation reflecting program structure, though some portion(s) have not already been thought out; 3. All sections have been thoroughly thought through, are indented, and are clearly stated.

  2. Prog 6b: Wordle Code: Copy your comments and implement them as code. Once done you must both submit your code within Replit (so we can give you feedback on it) and copy it into Zybooks 9.16 to earn 0..4 points based on the test cases there.

    Thanks to our heroic TAs Trish, Annie and Meghan, they have volunteered to do the extra work to allow you to turn in Program 6b: Wordle Code late, into Zybooks 9.17. These submissions will be subject to a 20% late penalty.

Running the program looks like what is shown below. Moves are numbered. After each guess the computer determines which, if any, letters in the user's guess match the secret word. When developing your program you might want to outright display the secret word at the beginning of your program, or hard-code it to always be the same word, to help you in developing your program. No duplicate letters are allowed for either the secret words or for the user guesses.

In the example shown below we choose to set the secret word to "fakes". The first guess, "fetid" has 'f' that is a matching character in the correct position, so that is displayed as a capital letter in the results string. The 'e' from "fetid" matches the 'e' in "fakes", however it is not in the correct position, so a caret '^' symbol is displayed under it. The other characters in "fetid" are not found in the secret word "fakes", so '.' characters are displayed for each of them. Then to the right a string of all unused alphabetic characters is shown. As play progresses, more and more letters get eliminated from this list.

This time we don't set the secret word:

Each user guess must be a valid word with no duplicate letters. You can exit the program early by entering 'x' instead of a user word guess:

The sample code shown below (and in Replit Examples Prog 6 sample code) illustrates various concepts that will likely be useful to you in creating your own solution.

Resources:

A list of 500+ common 5 letter words (organized by nouns, pronouns, verbs, adjectives, conjunctions, adverbs, prepositions, and interjections) came from this page and is available in a slightly edited form here. A full word list of 12,972 words was compiled from this reddit post and is available here. A couple different dictionaries are already provided for you in the Replit project.