MCS 260 Intro to Computer Science Spring 2022

Project 3Due in Gradescope by Friday, April 1 by 11:59pm

RESOURCES ALLOWED: This project is to be completed individually. The only resources youmay use when completing the project are

� Material posted on the course Blackboard page

� The course textbook and “further resources” listed in the Syllabus

If you are unsure about whether a resource is allowed, then please ask your instructor. You shouldalso consult the course syllabus for a further explanation of academic honesty.

This project will create a GUI using Tkinter to help a user solve a daily Wordle.

WHAT TO SUBMIT: You will submit one Python file project3-<lastname>-<firstname>.py where<lastname> and <firstname> are replaced with your last and first name, respectively.

The first lines of each of your files should include the following:

#<firstname> <lastname>

#MCS 260 Spring 2022 Project 3

#I hereby attest that I have adhered to the rules for projects as well as UIC’s

Academic Integrity standards while completing this project.

The rest of your file should perform the actions described below.

ACTIONS: 1. First you should become familiar with the game Wordle. It is not necessary to begood at the game, but you should be aware of it and how it is played.

2. Download the file in Blackboard called AllWords.txt that is a copy and paste of all the wordsavailable on Wordle. You should download this file and, using whatever method you wouldlike, create a file AllWordsLines.txt that has each word on its own line with no quotes. Thereshould be 2309 lines of words when you finish.

3. Write a function ExactLetters that takes as input a string S that is exactly five characterslong containing only alphabetic characters and the underscore character. For instance, thestring could be S = "_arts" or S = "R_t_D". The function should search AllWordsLines.txtand return a list of all words that match the given string S exactly, where an underscore isconsidered a wildcard character (i.e. any character could fill the space).

For example, if we were to run ExactLetters("__art"), then SOME of the words returnedin the list would be heart, quart, and smart, however the word earth would not be returnedsince the wildcard characters must be the first and second characters, a must be the thirdcharacter, r must be the fourth letter, and t must be the last letter.

4. Write a function ContainsLetters that takes as input a string T that has at most five charac-ters containing ONLY alphabetic characters. It should search AllWordsLines.txt and returna list of all words that have all the characters in T.

For example, if we were to run ContainsLetters("abc"), then SOME of the words returnedin the list would be bacon, aback, and cobra, however the word labor would not be returnedsince it does not have the character c in it.

5. Write a function InBoth which takes as input two lists L1 and L2 and returns a list of allelements that are in BOTH lists, with no duplicates. The order of the elements does notmatter.

University of Illinois at Chicago page 1

MCS 260 Intro to Computer Science Spring 2022

6. Using Tkinter, you need to create a GUI similar to the picture below. The top line shouldbe some text (currently Text1) explaining what the five boxes below it are for. Then belowthat top line should be five input (Entry) boxes. These five boxes will be used with theExactLetters function described above. A user will be allowed to put one character in eachbox. Note: If the user presses the submit button and a box has more than one character init, then an error should be printed. A user is allowed to leave a box empty; this will then berecorded as the underscore character in ExactLetters.

7. Below the top five entry boxes should be further text (currently Text2) and another set offive Entry boxes. These five boxes will be used for the ContainsLetters function describedabove. You should replace Text2 with an explanation of what these five boxes are for. Againa user can only put one character in each box and upon submit, if a box has more than onecharacter, an error should be printed. A user is allowed to leave a box empty.

8. There should be a submit button (currently it says Find Me Some Words!). Upon pressingthis button the program should

(a) Check if all ten boxes have at most one alphabetic character in them. If not, it shoulddisplay an error box about which box(es) are causing an error.

(b) If all ten boxes have at most one alphabetic character in them, then use the functions youwrote above which should filter the list of words in AllWordsLines.txt and print an infobox with all the words that fit the user’s conditions.

9. To check that your program is working properly, here are a few examples.

(a) ExactLetters("s ar ") should return the list [’start’, ’smart’, ’shard’, ’scare’,’snarl’, ’snare’, ’stare’, ’share’, ’swarm’, ’sharp’, ’shark’, ’scarf’, ’spare’,

’spark’, ’scary’, ’stark’]

(b) ContainsLetters("abc") should return the list [’basic’, ’aback’, ’black’, ’scuba’,’cabin’, ’beach’, ’cobra’, ’bacon’, ’cable’, ’cabal’, ’brace’, ’cabby’, ’batch’]

(c) If L1 = ExactLetters("b d") and L2 = ContainsLetters("abde"), then InBoth(L1,L2) should return the list [’bread’, ’beard’]. Note that in this example, len(L1) =17 and len(L2) = 10.

(d) Further examples will be shared in a separate document Examples.txt.

10. ADD COMMENTS to clarify your choice of variables and to indicate what is happening atdifferent steps of the program. A good rule of thumb is one line of comments for every fourto five lines of code. Your comments will be checked to see that you understand how yourcode is structured and what it is doing in the big picture. Code lacking in comments will bepenalized!

University of Illinois at Chicago page 2

Testimonials

mcs260sp22project3.pdf
We have updated our contact contact information. Text Us Or WhatsApp Us+1-(309) 295-6991