Advertisement
Guest User

dont steal it please

a guest
Oct 22nd, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <stdlib.h>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. int xpos=0;
  10. int ypos=0;
  11. int i;
  12. int y;
  13. char input;
  14.  
  15. int map[50][50];
  16. map[xpos][ypos] = 69;
  17. for(;;)
  18. {
  19. for(i=0;i<50;i++)
  20. {
  21. for(y=0;y<50;y++)
  22. {
  23. if(map[i][y]==69)
  24. {
  25. cout << "E";
  26. }
  27. else
  28. {
  29.  
  30. cout << " ";
  31. }
  32. }
  33. cout << endl;
  34. }
  35. cout << endl;
  36. cin >> input;
  37. if(input=='s')
  38. {
  39. if(xpos<49)
  40. {
  41. map[xpos][ypos] = 0;
  42. xpos++;
  43. }
  44. }
  45. else if(input=='w')
  46. {
  47. if(xpos>0)
  48. {
  49. map[xpos][ypos] = 0;
  50. xpos--;
  51. }
  52. }
  53. if(input=='d')
  54. {
  55. if(ypos<49)
  56. {
  57. map[xpos][ypos] = 0;
  58. ypos++;
  59. }
  60. }
  61. else if(input=='a')
  62. {
  63. if(ypos>0)
  64. {
  65. map[xpos][ypos] = 0;
  66. ypos--;
  67. }
  68. }
  69. map[xpos][ypos] = 69;
  70. system("CLS");
  71. }
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement