Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uses crt;
- var input : text;
- x, y, d, x2, y2 : integer;
- i, j, k, n : byte;
- povel : char;
- Begin
- clrscr;
- assign(input,'SKOLA.IN');
- reset(input);
- GoToXY(2,2);
- writeln('Votrelci idu! ZENITaci pozor si dajte!');
- read(input,x,y);
- readln(input);
- GoToXY(x,y);
- while not eoln(input) do
- Begin
- write('.');
- read(input,povel);
- case povel of
- 'W': y := y-1;
- 'A': x := x-1;
- 'S': y := y+1;
- 'D': x := x+1;
- end;
- GoToXY(x,y);
- write('A');
- GoToXY(x,y);
- if (ord(povel) >= ord('1')) and (ord(povel) <= ord('9')) then
- Begin
- d := (ord(povel)-48)*2+1;
- n := ord(povel)-48;
- x2 := whereX-n;
- y2 := whereY-n;
- GoToXY(x2,y2);
- for i := 0 to n-1 do
- Begin
- for k := 1 to d do
- Begin
- for j := 1 to d do write(i);
- GoToXY(x2,whereY+1);
- end;
- if d <= 1 then break;
- x2 := x2+1;
- y2 := y2+1;
- d := d-2;
- GoToXY(x2,y2);
- end;
- end;
- end;
- close(input);
- readln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement