LEARNING OBJECTIVES:

  1. Practice working with loops, files, and dictionaries
  2. Practice working with and completing existing programs

In this assignment, you will be working on graphical or “GUI” version of Wordle! While much of the program is already complete, your job will be to understand the existing program and functions, and use those to complete the full version of not just Wordle…but SUPER Wordle. Instead of only 5 letter words, Super Wordle will allow you to pick words from length 2 to 15 (but still only allow you six guesses). You’ll need to download all 3 files below.

Template File Ex7 Module File Wordle Word List File

Note: Depending on your browser, you may need to right click on the wordlist button and select “Download linked file…” or “Save linked file as…”. Make sure to save it as NWL2023.txt.

PLEASE NOTE: While you only have to write new code in the parts that are marked TODO in exercise_7.py, you’ll need to understand the other functions in exercise_7.py and cs110_ex7.py in order to know how to use them to complete the assignment. You can search for the TODO tags using the File menu then “Search” in IDLE. THIS MEANS YOU WILL NEED TO LOOK AT THE EXISTING CODE AROUND THE TODOs to see what is done already and what you'll need to fill-in. DON'T JUST START WRITING CODE. First, understand what's there THEN start editing. To that effect, the documentation for all the functions across the two files is available below:

Template Docs Ex7 Module Docs

Activity 1. Adding a difficulty selector

Find the get_difficulty function. Complete the TODOs inside of the function’s body to make it behave as the documentation explains. Note, instead of using our usual input function, the template uses a fancy version (simpledialog.askstring) which presents as a pop-up window and returns whatever the user typed in as a string. Remember, you only need to take care of the TODOs.


Activity 2. Reading in the words for the game

Adapt your code from the tutorial to finish the implementation of the read_in_words function. Note that this function behaves the same as the tutorial, except it has an additional argument that specifies how many letters should be in words it adds to our word list.


Activity 3. Generating hints

Adapt your code from the tutorial to finish the implementation of the generate_hint function.


Activity 4. Play the game!

At this point, your Wordle game should function as you might expect (like normal Wordle) as long as you enter a difficulty of 5. Try it out and make sure things are working! If they aren’t, go back to the three functions you worked on. Add print statements to help you debug.


Activity 5. Extending to Super Wordle

Your final task is to complete the “abstraction” process to make Super Wordle work with any difficulty entry from 2 to 15. Search through the rest of the .PY file and complete the remaining TODOs which ask you to consider how to abstract their respective functions. Including the one found inside of generate_hint, there are 7 TODOs that ask you to do this. Keep in mind that depending on which function you’re working on, you might have direct access to a variable like num_letters, you might need to find the length of a variable like guess or solution, or you might need to access the "num_letters" key of the GAME_DATA dictionary.


Checklist. Before You Submit

Before you submit, make sure you’ve tested that your program does the following:


Credits

This assignment is obviously inspired by the original Wordle now owned by the New York Times.

The word list we’re using is from the 2023 North American Scrabble Championship which is supported by NASPA.


What to Submit

Before you submit, make sure to go through the checklist to make sure everything is good-to-go. Once it is, submit only your exercise7.py file to Canvas by the deadline.


Submission Details

Remember, close IDLE before you submit to ensure that you’ve saved your latest work. Once you’ve successfully submitted you should receive feedback from the autograder in 30 or so minutes. If you fail one of the checks, you’re welcome to resubmit (up to the Canvas resubmit limit for that assignment). If you’re confused on how to fix one of the checks, then bring your submission and the test results to office hours!

Submission FAQ
Late Penalty Waiver