Question

PROJECT DESCRIPTION: Write a program to simulate the game of hangman. The game will begin by the showing the user a welcome screen. When the user enters any character, then the first puzzle will be shown. The user will have 7 incorrect guesses before losing that puzzle. After the user completes that round (either by correctly guessing letters until no blanks are left or chooses 7 incorrect guesses, increment either the win count or the lose count. Then ask the user if the user wishes to continue. If continuing, display another blank puzze and allow the user to play it again. If the user does not wish to continue, print a table of output displaying the wins and losses counts, with appropriate labels. Following this, there should be an option for the user to view the printing of the puzzles used and unused puzzles. Your output should be very clean and neat and clear and in the order described above. The program must use at least 4 functions. The puzzles will be randomly selected from a file named puzzleoptions.txt. The file will contain no more than 20 puzzles. For this project, puzzles will be one per line and may have spaces. The program will load the puzzles into an array of strings (not cstrings). The program will also maintain a corresponding, parallel array that holds Boolean values. The Boolean array will store false if a corresponding puzzle string has not yet been used and true if it has been used. The puzzles that are displayed (mentioned above) will be randomly selected from the array of strings and marked as used, when used in the Boolean array. Puzzles should not be sued more than once.

          PROJECT DESCRIPTION:
Write a program to simulate the game of hangman. The game will begin by the showing the user a welcome screen. When the user
enters any character, then the first puzzle will be shown. The user will have 7 incorrect guesses before losing that puzzle. After the
user completes that round (either by correctly guessing letters until no blanks are left or chooses 7 incorrect guesses, increment
either the win count or the lose count. Then ask the user if the user wishes to continue. If continuing, display another blank puzze
and allow the user to play it again. If the user does not wish to continue, print a table of output displaying the wins and losses
counts, with appropriate labels. Following this, there should be an option for the user to view the printing of the puzzles used and
unused puzzles. Your output should be very clean and neat and clear and in the order described above. The program must use at
least 4 functions.
The puzzles will be randomly selected from a file named puzzleoptions.txt. The file will contain no more than 20 puzzles. For this
project, puzzles will be one per line and may have spaces. The program will load the puzzles into an array of strings (not cstrings).
The program will also maintain a corresponding, parallel array that holds Boolean values. The Boolean array will store false if a
corresponding puzzle string has not yet been used and true if it has been used. The puzzles that are displayed (mentioned above)
will be randomly selected from the array of strings and marked as used, when used in the Boolean array. Puzzles should not be sued
more than once.
        
Show more…
PROJECT DESCRIPTION:
Write a program to simulate the game of hangman. The game will begin by the showing the user a welcome screen. When the user
enters any character, then the first puzzle will be shown. The user will have 7 incorrect guesses before losing that puzzle. After the
user completes that round (either by correctly guessing letters until no blanks are left or chooses 7 incorrect guesses, increment
either the win count or the lose count. Then ask the user if the user wishes to continue. If continuing, display another blank puzze
and allow the user to play it again. If the user does not wish to continue, print a table of output displaying the wins and losses
counts, with appropriate labels. Following this, there should be an option for the user to view the printing of the puzzles used and
unused puzzles. Your output should be very clean and neat and clear and in the order described above. The program must use at
least 4 functions.
The puzzles will be randomly selected from a file named puzzleoptions.txt. The file will contain no more than 20 puzzles. For this
project, puzzles will be one per line and may have spaces. The program will load the puzzles into an array of strings (not cstrings).
The program will also maintain a corresponding, parallel array that holds Boolean values. The Boolean array will store false if a
corresponding puzzle string has not yet been used and true if it has been used. The puzzles that are displayed (mentioned above)
will be randomly selected from the array of strings and marked as used, when used in the Boolean array. Puzzles should not be sued
more than once.

Added by Thomas H.

Close

Computer Science and Information Technology
Computer Science and Information Technology
Trishna Knowledge Systems 2018 Edition
AceChat toggle button
Close icon
Ace pointing down

Please give Ace some feedback

Your feedback will help us improve your experience

Thumb up icon Thumb down icon
Thanks for your feedback!
Profile picture
PROJECT DESCRIPTION: Write a program to simulate the game of hangman. The game will begin by showing the user a welcome screen. When the user enters any character, the first puzzle will be shown. The user will have 7 incorrect guesses before losing that puzzle. After the user completes that round (either by correctly guessing letters until no blanks are left or choosing 7 incorrect guesses), increment either the win count or the lose count. Then ask the user if they wish to continue. If continuing, display another blank puzzle and allow the user to play it again. If the user does not wish to continue, print a table of output displaying the win and loss counts, with appropriate labels. Following this, there should be an option for the user to view the printing of the puzzles used and unused puzzles. Your output should be very clean, neat, clear, and in the order described above. The program must use at least 4 functions. The puzzles will be randomly selected from a file named "puzzleoptions.txt". The file will contain no more than 20 puzzles. For this project, puzzles will be one per line and may have spaces. The program will load the puzzles into an array of strings (not cstrings). The program will also maintain a corresponding parallel array that holds Boolean values. The Boolean array will store false if a puzzle is unused and true if it has been used. Puzzles should not be used more than once.
Close icon
Play audio
Feedback
Powered by NumerAI
David Collins Ivan Kochetkov
Kathleen Carty verified

Akash M and 61 other subject AP CS educators are ready to help you.

Ask a new question

*

Labs

-

Want to see this concept in action?

NEW

Explore this concept interactively to see how it behaves as you change inputs.

View Labs

*

Key Concepts

-
Key Concept
Premium Feature
Explore the core concept behind this problem.
Play button
Key Concept
Premium Feature
Explore the core concept behind this problem.
Your browser does not support the video tag.

*

Recommended Videos

-
write-this-in-python-thank-you-iwant-you-to-implerment-either-a-for-loop-or-a-while-loop-to-give-the-user-unlimited-attempts-to-guess-the-correct-numberif-the-user-types-in-only-you-will-als-27434

Text: Write this in Python. Thank you! I want you to implement either a FOR loop or a WHILE loop to give the user unlimited attempts to guess the correct number. If the user types in only, you will also be recording how many times the user has attempted to guess the number. Each time the user guesses incorrectly, you will increment the counter (also called an accumulator) by one point. The value of the accumulator will start at 0, and if they guess correctly the first time, then the accumulator would increment by one and print to the screen. Every time thereafter would increment the counter/accumulator by 1. Use the code from Challenge 03 as the baseline for this program. Programming Concepts Allowed: - For loops - While Loops - If, Elif, Else conditions - Boolean Operators (True, False) - Logical operators: And, Or, Not - Accumulators - Input validation Name your file: firstName_lastName_challenge_04.py and submit the file to the Challenge 4 dropbox. Grading Rubric: You will be deducted points for the following items: -5 for each concept not implemented. For example, if you do not check for input validation, I will deduct 5 points from your overall score. -10 points if your program has syntax errors and the program will not run in CodeGrade. You will receive a 0 if you copy someone else's work or copy something from the internet. Asking for assistance, when you have already written code, is allowed, as long as you can articulate why the changes work. All other RUBRIC details are on CodeGrade, which you will see when you run the AutoTest. Test Data: (Use this data to test your program and ensure you get 100% in CodeGrade) USE the following values IN THIS ORDER: 0, 1, 10, 20, 30, 40, 45, 41 The CORRECT number is 41. You should have 8 as the value for your accumulator/counter variable (meaning it took 8 times for the user to guess the correct number). Output MUST state verbatim: "Your guess is within 5 digits of the correct number. Please try again.

Akash M.

python-programming-exercise-85-write-a-gui-based-program-that-plays-a-guess-the-number-game-in-which-the-roles-of-the-computer-and-the-user-are-the-reverse-of-what-they-are-in-the-case-study-61188

Programming Exercise 8.5 Instructions and the user are the reverse of what they are in the Case Study of this chapter. In this version of the game, the computer guesses a number between 1 (lowerBound) and 100 (upperBound) and the user provides the responses. • The window should display the computer's guesses with a label. • The user enters a hint in response, by selecting one of a set of command buttons labeled Too small, Too large, and Correct. • When the game is over, you should disable these buttons and wait for the user to click New game, as before. Be sure to use the field names provided in the comments in your starter code. File: guesswithgui.py Project 8.5 The computer guesses a number and the user provides the hints. import random from breezypythongui import EasyFrame class GuessingGame(EasyFrame): """Plays a guessing game with the user.""" def __init__(self): """Sets up the window, widgets, and data.""" EasyFrame.__init__(self, title = "Guessing Game") # self.lowerBound # self.upperBound # self.count self.myNumber = (self.lowerBound + self.upperBound) // 2 guess = "Is the number " + str(self.myNumber) + "?" self.myLabel = self.addLabel(text = guess, row = 0, column = 0, sticky = "NSEW", columnspan = 4) self.small = self.addButton(text = "Too small", row = 1, column = 0, command = self.goLarge) self.large = self.addButton(text = "Too large", row = 1, column = 1, command = self.goSmall) self.correct = self.addButton(text = "Correct", row = 1, column = 2, command = self.goCorrect)

Akash M.

java-8-files-solutionjava-x-you-can-also-use-imports-for-example-import-javautil-franco-is-going-to-play-a-game-of-rock-paper-scissors-with-his-friend-giovanniin-each-turn-solutionjava-both-20495

Franco is going to play a game of Rock-Paper-Scissors with his friend Giovanni. In each turn, both players make their chosen gesture (rock, paper, or scissors) simultaneously. After every turn, players gain points as follows: 2 for a win (rock beats scissors, scissors beat paper, and paper beats rock), 1 for a tie (when both players show the same gesture), and 0 for a loss. Franco wants to surprise Giovanni by using a very simple strategy: he will make the same gesture in every turn throughout the game. What is the maximum number of points he can score using this strategy? Write a function: class Solution { public int solution(String G); } that, given a string G representing the sequence of Giovanni's turns ('R' represents a rock, 'P' represents paper, and 'S' represents scissors), returns the maximum number of points Franco can score using his strategy. For example: Given RSPRS, the function should return 6 (with the chosen gesture being rock). Franco will gain 6 points (he will win in the second and fifth turns and tie in the first and fourth turn). Given SRR, the function should return 4 (chosen gesture: rock; he will win in the first turn and tie in the second and third turns). Given PRPRRP, the function should return 10 (chosen gesture: paper). Given "PPPPRRSSSSS" the function should return 13 (chosen gesture: scissors). Assume that: - the length of string G is within the range [1, 100] - string G consists only of letters 'R', 'P', and 'S". In your solution, focus on correctness. The performance of your solution will not be the focus of the assessment.

Supreeta N.


*

Recommended Textbooks

-
Computer Science and Information Technology

Computer Science and Information Technology

Trishna Knowledge Systems 2018 Edition
achievement 1,100 solutions
Introduction to Programming Using Python

Introduction to Programming Using Python

Y. Daniel Liang 1st Edition
achievement 1,198 solutions
Computer Science - An Overview

Computer Science - An Overview

Glenn Brookshear, Dennis Brylow 12th Edition
achievement 1,222 solutions
Need help? Use Ace
Ace is your personal tutor. It breaks down any question with clear steps so you can learn.
Start Using Ace
Ace is your personal tutor for learning
Step-by-step explanations
Instant summaries
Summarize YouTube videos
Understand textbook images or PDFs
Study tools like quizzes and flashcards
Listen to your notes as a podcast
Continue solving this problem
Create a free account to:
  • View full step-by-step solution
  • Ask follow-up questions with Ace AI
  • Save progress and study later
Continue Free
Numerade

Get step-by-step video solution
from top educators

Continue with Clever
or



By creating an account, you agree to the Terms of Service and Privacy Policy
Already have an account? Log In

A free answer
just for you

Watch the video solution with this free unlock.

Numerade

Log in to watch this video
...and 100,000,000 more!


EMAIL

PASSWORD

OR
Continue with Clever