Advertisement
Guest User

Untitled

a guest
Aug 11th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.57 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <fstream>
  4. #include <string>
  5. #include <cstdlib>
  6. #include <ctime>
  7. using namespace std;
  8.  
  9. void splashScreen();
  10. void login();
  11. void command();
  12. void encounter();
  13.  
  14. int main()
  15. {
  16.     ifstream inputData;
  17.     inputData.open("data.txt");
  18.  
  19.     splashScreen();
  20.     login();
  21.     encounter();
  22.     command();
  23. }
  24.  
  25. void splashScreen()
  26. {
  27.     cout << "================================================" << endl;
  28.     cout << "==       ________                             ==" << endl;
  29.     cout << "==      | o __ o |        Title               ==" << endl;
  30.     cout << "==       \_ __ _/                             ==" << endl;
  31.     cout << "==      __ |  | __                            ==" << endl;
  32.     cout << "==    **************                          ==" << endl;
  33.     cout << "================================================" << endl;
  34. }
  35. void login()
  36. {
  37.     string userName;
  38.     string userPass;
  39.  
  40.     cout << "Username: ";
  41.     cin >> userName;
  42.     cout << "Password: ";
  43.     cin >> userPass;
  44.     //check userName to username in file
  45.     //check userPass to password in file
  46. }
  47. void command()
  48. {
  49.     string userCommand;
  50.     cout << ">> ";
  51.     cin >> userCommand;
  52.     cout << userCommand;
  53. }
  54. void encounter()
  55. {
  56.     srand(time(0));
  57.     int num = rand() % 10 + 1;
  58.     switch(num)
  59.     {
  60.     case 1:
  61.     case 2:
  62.     case 3:
  63.     case 4:
  64.     case 5:
  65.     case 6:
  66.     case 7:
  67.     case 8:
  68.     case 9:
  69.     case 10:
  70.         cout << "STOMP! A giant stone golem almost flattened you, luckily you halted an \n"
  71.             << "inch short of his foot as it fell. He begins to raise his leg again \n"
  72.             << "for another bash." << endl;
  73.         command();
  74.     }
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement