Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,26 @@
include c:\cxpl\codes; \intrinsic 'code' declarations
proc Dragon(D, P, Q); \Draw a colorful dragon curve
int D, P, Q; \recursive depth, coordinates of line segment
int R(2), \coordinates of generated new point
DX, DY, C; \deltas, color
[C:= [0]; \color is a local, static-like variable
D:= D+1; \depth of recursion increases
if D >= 13 then \draw lines at maximum depth to get solid image
[Move(P(0), P(1)); Line(Q(0), Q(1), C(0)>>9+4!8); C(0):= C(0)+1; return];
DX:= Q(0)-P(0); DY:= Q(1)-P(1);
R(0):= P(0) + (DX-DY)/2; \new point
R(1):= P(1) + (DX+DY)/2;
Dragon(D, P, R); \draw two segments that include the new point
Dragon(D, Q, R);
];
int X, Y, P(2), Q(2);
[SetVid($101); \set 640x480 video graphics mode
X:= 32; Y:= 32; \coordinates of initial horizontal line segment
P(0):= X; P(1):= Y;
Q(0):= X+64; Q(1):= Y; \(power of two length works best for integers)
Dragon(0, P, Q); \draw its dragon curve
X:= ChIn(1); \wait for keystroke
SetVid(3); \restore normal text mode
]