Advertisement
Guest User

Untitled

a guest
Dec 12th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1.  
  2. #include <iostream>
  3. #include <unistd.h>
  4. #include <windows.h>
  5. #define i 5
  6. #define j 50
  7. using namespace std;
  8.  
  9.  
  10. int main()
  11. {
  12.  
  13. system("color 81");
  14. cout<<"aperte D \n";
  15.  
  16. string mat[5][j];
  17. char key;
  18. int l,c,flag = 0,count =0;
  19.  
  20. for(l=0;l<5;l++){
  21. for(c=0;c<j;c++){
  22. mat[l][c] = "+";
  23.  
  24. }
  25.  
  26. }
  27.  
  28. //def x,y inicial:
  29. mat[0][1] = "x";
  30.  
  31. for(l=0;l<5;l++){
  32.  
  33. for(c=0;c<j;c++){
  34. cout<<mat[l][c];
  35. }
  36. if(c == j){
  37. cout<<"\n";
  38. }
  39.  
  40. }
  41.  
  42. for(;;){
  43.  
  44. if(GetAsyncKeyState(39) < 0){
  45. system("cls");
  46. count += 1;
  47.  
  48. mat[0][(1+count) - 1] = "+";
  49. mat[0][1+count] = "x";
  50.  
  51. for(l=0;l<5;l++){
  52.  
  53. for(c=0;c<j;c++){
  54. cout<<mat[l][c];
  55. }
  56. if(c == j){
  57. cout<<"\n";
  58. }
  59. }
  60. sleep(1);
  61. }
  62.  
  63.  
  64. }
  65.  
  66. return 0;
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement