Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <string>
- #include <stdlib.h>
- using namespace std;
- string command, target;
- bool key_have, door_open, key_know;
- int dirt_in_pocket;
- void inspect()
- {
- switch(target)
- {
- case 'door':
- case 'room':
- case 'floor':
- case 'walls':
- case 'ceiling':
- case 'key':
- case 'computer':
- default:
- system("CLS");
- cout << "Invalid input.\n\n";
- END = '';
- }
- }
- void take()
- {
- switch(target)
- {
- case 'door':
- case 'room':
- case 'floor':
- case 'walls':
- case 'ceiling':
- case 'key':
- case 'computer':
- default:
- system("CLS");
- cout << "Invalid input.\n\n";
- END = '';
- }
- }
- void use()
- {
- switch(target)
- {
- case 'door':
- case 'room':
- case 'floor':
- case 'walls':
- case 'ceiling':
- case 'key':
- case 'computer':
- default:
- system("CLS");
- cout << "Invalid input.\n\n";
- END = '';
- }
- }
- void help()
- {
- switch(target)
- {
- case 'inspect':
- cout << "You can use this to look around.\n\n";
- break;
- case 'take':
- cout << "This lets you take things.\n\n";
- break;
- case 'use':
- cout << "Allows you to use something in your posession.\n\n";
- break;
- case 'reset':
- cout << "This will reset all variables and let you start over.\n\n";
- break;
- case 'end':
- cout << "The game ends and then closes.\n\n";
- break;
- case 'help':
- cout << "Do you really need to know what this does...\n\n";
- break;
- case '':
- cout << "Type '/help <target>' to find out more about it:";
- cout << "1. inspect\n2. take\n3. use\n4. reset\n5. end\n6. help\n7. ' '\n\n";
- break;
- default:
- system("CLS");
- cout << "Invalid input.\n\n";
- END = '';
- }
- }
- void reset()
- {
- char RESET;
- while(RESET == '')
- {
- system("CLS");
- cout << "Are you sure you want to reset everything? [Y or N]\n\n";
- cin << RESET;
- if(RESET == 'y' || RESET == 'Y')
- {
- system("CLS");
- key_have = false;
- door_open = false;
- key_know = false;
- dirt_in_pocket = 0;
- cout << "All variables have been reset. Enter a new command.\n\n";
- }
- else if(RESET == 'n' || RESET == 'N')
- {
- system("CLS");
- }
- else
- {
- system("CLS");
- cout << "Invalid input.\n\n";
- RESET = '';
- }
- }
- }
- void end()
- {
- char END;
- while(END == '')
- {
- system("CLS");
- cout << "Are you sure you want to exit? [Y or N]\n\n";
- cin << END;
- if(END == 'y' || END == 'Y')
- {
- system("CLS");
- cout << "Thank you for playing, have a nice day!";
- system('pause');
- return 0;
- }
- else if)(END == 'n' || END == 'N')
- {
- system("CLS");
- }
- else
- {
- system("CLS");
- cout << "Invalid input.\n\n";
- END = '';
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement