vastnova.blogg.se

Help for hangman pro
Help for hangman pro












help for hangman pro
  1. #Help for hangman pro update#
  2. #Help for hangman pro code#

Once it has these values, the function can calculate the new value for the display string (i.e. Create a function new_display that takes three arguments: the secret, the display string, and the letter the user guessed.

#Help for hangman pro update#

Once we have both the secret word, and a guess, we need to be able to update the display string, and keep track of the number of letters discovered. The function should return the letter the user enters. This function should do the part of the turn the user sees (display the part of the secret they have guessed, display the number of misses, and ask them to guess a letter).ĭon't worry about the error checking (exactly one letter). You will also need to keep track of the number of unguessed letters left in the secret: this (along with the count of the misses) will be used to decide when the game is over.Ĭreate a function do_turn that takes two arguments: the display string, and the number of misses made so far. The underscores will be replaced with letters as they are guessed.Ĭreate a variable to count the number of incorrect guesses the user has made (“misses”) and initialize it appropriately. The string display will be what we show the user as they are guessing.

help for hangman pro

Create a string display that contains len(secret) underscores. In the main part of the program, call the get_secret function and store the result in secret. Start by creating a function get_secret that asks the user for the secret word/phrase, clears the screen, and returns the secret string. I'm sorry if this post is super long but here's the tips that my prof gave: I don't want to get accused for plagiarism of any sort, so I would like a step by step help as if I were going to ask my prof for help.

#Help for hangman pro code#

I can honestly say that it took me 3 hours to type the code that I have shown you. These were the tips the Prof gave, and so I'm just wondering if someone can help me on what the next step is. Word = raw_input("Enter the secret word:")ĭisplay the current status for the user and let them make a guess. So Here's what i have so far: #stuff the first person sees You guessed the secret correctly: LETTERS The game that I'm trying to code looks like this: The professor doesn't understand how difficult it is for a first time programmer and just doesn't explain new concepts thoroughly.

help for hangman pro

Hi, I'm in need of some help in using functions for the hangman game.














Help for hangman pro