Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uses graphabc;
- const n=10000;
- type TCell=record
- x,y:integer;
- end;
- var
- m:array[1..N] of byte;
- i,x,y,x0,y0:integer;
- BEGIN
- x0 := windowwidth div 2;
- y0 := windowheight div 2;
- Window.Width := 500;
- Window.Height := 500;
- MoveTo(x0,y0);
- SetPenColor(clWhite);
- // формирование пути
- //write('Путь: ');
- for i := 1 to N do begin
- m[i] := random(8)+1;
- //write(m[i],' ');
- end;
- // определение координат
- for i:= 1 to N do begin
- case m[i] of
- 1: x := x-1; //left
- 2: y := y-1; //top
- 3: x := x+1; //right
- 4: y := y+1; //bot
- 5: begin x := x-1; y := y-1; end; //left-top
- 6: begin x := x+1; y := y-1; end; //right-top
- 7: begin x := x+1; y := y+1; end; //right-bot
- 8: begin x := x-1; y := y+1; end; //left-bot
- end;
- LineTo(x0+x,y0-y);
- SetPenColor(clBlack);
- end;
- END.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement