this is doing my head in!!

i have written the start of my new text game, and it compiles fine and I got no warnings either, but, when I run it, if you pressed D to go to drakes inn with 1 item, it is locked, which is fine, but, after it goes back to the sign post function, and you press D again, it skips back to the end credits!!! I am sure it should not do that, but i can't see where I am going wrong, as if there was a problem with my program in functions, the compiler would of told me, I spoke to my dad who works for IBM, and he said he can't see a reason either, do you goes know how to fix it? can i put a BREAK in the function perhaps?

Ever use a for-loop? If you find yourself typing a bunch of lines over and over and a feeling of drudgery overtakes you, that feeling should be trained to alert you that you are doing something wrong.

int chapter; // level varible name

Ever hear the admonition: "always initialize your variables" ? Since chapter equals some junk value, none of the chapter if statements in the first part of the game() function are true, and therefore none of them are executed. Since you also have this to start:

int Exp = 0;

none of the Exp if statements are executed either.
------

Code:

if (chapter == 1)
{
{

Why do you have two opening braces there?

Suppose chapter is equal to 1, what will the value of Ehealth be after the code below executes? What about Edamage?

You have a syntax error. Look at the following code and try to guess what level is equal to when it is displayed:

Code:

int level = 0;
level=+1;
level=+1;
level=+1;
cout<<level<<endl;

Now, run the code and see if you were correct.

You have so many errors it's hard to list them all. Here is a hint: when you are writing programs write one function, then compile your program and test the function to make sure it works correctly. Once it's working correctly, move on to the next function.

"Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
-Christopher Hitchens