Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <Windows.h>
- #include <string>
- using namespace std;
- char choice;
- int main()
- {
- char name[20];
- int coins = 0;
- string question1;
- int question2 = 0;
- cout << "Instructions:";
- cout << "\n";
- cout << "Solve the 6 puzzles and collect as many coins as you can and the final treasure in the center of the tomb.";
- cout << "\n";
- system("PAUSE");
- system("cls");
- cout << "\t\t\t----------Adventure Game----------";
- do
- {
- cout << "\n\t\t\t--------------------------------";
- cout << "\n\t\t\t1. Adventure Game";
- cout << "\n\t\t\t2. Help";
- cout << "\n\t\t\t3. Exit";
- cout << "\n\t\t\t--------------------------------";
- cout << "\n\t\t\tPlease Enter 1, 2, or 3: ";
- cin >> choice;
- switch (choice)
- {
- case '1': if (choice == '1')
- {
- cout << "You are a lone adventurer, you stumble upon a large ancient tomb" << "\n" << "You must solve the puzzles on the 7 doors to get to the treasure";
- cout << "\n";
- system("PAUSE");
- system("cls");
- cout << "Please enter your name: ";
- cin >> name;
- cout << "\nWelcome " << name;
- system("cls");
- cout << name << " approaches door number 1";
- cout << "\nSolve the following puzzle: ";
- cout << "\n\nWhat is 12 X 12?";
- cin >> question2;
- if (question2 == 144)
- {
- cout << "You hear a click and the door opens and you grab a coin...";
- cout << "\n";
- coins++;
- system("PAUSE");
- }
- else if (question2 != 144)
- {
- cout << "You triggered the trap and the coin disappears";
- cout << "\n";
- system("PAUSE");
- }
- system("cls");
- cout << "You move on and you see another door" << endl;
- cout << name << " approaches door number 2..";
- cout << "\nWhich countries flag has black, red and yellow horizontally?";
- cin >> question1;
- if (question1 == "Germany")
- {
- cout << "You hear a click and the door opens and you grab a coin...";
- cout << "\n";
- Sleep(2500);
- coins++;
- }
- else if (question1 != "Germany")
- {
- cout << "You triggered the trap and the coin disappears";
- cout << "\n";
- system("PAUSE");
- }
- system("cls");
- cout << "You move on and you see another door" << endl;
- cout << name << " approaches door number 3..";
- cout << "\n How many sides does a septagon have?";
- cin >> question2;
- if (question2 == 7)
- {
- cout << "You hear a click and the door opens and you grab a coin...";
- cout << "\n";
- coins++;
- Sleep(2500);
- }
- else if (question2 != 7)
- {
- cout << "You triggered the trap and the coin disappears";
- cout << "\n";
- system("PAUSE");
- }
- system("cls");
- cout << "You move on and you see another door" << endl;
- cout << name << " approaches door number 4..";
- cout << "\n How many letters are in the alphabet?";
- cin >> question2;
- if (question2 == 26)
- {
- cout << "You hear a click and the door opens and you grab a coin...";
- cout << "\n";
- coins++;
- Sleep(2500);
- }
- else if (question2 != 26)
- {
- cout << "You triggered the trap and the coin disappears";
- cout << "\n";
- }
- system("cls");
- cout << "You move on and you see another door" << endl;
- cout << name << " approaches door number 5..";
- cout << "\n What country has the highest population?";
- cin >> question1;
- if (question1 == "China")
- {
- cout << "You hear a click and the door opens and you grab a coin...";
- cout << "\n";
- coins++;
- Sleep(2500);
- }
- else if (question1 != "China")
- {
- cout << "You triggered the trap and the coin disappears";
- cout << "\n";
- }
- system("cls");
- cout << "You move on and you see another door" << endl;
- cout << name << " approaches door number 6..";
- cout << "\n What is the capital city of Egypt?";
- cin >> question1;
- if (question1 == "Cairo")
- {
- cout << "You hear a click and the door opens and you grab a coin...";
- cout << "\n";
- coins++;
- Sleep(2500);
- }
- else if (question1 != "Cairo")
- {
- cout << "You triggered the trap and the coin disappears";
- cout << "\n";
- }
- system("cls");
- cout << "You see the treasure there in all its glory, you snatch it and escape.";
- cout << "\n\n Congratulations! you won the game here are your statistics:";
- cout << "\n\nYour name: " << name;
- cout << "\nCoins collected: " << coins;
- cout << "\n\nType exit to go back to the menu";
- cin >> question1;
- system("cls");
- break;
- case '2': system("cls");
- cout << "Instructions:";
- cout << "\n";
- cout << "Solve the 6 puzzles and collect as many coins as you can and the final treasure in the center of the tomb.";
- cout << "\n";
- break;
- }
- case '3': cout << "Exiting program please wait.";
- Sleep(3500);
- break;
- }
- } while (choice != '3');
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement