Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while(true)
- {
- cout << description.c_str() << "nn";
- int response = 0;
- do
- {
- cout << "What would you like to do?n";
- if(enemy)
- cout << "1) Attack the evil "
- << enemyName.c_str() << "n";
- else if(!enemy)
- cout << " 1) Move to the next room.";
- if(treasure)
- cout << " 2) Pick up the "
- << treasureName.c_str() << "n";
- cin >> response;
- }while(response < 1 || response > 2);
- switch(response)
- {
- case 1 : if(enemy)
- {
- enemy = !enemy;
- cout << "You slay the deadly "
- << enemyName.c_str() << "n";
- }
- else if(!enemy)
- return;
- break;
- case 2: treasure = !treasure;
- cout << "You pick up the "
- << treasureName.c_str() << "n";
- break;
- }
- }
- return;
- if(enemy)
- { ...
- }
- else if(!enemy)
- {...
- }
- case 2: treasure = !treasure;
- cout << "You pick up the "
- << treasureName.c_str() << "n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement