| CODE |
// Text Based RPG #include <ctime> #include <string> #include <cstdio> #include <cstdlib> #include <iostream> #include<iomanip> #include<fstream> using std::cout; using std::cin; using std::endl; using std::string; using namespace std; int main() { const int GOLD_PIECES = 3500; string leader; int adventurers, killed, survivors; string Continue; cout << "Welcome to your journey...\n\n"; cout << "The world stands at the brink of war,\n"; cout << "which path will you choose brave adventurer?\n"; cout << "Path Choices:\n\n"; cout << "1) Warrior - Strength & Agility\n"; cout << "2) Warlock - Intellect & Stamina\n"; cout << "3) Mage - Wisdom & Dexterity\n\n"; int choice; cout << "Choice: "; cin >> choice; switch (choice) { case 1: cout <<"You have chosen the path of brutal force. Good luck!\n"; break; case 2: cout <<"You have chosen the path of destruction and demonology. Good luck!\n"; break; case 3: cout <<"You have chosen the path of healing and recovery spells. Good luck!\n"; break; } cout << "Enter a number: \n"; cin >> adventurers; cout << "Enter a number, smaller than the first: \n"; cin >> killed; survivors = adventurers - killed; cout << "Please enter your name: \n"; cin >> leader; cout << "\nA young but determined group of " << adventurers << " set out on a quest for the greater good \n"; cout << "in search of the treasure left behind from the forgotten civilizations. \n"; cout << "The group was led by " << leader << " whose chosen skills and traits would be of aide.\n"; cout << "Along the way, orcs from the burning crusade ambushed the group hoping\n"; cout << "to capture " << leader << ".\n"; cout << "The group fought their hardest led by " << leader; cout << ", and the orcs were defeated,\n"; cout << "but at a price. \n"; cout << "Of the adventurers, " << killed << " had disappeared forever, "; cout << "leaving just " << survivors << " in the group.\n\n"; cout << "\nThe leader " << leader << " was about to give up and let the group go their seperate\n"; cout << "paths.\n"; cout << "But as the group finished laying the dead to rest, "; cout << "they stumbled upon\n"; cout << "the buried fortune.\n"; cout << "So the adventurers split " << GOLD_PIECES << " gold pieces."; cout << leader << " kept\n"; cout << "the extra " << (GOLD_PIECES % survivors); cout << " pieces because after all, their journey could not have\n"; cout << "been accomplished\n"; cout << "without his power and knowledge against the beast men.\n\n"; cout << "Until next time, the journey has ended...\n"; cin.ignore(); system("Pause"); std::cout<<"\n"<<std::endl; return 0; |