Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <fstream>
- #include <string>
- #include <cstdlib>
- #include <ctime>
- using namespace std;
- void splashScreen();
- void login();
- void command();
- void encounter();
- int main()
- {
- ifstream inputData;
- inputData.open("data.txt");
- splashScreen();
- login();
- encounter();
- command();
- }
- void splashScreen()
- {
- cout << "================================================" << endl;
- cout << "== ________ ==" << endl;
- cout << "== | o __ o | Title ==" << endl;
- cout << "== \_ __ _/ ==" << endl;
- cout << "== __ | | __ ==" << endl;
- cout << "== ************** ==" << endl;
- cout << "================================================" << endl;
- }
- void login()
- {
- string userName;
- string userPass;
- cout << "Username: ";
- cin >> userName;
- cout << "Password: ";
- cin >> userPass;
- //check userName to username in file
- //check userPass to password in file
- }
- void command()
- {
- string userCommand;
- cout << ">> ";
- cin >> userCommand;
- cout << userCommand;
- }
- void encounter()
- {
- srand(time(0));
- int num = rand() % 10 + 1;
- switch(num)
- {
- case 1:
- case 2:
- case 3:
- case 4:
- case 5:
- case 6:
- case 7:
- case 8:
- case 9:
- case 10:
- cout << "STOMP! A giant stone golem almost flattened you, luckily you halted an \n"
- << "inch short of his foot as it fell. He begins to raise his leg again \n"
- << "for another bash." << endl;
- command();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement