PROGRAM BOX; {a program that draws some boxes with the LINE procedure} VAR I1:INTEGER; PC:INTEGER; PROCEDURE NEXTCOLOR; {color 0 = invisible; 1..3 depend on palette setting} BEGIN IF PC = 3 THEN PC := 1 ELSE PC := PC + 1; END; PROCEDURE BOX(SIDE:INTEGER); BEGIN DRAW(10,10,10+SIDE,10,PC); DRAW(10+SIDE,10,10+SIDE,10+SIDE,PC); DRAW(10+SIDE,10+SIDE,10,10+SIDE,PC); DRAW(10,10+SIDE,10,10,PC); END; BEGIN SETMODE(19); {selects 320x200 color graphics} CURSOR(0,20); WRITELN('box demo program'); FOR I1 := 1 TO 10 DO BEGIN BOX(I1*10); NEXTCOLOR; END; READLN; {requires a CR before resetting the mode} SETMODE(3); {select 80 column text mode} END.