
-----------------------------------
manmanman
Thu Jan 22, 2009 10:28 pm

having trouble reseting the variable(for hangman)
-----------------------------------
proc play2
    var playAgain : string (1)          % gets 'y' or 'n'
    locate (maxrow - 3, 1)
    PutCenter ("Play Again? (Y/N)")

    View.Update

loop
        getch (playAgain)
        exit when (playAgain = "Y" or playAgain = "y") or (playAgain = "N" or playAgain = "n")
        BlinkMessage (maxrow - 2, 2, "Must be 'Y' or 'N'", yellow)
    

    View.Update

    if playAgain = "Y" or playAgain = "y" then
        var input : string (1)              % User's guess
        % var puzzle : string := ""               % Phrase to guess
        var unString, unDisplay : string := "" % Phrase with underlines, To display

        var bodyCount : int := 0       % # of errors

        var lettersUsed : string := "" % contains all letters entered
        var choiceDisplay : string := "" % Centerable string or letters avail.


    end if
    View.Update
end loop

    cls
    locate (4, 1)
    PutCenter ("Thanks for playing!")
    DrawHangman (335, 190, 15, 40, 50, 15, 10, -20, 6, 2)
    View.Update
end play2


Ok so right now im trying to figure out how to reset the game but it always exits. i use it as an include. what this is supposed to do is reset all the var's.

-----------------------------------
A.J
Thu Jan 22, 2009 10:33 pm

Re: having trouble reseting the variable(for hangman)
-----------------------------------
Could you please provide us with the ENTIRE program (not just one procedure, so I can put it in context). And also, could you explain what is actually happening when you are trying to reset the game ? (cuz since u havent provided the entire code, i can't compile it)

but I think all u have to do is exit your 'game' loop and go back to your 'main' loop

-----------------------------------
stas054
Sat Jun 13, 2009 3:49 pm

RE:having trouble reseting the variable(for hangman)
-----------------------------------
wrong forum man,...
