home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Borland Programmer's Resource
/
Borland_Programmers_Resource_CD_1995.iso
/
utils
/
cat_exe
/
rhomb.cal
< prev
next >
Wrap
Text File
|
1995-05-18
|
1KB
|
53 lines
(* Program creates rhombic shapes by aid of the 'XOR' operator. *)
(* *)
RECIPE XYSize = 80;
XYBound = 1;
Colors = 2;
Zet = 2;
CONST Dead = 0;
Alive = 1;
VAR x;
REF right [1,0];
left [-1,0];
top [0,-1];
bottom [0,1];
bottom_right [1,1];
bottom_left [-1,1];
top_right [1,-1];
top_left [-1,-1];
EVENT SetUp;
RingForm;
PlClipAll;
RGBPalette(Colors, $0, $FF, $32,0, $B6,0);
ShowPlane;
EVENT E1;(* initialization of the cells *)
PARALLEL DO
x := Random (1000);
IF (x > 998)
THEN Self := Alive;
ELSE Self := Dead;
FI;
OD;
ShowPlane;
EVENT E2;
PARALLEL DO
IF Self = Alive
THEN Self := Alive;
ELSE Self := Self XOR (right OR left OR top OR bottom);
FI;
OD;
ShowPlane;
END.
********************************
* compilation o.k. *
********************************