in reply to Re^4: Resetting variables
in thread Resetting variables

Oops indeed. I spent time on that for you.

Once again I don't know what your current code looks like. The code you posted above does give the error message you described, for the reason I described. Your newly posted reset_game() sub will not generate the same error, but still contains a bug. Hint: Why are you putting [$all_occurrences] within a character class to check what the user entered, when you've assigned a value of '0' to $all_occurrences? What is that supposed to do?


Dave

Replies are listed 'Best First'.
Re^6: Resetting variables
by yacoubean (Scribe) on Dec 21, 2004 at 18:36 UTC
    If you look at my reply here I posted my entire script. $all_occurences is being populated in the check_guess() sub. It keeps a list of index values in the word the player is trying to guess so that when I am printing out the word, I print all of the guesed letters.