Hi I am created a word guessing game.
I have pretty much completed the game, but I cannot get it to do one thing.
That is showing the users previous guess along with the new guess.
For example, I want it to be like this
Instead I only get my game to print the last guess, which in this case is "house".
I am defined a function that prints the Guesses and where or not it is correct, and calling this function
everytime a guess is entered.
I have tried creating a empty variable and adding the guessed word everytime a word is entered and the same with correct, and then printing them.
However the problem is, the guesses do no match up with the correct.
The above example would look something like this:
How would I go about in fixing this problem?
Here is some of the code from the game that tries to print this:
def informuser(): print "\nYour guesses correct incorrect" print guessedwords, " "*30 + corrects, " "*30 + incorrects def main() while (guesses != 0): for i in range(len(codeword)): if codeword == codewordguess: correct = correct + 1 if codeword != codewordguess: incorrect = incorrect + 1 guessedwords = guessedwords + "\n" + codewordguess corrects = corrects + "\n" + str(correct) incorrects = incorrects + "\n" + str(incorrect) incorrect = 0 correct = 0 informuser()