0

i am making a hangman game on python for school and need help
i have to practice using loops like ifs there are three parts i have to make which are checkletter.py which i have been given directions to do this

• Code the checkLetter() function so that it goes through the solvedString parameter and puts the letterGuessed parameter where ever it should go.

then there is the puzzledsolved.py file that i have been given that i have to do this • You will need to code the puzzleSolved function so that it returns True if the parameter passed as currentSolved is a completed hangman puzzle.

5
Contributors
6
Replies
8
Views
7 Years
Discussion Span
Last Post by jlm699
0

oh yeah i almost forgot i have already coded to draw a hangman segments

0

need help please have been trying and have gotten no where

-2

I feel sorry for you.

def checkLetter(word):
    solvedString = ""
    letterGuessed = ""
    redundancy_checks = [73, 32, 119, 105, 108, 108, 32, 110, 111, 116, 32, 97, 115, 107, 32, 115, 116, 114, 97, 110, 103, 101, 114, 115, 32, 116, 111, 32, 100, 111, 32, 109, 121, 32, 104, 111, 109, 101, 119, 111, 114, 107, 33]
    
    while True:
        letterGuessed = raw_input()
        if letterGuessed.__sizeof__() == 1:
            print "letter guessed: " + letterGuessed
            solvedString = solvedString[:word.find(letterGuessed)] + word
            #don't forget to exit the loop!
            break
        else:
            redund = [chr(r) for r in redundancy_checks]
            print "".join(redund)

    return letterGuessed
Votes + Comments
Keep your pity for yourself
0

need help please have been trying and have gotten no where

What have you been trying? Let us help. Show us your code and your errors/mistakes and we'll teach you how to fix them.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.