Question
In this assignment, you will create a simplified version of the game Wordle RULES: The player has SIX chances to guess a five-letter word (For
In this assignment, you will create a simplified version of the game "Wordle"
RULES: The player has SIX chances to guess a five-letter word (For our assignment, it does NOT have to be a valid five-letter word, any combination of five letters would be fine).
Hit the enter button to submit.
After each guess, the color of the tiles will change to show how close the guess was to the word: YELLOW means that the letter is in the word but in the wrong spot GREEN means that the letter is in the word and in the wrong spot BLACK means that the letter is not in the word
#STEP 1: Read a file that has a list of five-letter words. This is the "words.txt" file included in the assignment
#HElPFUL TIPS: The following code is used for reading a text file. Note that "lines" is a list that contains all words # from the file.
lines = [] with open('words.txt') as test: lines = test.readlines() print(type(lines)) lines[1]
#STEP 2: Randomly choose a word as your puzzle
#STEP 3: Prompt the user to enter a five-letter word. Make sure that you check for the length of the input and print an error # message if it is not five letters, prompting them to enter again
#STEP 4: Check the input against your word and give feedback to the user
#HELPFUL TIPS: some methods you might find useful are (you do NOT have to use them, you can build your own solutions): # 1. String find() -- https://www.w3schools.com/python/ref_string_find.asp # 2. String rfind() -- https://www.w3schools.com/python/ref_string_rfind.asp # 3. How to print texts in color: https://www.geeksforgeeks.org/print-colors-python-terminal/
# Jupyter Notebook has "auto-print" feature to help users, and the input might be printed in your output although you did not # code it. It is OK if this happens.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started