Guest User

Untitled

a guest
Aug 19th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.60 KB | None | 0 0
  1. Program Zad2;
  2.  
  3. Uses CRT;
  4.  
  5. Var dx, dy: integer;
  6.     Cmd: char;
  7.  
  8. Begin
  9.  
  10.         ClrScr();
  11.         dx := 0;
  12.         dy := 0;
  13.  
  14.         WriteLn( '*' );
  15.  
  16.         Repeat
  17.                 Cmd := ReadKey;
  18.                 ClrScr();
  19.  
  20.                 Case UpCase( Cmd ) of
  21.                         'W': dy := dy - 1;
  22.                         'S': dy := dy + 1;
  23.                         'A': dx := dx - 1;
  24.                         'D': dx := dx + 1;
  25.                 End;
  26.  
  27.                 GotoXY( dx, dy );
  28.                 WriteLn( '*' );
  29.  
  30.         Until UpCase( Cmd ) = 'Q';
  31.  
  32.         ReadLn;
  33. End.
Add Comment
Please, Sign In to add comment