Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <limits>
- #include <cstdlib>
- using namespace std;
- //function to clear the screen (saves time)
- void cls() {
- system("clear");
- }
- int classtype;
- char choice [1];
- int strength, mana, smarts;
- int main() {
- cout << "Welcome to\n\n\n" << " ___ _ _ _ _ \n / __| _| |__ ___ _ _ _ __ __ _| |_ _ _(_)___| |_ \n | (_| || | '_ \\/ -_) '_| '_ \\/ _` | _| '_| / _ \\ _|\n \\___\\_, |_.__/\\___|_| | .__/\\__,_|\\__|_| |_\\___/\\__|\n |__/ |_| \n\nthe game" << endl << "Press ENTER to continue...";
- //waits till enter is pressed to proceed
- cin.ignore(numeric_limits<streamsize>::max(), '\n' );
- classselect:
- cls();
- cout << "select your class" << endl << endl << "Lance (1)" << endl << "Adam (2)" << endl << "Benson (3)" << endl << endl << ">";
- //saves to variable classtype
- cin >> classtype;
- invalidclass:
- cls();
- if (classtype == 1) {
- cout << "Are you sure you want to pick Lance? (Y/n)" << endl << endl << "stats:" << endl << "strength: 8" << endl << "mana: 2" << endl << "general smarts: 6" << "\n\n>";
- cin >> choice[1];
- if (choice[1] == 'y' xor 'Y') {
- strength = 8;
- mana = 2;
- smarts = 6;
- cls();
- goto cont;
- }
- if (choice[1] != 'n' xor 'N') {
- goto classselect;
- }
- else {
- goto invalidclass;
- }
- }
- cont:
- }
Advertisement
Add Comment
Please, Sign In to add comment