RoundImpl.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Bob Hagmann, July 10, 1985 5:00:53 pm PDT
Makes circular objects
RoundImpl: CEDAR PROGRAM
~ BEGIN
RoundObj: TYPE ~ RECORD [count: INT ← 0, r: REF RoundObj ← NIL];
Make some roundness
TheCircleGame: PROC [size: CARDINAL] ~ {
first: REF RoundObj ← NEW[RoundObj];
last: REF RoundObj;
last ← first;
IF size <= 1 THEN RETURN;
FOR cnt: CARDINAL IN [1..size] DO
next: REF RoundObj ← NEW[RoundObj];
next.r ← last;
next.count ← cnt;
last ← next;
ENDLOOP;
first.r ← last;
first ← NIL;
};
END.