Advertisement
Guest User

c++ problem

a guest
Dec 15th, 2015
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.27 KB | None | 0 0
  1. //copy this to get a shell to work in
  2. #include <iostream>
  3. #include <vector>
  4. #include <string>
  5. #include <fstream>
  6.  
  7. using namespace std;
  8.  
  9. int main(){
  10. int health = 10;
  11. int dmg = 1;
  12. int armor = 0;
  13. int xaxis1 = 0;
  14. int xaxis2 = 0;
  15. int yaxis1 = 0;
  16. int yaxis2 = 0;
  17. int movepoints = 1;
  18. string direction = "nothing";
  19. bool monsterTile = false;
  20. cout << "Your standing in a large room with smooth marble floor and quartz walls there is no exit which direction do you move ";
  21. cin >>  direction;
  22. if (direction == "right","Right"){
  23.    
  24.     cout << "How far to the right? ";
  25.     cin >> xaxis1;
  26. }
  27. if (direction == "left","Left"){
  28.     cout << "How far to the left? ";
  29.     cin >> xaxis2;
  30. }
  31. if (direction == "forward","Forward"){
  32.     cout << "How far forward? ";
  33.     cin >> yaxis1;
  34. }
  35. if (direction == "back","Back"){
  36.     cout << "How far backwards? ";
  37.     cin >> yaxis2;
  38. }
  39. if ((xaxis1 >= 1) && (monsterTile == false)){
  40.     cout << "You move to the right";
  41.     cin >> direction;
  42. }
  43. if ((xaxis2 >= 1) && (monsterTile == false) ){
  44.     cout << "You move to the left";
  45.     cin >> direction;
  46. }
  47. if ((yaxis1 >= 1) && (monsterTile == false)){
  48.     cout << "You move forward";
  49.     cin >> direction;
  50. }
  51. if ((yaxis2 >= 1) && (monsterTile == false)){
  52.     cout << "You move backwards";
  53.     cin >> direction;
  54. }
  55.  
  56.  
  57. return 0;
  58.  
  59.  
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement