Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,38 @@
|
|||
include c:\cxpl\codes; \include 'code' declarations
|
||||
|
||||
proc Circle(X0, Y0, Radius, Color); \Display a circle
|
||||
int X0, Y0, \coordinates of center
|
||||
Radius, \radius in (pixels)
|
||||
Color; \line color
|
||||
int X, Y, E, U, V;
|
||||
|
||||
proc PlotOctants; \Segment
|
||||
[Point(X0+Y, Y0+X, Color); \ 0
|
||||
Point(X0+X, Y0+Y, Color); \ 1
|
||||
Point(X0-X, Y0+Y, Color); \ 2
|
||||
Point(X0-Y, Y0+X, Color); \ 3
|
||||
Point(X0-Y, Y0-X, Color); \ 4
|
||||
Point(X0-X, Y0-Y, Color); \ 5
|
||||
Point(X0+X, Y0-Y, Color); \ 6
|
||||
Point(X0+Y, Y0-X, Color); \ 7
|
||||
]; \PlotOctants
|
||||
|
||||
[X:= 0; Y:= Radius;
|
||||
U:= 1;
|
||||
V:= 1 -Radius -Radius;
|
||||
E:= 1 -Radius;
|
||||
while X < Y do
|
||||
[PlotOctants;
|
||||
if E < 0 then
|
||||
[U:= U+2; V:= V+2; E:= E+U]
|
||||
else [U:= U+2; V:= V+4; E:= E+V; Y:= Y-1];
|
||||
X:= X+1;
|
||||
];
|
||||
if X = Y then PlotOctants;
|
||||
]; \Circle
|
||||
|
||||
[SetVid($112); \640x480 in 24-bit RGB color
|
||||
Circle(110, 110, 50, $FFFF00);
|
||||
if ChIn(1) then []; \wait for keystroke
|
||||
SetVid(3); \restore normal text mode
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue