|
CALL GINIT(600,600)
CALL TILE(0,0,599,599,1,2,3,2,20)
LET C=0
LET XX=40
FOR Y=20 TO 590 STEP 20
FOR X=XX TO 590 STEP 40
CALL DIA(X,Y,5,C)
LET C=7-C
NEXT X
LET XX=60-XX
NEXT Y
CALL TILE2(120,120,479,479,1,2,3,2,20)
LET C=7
LET XX=140
FOR Y=140 TO 480 STEP 20
FOR X=XX TO 480 STEP 40
CALL DIA(X,Y,5,C)
LET C=7-C
NEXT X
LET XX=260-XX
NEXT Y
END
EXTERNAL SUB TILE(XS,YS,XE,YE,C1,C2,C3,C4,SIZE)
FOR Y=YS TO YE
FOR X=XS TO XE
LET I=INT(X/SIZE)
LET J=INT(Y/SIZE)
IF MOD(I+J,4)=0 THEN LET C=C1
IF MOD(I+J,4)=1 THEN LET C=C2
IF MOD(I+J,4)=2 THEN LET C=C3
IF MOD(I+J,4)=3 THEN LET C=C4
CALL PSET(X,Y,C)
NEXT X
NEXT Y
END SUB
EXTERNAL SUB TILE2(XS,YS,XE,YE,C1,C2,C3,C4,SIZE)
FOR Y=YS TO YE
FOR X=XS TO XE
LET I=INT(X/SIZE)
LET J=INT(Y/SIZE)
IF MOD(4+I-J,4)=0 THEN LET C=C1
IF MOD(4+I-J,4)=1 THEN LET C=C2
IF MOD(4+I-J,4)=2 THEN LET C=C3
IF MOD(4+I-J,4)=3 THEN LET C=C4
CALL PSET(X,Y,C)
NEXT X
NEXT Y
END SUB
EXTERNAL SUB PSET(X,Y,C)
SET POINT COLOR C
PLOT POINTS:X,Y
END SUB
EXTERNAL SUB GINIT(XSIZE,YSIZE)
SET BITMAP SIZE XSIZE,YSIZE
SET WINDOW 0,XSIZE-1,0,YSIZE-1
SET POINT STYLE 1
SET COLOR MODE "REGULAR"
SET COLOR MIX(0) 0,0,0
SET COLOR MIX(1) 1,0,0
SET COLOR MIX(2) 1,.5,0
SET COLOR MIX(3) 1,204/255,0
SET COLOR MIX(4) 0,1,0
SET COLOR MIX(5) 0,1,1
SET COLOR MIX(6) 1,1,0
SET COLOR MIX(7) 1,1,1
CLEAR
END SUB
EXTERNAL SUB DIA(X,Y,RR,C)
DIM XX(4),YY(4)
SET AREA COLOR C
FOR I=1 TO 4
LET XX(I)=X+RR*COS(I*PI/2)
LET YY(I)=Y+RR*SIN(I*PI/2)
NEXT I
MAT PLOT AREA:XX,YY
END SUB
|
|