波打ってる?

 投稿者:しばっち  投稿日:2013年12月15日(日)18時50分46秒
  OPTION BASE 0
CALL GINIT(600,600)
DIM C(7)
FOR I=0 TO 7
   READ C(I)
NEXT I
DATA 3,2,2,3,2,3,3,2
CALL TILE(0,0,599,599,6,7,600/17)
FOR Y=35 TO 565 STEP 600/17
   FOR X=35 TO 565 STEP 600/17
      CALL DIA(X,Y,5,C(MOD(A+B,8)))
      LET B=B+1
   NEXT X
   LET A=A+1
NEXT Y
END

EXTERNAL  SUB TILE(XS,YS,XE,YE,C1,C2,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,2)=0 THEN LET C=C1 ELSE LET C=C2
      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,YSIZE-1,0
SET POINT STYLE 1
SET COLOR MODE "REGULAR"
SET COLOR MIX(0) 0,0,0
SET COLOR MIX(1) 0,0,1
SET COLOR MIX(2) 204/255,0,152/255
SET COLOR MIX(3) 1,1,1
SET COLOR MIX(4) 0,1,0
SET COLOR MIX(5) 0,1,1
SET COLOR MIX(6) 160/255,215/255,51/255
SET COLOR MIX(7) 79/255,187/255,129/255
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
 

戻る