home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Crawly Crypt Collection 1
/
crawlyvol1.bin
/
program
/
compiler
/
elan1v5
/
intgraph
/
moving.e
< prev
next >
Wrap
Text File
|
1989-03-10
|
911b
|
36 lines
moving radar:
enter graphics mode;
print heading;
determine parameters;
draw moving radar;
wait for confirmation (2 * graphics x limit DIV 3, 1);
leave graphics mode.
print heading:
put ("Moving radar");
line;
put ("============");
line.
determine parameters:
REAL VAR radius :: ask real ("Radius? ");
radius := min (radius, real (min (graphics y limit, graphics x limit)) / 2.1);
put ("Radius used: ");
put (text (int (radius), 3));
REAL CONST step x :: min (1.0, real (graphics x limit) / 360.0);
REAL VAR centre x :: max (0.0, radius - 260.0);
INT CONST centre y :: graphics y limit - int (radius).
draw moving radar:
INT VAR i;
FOR i FROM 0 UPTO 360
REP
move (round (centre x), centre y);
draw (round (centre x + aspect * sin (i) * radius), centre y + round (cos (i) * radius));
centre x INCR step x
ENDREP.
⇦