Friday, January 25, 2008

Endless Loops

So I edited my help menu and while debugging ran into something nasty. When I type in a bunch of random letters I get an endless amount of error text. I need to then shut down the game. This is no good, but it must be solved at a later date.

Add it to the to-do list :]

3 comments:

Ethan Lawrence said...

Send me the program if you haven't fixed it yet. I'm probably not going to be able to do anything, I just want to see it.

Max Hardcastle said...

Okay, I can email it I think... I've got it save in a folder.

Zhanar said...

I'd suggest you to put a condition before you actually do something with what you get from the user. Check for "eligibility" to run the further code. Something like
if ((what_the_user_wrote==possible_answer1)or(what_the_user_wrote==possible_answer2)) run_the_program;
else {
cout<<"I don't like what you wrote\n";
exit_the_program();
}

It kind of filters whatever the user enters, so that you don't run the program with wrong data.