Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You should enter a solution word and then check a test word which the user will also input. The words should be the same length,
You should enter a "solution word" and then check a "test word" which the user will also input. The words should be the same length, check to ensure that this is the case. The way that wordle works is that if for instance the solution word is "chafe" and we enter "ready" then the result will look like: The reason is that the a is in the correct position, and there is an ' e ' in the word but it's not in the right position. For instance, if the word is: and our guess was: Then we see that there are four yellow positions because there are four letters that match but are not in the correct position. We will implement this with one primary difference however, to simplify the problem, any letter which is in the word but doesn't have the right position will be marked yellow, even if there aren't enough of those letters to match. For instance if the solution word was party and we guessed rrrrr, which in the regular game is not allowed since it's not a word, but in our checker will be allowed, the result should be: To output the results, output '_' for no match or gray, ' y ' for yellow and ' g ' for green. So the result should be yygyy. You can either use a list to store it and just output a list as the result or output the string result at the end. A result like: should be printed out as: yyy-y. linux[0]\$ python 3 wordle checker.py Enter the solution word: party Enter the guess word: align y linux[1]\$ python3 wordle checker.py Enter the solution word: silly Enter the guess word: lapel y - - y linux[2]\$ python 3 wordle checker.py Enter the solution word: stain Enter the guess word: steam g g - linux[3]\$ python 3 wordle checker.py Enter the solution word: games Enter the guess word: sages y g g g
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