Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 having trouble reseting the variable(for hangman)
Index -> Programming, Turing -> Turing Tutorials
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
manmanman




PostPosted: Thu Jan 22, 2009 10:28 pm   Post subject: having trouble reseting the variable(for hangman)

code:
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.
Sponsor
Sponsor
Sponsor
sponsor
A.J




PostPosted: Thu Jan 22, 2009 10:33 pm   Post subject: 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




PostPosted: Sat Jun 13, 2009 3:49 pm   Post subject: RE:having trouble reseting the variable(for hangman)

wrong forum man,...
Display posts from previous:   
   Index -> Programming, Turing -> Turing Tutorials
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: