Advertisement
Guest User

Untitled

a guest
Jul 11th, 2014
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. Process returned 0 <0x0> execution time : 2.249 s
  2. Press any key to continue.
  3.  
  4. c1 = getch();
  5. if(c1 == 0)
  6. {
  7.  
  8. c2 = getch();
  9.  
  10. if(c2 == 72) {cout << endl << "Up Arrow" << endl;}
  11. else if(c2 == 80) {cout << endl << "Down Arrow" << endl;}
  12. else{cout << endl << "Incorrect Input" << endl;}
  13.  
  14. }
  15.  
  16. switch(getch()) {
  17. case 65:
  18. cout << endl << "Up" << endl;//key up
  19. break;
  20. case 66:
  21. cout << endl << "Down" << endl; // key down
  22. break;
  23. case 67:
  24. cout << endl << "Right" << endl; // key right
  25. break;
  26. case 68:
  27. cout << endl << "Left" << endl; // key left
  28. break;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement