Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>;
- #include <conio.h>;
- void main()
- {
- /*variables */
- int x,y;
- char t;
- clrscr();
- x=1;
- y=1;
- do
- {
- clrscr();
- gotoxy(x,y); printf(" ");
- gotoxy(x,y+1);printf(" * ");
- gotoxy(x,y+2);printf(" ");
- t=getch();
- switch(t)
- {
- case(72):if (y>1) y--; else y=22; break; //Up
- case(80):if (y<22) y++; else y=1; break; //Down
- case(77):if (x<76) x++; else x=1; break; //right
- case(75):if (x>1) x--; else x=76; break; //leftt
- }
- }while (t!=27);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement