Scrambled Codewords C++ 1. The codewords will be scrambled words. You will read the words used for the codes from a file and store it into an array. There are 60 words in the file that range in size from 3 characters to 7 characters. The file is called wordlist.txt and can be found attached to the assignment in IvyLearn. 2. Start with input for an integer seed for the random number generator. There is no need to put a prompt before the cin operation. 3. Ask the Player if they are ready to play and only proceed if they type a Y or y. If the user types an N or n then the program should finish. a. INPUT VALIDATION: Make sure the user has typed either y, Y, n, or N 4. Create a variable to keep track of the number of guesses the user has made. 5. Use the random number generator to pick a word from the list of words. 6. Once you have chosen a word as the codeword you will need to scramble the letters to make it into a code. You should use the random number generator to help you mix up the letters. 7. Display to the user the number of characters in the code. 8. Ask the user to guess the code a. INPUT VALIDATION: Make sure the user’s guess has the same number of characters as the code. 9. Process the guess a. If the player’s guess matches the code, the player wins, and the game is over. b. If the player’s guess doesn’t match, update the display with information about how close they are to a correct guess. Check the guess character by character against the code. i. Create a display like the one pictured below to show the user information about their guess and clues to the code. ii. An x in a position means that the character is correct and in the right place. iii. An o in a position means that the character is correct and in the wrong place iv. An _ means the character is not in the code. 10. Continue obtaining guesses from the user until they either guess the code or enter the # to indicate they quit. 11. After the player guesses or quits display a message for whether they win or lose(quit), and how
Scrambled Codewords C++ 1. The codewords will be scrambled words. You will read the words used for the codes from a file and store it into an array. There are 60 words in the file that range in size from 3 characters to 7 characters. The file is called wordlist.txt and can be found attached to the assignment in IvyLearn. 2. Start with input for an integer seed for the random number generator. There is no need to put a prompt before the cin operation. 3. Ask the Player if they are ready to play and only proceed if they type a Y or y. If the user types an N or n then the program should finish. a. INPUT VALIDATION: Make sure the user has typed either y, Y, n, or N 4. Create a variable to keep track of the number of guesses the user has made. 5. Use the random number generator to pick a word from the list of words. 6. Once you have chosen a word as the codeword you will need to scramble the letters to make it into a code. You should use the random number generator to help you mix up the letters. 7. Display to the user the number of characters in the code. 8. Ask the user to guess the code a. INPUT VALIDATION: Make sure the user’s guess has the same number of characters as the code. 9. Process the guess a. If the player’s guess matches the code, the player wins, and the game is over. b. If the player’s guess doesn’t match, update the display with information about how close they are to a correct guess. Check the guess character by character against the code. i. Create a display like the one pictured below to show the user information about their guess and clues to the code. ii. An x in a position means that the character is correct and in the right place. iii. An o in a position means that the character is correct and in the wrong place iv. An _ means the character is not in the code. 10. Continue obtaining guesses from the user until they either guess the code or enter the # to indicate they quit. 11. After the player guesses or quits display a message for whether they win or lose(quit), and how
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Scrambled Codewords C++
1. The codewords will be scrambled words. You will read the words used for the codes from a file and
store it into an array. There are 60 words in the file that range in size from 3 characters to 7
characters. The file is called wordlist.txt and can be found attached to the assignment in IvyLearn.
2. Start with input for an integer seed for the random number generator. There is no need to put a
prompt before the cin operation.
3. Ask the Player if they are ready to play and only proceed if they type a Y or y. If the user types an N
or n then the
a. INPUT VALIDATION: Make sure the user has typed either y, Y, n, or N
4. Create a variable to keep track of the number of guesses the user has made.
5. Use the random number generator to pick a word from the list of words.
6. Once you have chosen a word as the codeword you will need to scramble the letters to make it into a
code. You should use the random number generator to help you mix up the letters.
7. Display to the user the number of characters in the code.
8. Ask the user to guess the code
a. INPUT VALIDATION: Make sure the user’s guess has the same number of characters as the
code.
9. Process the guess
a. If the player’s guess matches the code, the player wins, and the game is over.
b. If the player’s guess doesn’t match, update the display with information about how close they
are to a correct guess. Check the guess character by character against the code.
i. Create a display like the one pictured below to show the user information about their
guess and clues to the code.
ii. An x in a position means that the character is correct and in the right place.
iii. An o in a position means that the character is correct and in the wrong place
iv. An _ means the character is not in the code.
10. Continue obtaining guesses from the user until they either guess the code or enter the # to indicate
they quit.
11. After the player guesses or quits display a message for whether they win or lose(quit), and how
many guesses they took. You should also display the code and the word used to create it.
12. Then ask the user if they would like to play again.
13. You must use at least three functions. Some function examples could be:
i. Scramble word, fill word list, check guess.
14. Display the number of guesses between incorrect guesses.
15. Limit the number of guesses to 10 before the player loses. (Extra Credit)
16. If the player correctly guesses the code give them 5 chances to unscramble the word. (Extra Credit).
17. Let the player choose the difficulty of the word/code. The words in the file are in order by size. The
first 20 words are easy(small), the second 20 words are medium difficulty, and the last 20 words are
hard. (Extra Credit).
they quit.
11. After the player guesses or quits display a message for whether they win or lose(quit), and how
many guesses they took. You should also display the code and the word used to create it.
12. Then ask the user if they would like to play again.
13. You must use at least three functions. Some function examples could be:
i. Scramble word, fill word list, check guess.
14. Display the number of guesses between incorrect guesses.
15. Limit the number of guesses to 10 before the player loses. (Extra Credit)
16. If the player correctly guesses the code give them 5 chances to unscramble the word. (Extra Credit).
17. Let the player choose the difficulty of the word/code. The words in the file are in order by size. The
first 20 words are easy(small), the second 20 words are medium difficulty, and the last 20 words are
hard. (Extra Credit).
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 6 steps with 2 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education