Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program project1;
- uses
- crt;
- var
- key:char;
- x, y:integer;
- begin
- repeat
- if (keypressed = true) then begin
- key := upcase(readkey());
- if(key = 'W') then
- inc(x);
- if(key = 'S') then
- dec(x);
- if(key = 'A') then
- dec(y);
- if(key = 'D') then
- inc(y);
- end;
- writeln(x, ':', y);
- until (key = 'Q');
- end.
Add Comment
Please, Sign In to add comment