Guest User

Untitled

a guest
Feb 18th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include<iostream>
  2. #include<conio.h>
  3.  
  4. using namespace std;
  5.  
  6. int main(){
  7. char cTab[24][80];
  8. char ruch = 0;
  9. enum klawisz{Gora = 80, Dol = 72, Prawo = 77, Lewo = 75, Esc = 27};
  10. int x = 10;
  11. int y = 10;
  12.  
  13. for(int i=0; i<24; i++){
  14. for(int j=0; j<80; j++){
  15. cTab[i][j]=' ';
  16. }
  17. }
  18. while(static_cast<int>(ruch)!=27){
  19. ruch=getch();
  20. switch(static_cast<int>(ruch)){
  21. case Prawo:
  22. y=y+1;
  23. cTab[x][y]='x';
  24. break;
  25. }
  26. for(int i=0; i<24; i++){
  27. for(int j=0; j<80; j++){
  28. cout<<cTab[i][j];
  29. }
  30. }
  31. }
  32.  
  33.  
  34. system("PAUSE");
  35. return 0;
  36. }
Add Comment
Please, Sign In to add comment