Just put your game logic into a function which will be called by newgame() (may a function called playGame() or play_game() or playgame() or blah)
maybe you want to create a Game object or similar. I don't know how big your game gets, but i think you will want to split your code in more files in some time.
I recommend you to read some tutorials on functions (optional classes), if you're not familiar with these.
Maikel
EDIT:
maybe you want to make use of tolower() or toupper()
Thank you again, although i would have known that. (Damn me! xD)
Also what is wrong here, beacuse it automaticly gives too "not founds"(for "") before I can write anything. I know it`s not critical, but annoying.
And actually the "game" is gonna be more like "interactive novel", than game.
I mean there isn`t going to be action like: "You strike enemy and do 8 damage."
Yeah, but you dont have to the map thing every time you have a question to the user. That would lead to an enormous set of functions you get (and you would write then..). Think about parts that you are reusing.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
class Game {
public:
typedefenum { Female, Male, Hermaphrodite } GenderType;
GenderType gender() const { return m_gender; }
string name() const { return m_name; }
// ... more getter functions
void setGender(GenderType gender) { m_gender = gender; }
void setName(string name) { m_name = name; }
// ... more setter functions
// playing function
void play();
private:
GenderType m_gender;
string m_name;
// ... and more states of game
};
Hmm... I prefer more simple stuff (=I`m not an expert xD).
Just one thing; how can I make it so 'N' also changes "int ch" to 2.
(And so would continue bit like this:)