2つの円は同じ色? or 違う色?

 投稿者:しばっち  投稿日:2013年12月15日(日)18時59分21秒
  CALL GINIT(600,600)
LET C1=4
LET C2=6
CALL DISPLAY(C1,C2,5)
PAUSE
CALL DISPLAY(C1,C2,60)
END

EXTERNAL  SUB DISPLAY(C1,C2,SIZE)
FOR X=0 TO 600 STEP SIZE
   CALL BOXFULL(X,0,X+SIZE/2,600,C1)
   CALL BOXFULL(X+SIZE/2,0,X+SIZE,600,C2)
NEXT X
CALL CIRCLEFULL(150,300,130,C1,7,SIZE/2)
CALL CIRCLEFULL(450,300,130,7,C2,SIZE/2)
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) 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) .5,.5,.5
CLEAR
END SUB

EXTERNAL SUB BOXFULL(X1,Y1,X2,Y2,C)
SET COLOR C
PLOT AREA:X1,Y1;X2,Y1;X2,Y2;X1,Y2;X1,Y1
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)
         IF MOD(I,2)=0 THEN LET C=C1 ELSE LET C=C2
         CALL PSET(X,Y,C)
      END IF
   NEXT X
NEXT Y
END SUB
 

戻る