Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Oct 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Code will not stop calling my main function, even when I try to exit.

    For some reason, even when I call a function that doesn't call back to another function it just keeps calling my getClass(); function

    This has been driving me nuts for the past few days, and I have no clue how to fix it.

    the code in it's entirety is here:

    https://docs.google.com/document/d/1...it?usp=sharing

    Since it never ends debugging it is a pain seeing as how I have to force quit every time I figure out there's still a problem.

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,032
    Thanks
    75
    Thanked 4,325 Times in 4,291 Posts
    So change your code to allow a player to end the game.

    Maybe in getClass() you accept "end" as an answer and when you get that you end the game.

    I hope you realize that prompt() and confirm() and alert() are all considered very very obsolete and should never be used in any contemporary web page.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •