subject

Program Specifications Your program will play the mastermind game as follows:
1. Prompt for the 4 digit key we will play with.
2. Prompt the user for a guess.
a. we check to see if the guess is exactly length 4
b. we check to see if the guess contains all numbers
C. we check to see if the guess has no repeats
Any violation of these rules prints an error message and prompts for a guess again. Bad input does not
count as a guess.
3. End the game if:
a. the guess is correct. Print out a winner message
b. it was the last guess (the twelfth) and the guess is incorrect. Print out a loser message and the
value of the key
4. If no end condition occurs, print out how many of the guess numbers are exactly right (correct number in the
correct position) and how many of the guess numbers are correct but not in the correct position. Example. The
key is 1234 and the guess is 4256. The feedback would be 1 number exactly correct (2) and 1 number in the
wrong position (4). That is, each digit in the
guess produces at most one result (exact or wrong position).
5. You should keep a history of guesses so that the user can see how they are progressing.
6. Continue the game until an end condition occurs

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 06:30
What result from the passage of this amendment
Answers: 1
question
Computers and Technology, 22.06.2019 17:00
Acase study allows a more detailed look at the life of a single subject than any other study.
Answers: 3
question
Computers and Technology, 23.06.2019 03:00
Your business be in google top rank.more the rank more the business leads.for best seo and digital marketing services be confident to contact you can get best seo solutions by assistance experts provide digital marketing, website development, seo expert services and social media internet seo expert services your branding solutions. seo expert services ,best seo expert services,online seo expert services,
Answers: 3
question
Computers and Technology, 23.06.2019 06:30
You have a small company and want to keep your costs low, but it is important your employees share data. which network would provide you with the most economical solution?
Answers: 1
You know the right answer?
Program Specifications Your program will play the mastermind game as follows:
1. Prompt for...
Questions
question
Mathematics, 18.09.2020 19:01
question
History, 18.09.2020 19:01
question
Biology, 18.09.2020 19:01
question
Mathematics, 18.09.2020 19:01
question
Chemistry, 18.09.2020 19:01
question
Mathematics, 18.09.2020 19:01
question
Mathematics, 18.09.2020 19:01
question
Spanish, 18.09.2020 19:01
question
Mathematics, 18.09.2020 19:01
question
Mathematics, 18.09.2020 19:01
question
Mathematics, 18.09.2020 19:01
question
Mathematics, 18.09.2020 19:01
question
English, 18.09.2020 19:01
question
Mathematics, 18.09.2020 19:01
question
Mathematics, 18.09.2020 19:01
question
Geography, 18.09.2020 19:01
question
Mathematics, 18.09.2020 19:01
question
Social Studies, 18.09.2020 19:01
question
Mathematics, 18.09.2020 19:01
question
Mathematics, 18.09.2020 19:01
Questions on the website: 13722360