Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases In Networked Information Systems 6th International Workshop Dnis 2010 Aizu Wakamatsu Japan March 2010 Proceedings Lncs 5999

Authors: Shinji Kikuchi ,Shelly Sachdeva ,Subhash Bhalla

2010th Edition

3642120377, 978-3642120374

More Books

Students also viewed these Databases questions

Question

Data Structures and Algorithm Analysis in C + + 3 rd Edition

Answered: 1 week ago

Question

7. Where Do We Begin?

Answered: 1 week ago