- def guess_check(guess_pool,guess):
- if guess not in guess_pool:
- return "You've used that letter, Try another one!"
- guess = raw_input("Please guess a letter again: ")
- def hangman_start():
- inter = create_inter(answer)
- print "Welcome to the game, Hangman!"
- print "I am thinking of a word that is %s letters long" % len(answer)
- number_of_guesses = round(1.5*len(answer))
- guess_pool = 'abcdefghijklmnopqrstuvwxyz'
- while (number_of_guesses > 0):
- print "You have %s guesses left" %number_of_guesses
- print "Available letters: ", guess_pool
- guess = raw_input("Please guess a letter: ")
- for x in range(0,len(answer)):
- if answer[x] == guess:
- inter = fill_guessed_word(answer,guess,inter,x)
- if count == number_of_words:
- print "Oops! That letter is not in my word"
- print "Good guess: ",inter
- a= win_check(inter)
- if a == True:
- print "Congratulations!, you won!"
a guest Feb 25th, 2013 32 Never
RAW Paste Data