動いてる?

 投稿者:しばっち  投稿日:2013年12月15日(日)18時52分39秒
  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
 

動いてる?

 投稿者:しばっち  投稿日:2013年12月15日(日)18時53分12秒
  LET XSIZE=600
LET YSIZE=600
CALL GINIT(XSIZE,YSIZE)
CALL TILE(0,0,XSIZE-1,YSIZE-1,0,7,10)
CALL CIRCLEFULL(XSIZE/2,YSIZE/2,150,0,7,10)
END

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) 1,0,0
SET COLOR MIX(3) 1,0,1
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 CIRCLEFULL(X0,Y0,R,C1,C2,SIZE)
FOR Y=-R+Y0 TO R+Y0
   FOR X=-R+X0 TO R+X0
      IF(X-X0)*(X-X0)+(Y0-Y)*(Y0-Y)<=R*R THEN
         LET I=INT(X/SIZE)
         LET J=INT(Y/SIZE/4)
         IF MOD(I+J,2)=0 THEN LET C=C1 ELSE LET C=C2
         CALL PSET(X,Y,C)
      END IF
   NEXT X
NEXT Y
END SUB

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/4)
      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
 

戻る