Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdio.h>
- #include <stdlib.h>
- #include <conio.h>
- using namespace std;
- int main(int argc, char *argv[]){
- unsigned car=' ';
- do{
- if(car==0)car=getch()+256;
- {
- if (car==80)
- cout<<"down arrow"<<endl;
- else if (car==75)
- cout<<"left arrow"<<endl;
- else if (car==77)
- cout<<"right arrow"<<endl;
- else if (car==72)
- cout<<"up arrow"<<endl;
- }
- }while((car=getch())!='\033');
- return 0;
- }
Add Comment
Please, Sign In to add comment