歪んでる?

 投稿者:しばっち  投稿日:2013年12月15日(日)18時49分50秒
  CALL GINIT(550,550)
CALL TILE(0,0,550,550,7,0,50)
LET A=2
FOR Y=50 TO 500 STEP 50
   IF Y=300 THEN LET A=3-A
   FOR X=50 TO 500 STEP 50
      CALL DIA(X,Y,14,14,A)
      LET A=3-A
      IF X=250 THEN LET A=3-A
   NEXT X
NEXT Y
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) 1,1,1
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) 0,0,0
CLEAR
END SUB

EXTERNAL SUB PSET(X,Y,C)
SET POINT COLOR C
PLOT POINTS:X,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)
      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 DIA(X,Y,M,N,P)
SET AREA COLOR 0
PLOT AREA:X-M,Y;X,Y-N;X+M,Y;X,Y+M
SET AREA COLOR 7
SELECT CASE P
CASE 1
   PLOT AREA:X-M,Y;X-M/2,Y-N/2;X,Y;X-M/2,Y+N/2
   PLOT AREA:X,Y;X+M/2,Y-N/2;X+M,Y;X+M/2,Y+N/2
CASE 2
   PLOT AREA:X,Y;X-M/2,Y-N/2;X,Y-N;X+M/2,Y-N/2
   PLOT AREA:X,Y;X+M/2,Y+N/2;X,Y+N;X-M/2,Y+N/2
END SELECT
END SUB
 

歪んでる?

 投稿者:しばっち  投稿日:2013年12月15日(日)18時50分17秒
  CALL GINIT(650,650)
CALL TILE(0,0,649,649,4,7,50)
FOR Y=50 TO 600 STEP 50
   FOR X=50 TO 600 STEP 50
      READ A
      CALL DIA(X,Y,14,14,A)
   NEXT X
NEXT Y
DATA 1,2,1,2,2,1,2,1,1,2,1,2
DATA 1,1,2,1,2,2,1,2,1,1,2,1
DATA 2,1,1,2,1,2,2,1,2,1,1,2
DATA 1,2,1,1,2,1,2,2,1,2,1,1
DATA 2,1,2,1,1,2,1,2,2,1,2,1
DATA 2,2,1,2,1,1,2,1,2,2,1,2
DATA 1,2,2,1,2,1,1,2,1,2,2,1
DATA 2,1,2,2,1,2,1,1,2,1,2,2
DATA 1,2,1,2,2,1,2,1,1,2,1,2
DATA 1,1,2,1,2,2,1,2,1,1,2,1
DATA 2,1,1,2,1,2,2,1,2,1,1,2
DATA 1,2,1,1,2,1,2,2,1,2,1,1
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) 1,0,0
SET COLOR MIX(3) 1,0,1
SET COLOR MIX(4) 11/255,125/255,62/255
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,M,N,P)
SET AREA COLOR 0
PLOT AREA:X-M,Y;X,Y-N;X+M,Y;X,Y+M
SET AREA COLOR 7
SELECT CASE P
CASE 1
   PLOT AREA:X-M,Y;X-M/2,Y-N/2;X,Y;X-M/2,Y+N/2
   PLOT AREA:X,Y;X+M/2,Y-N/2;X+M,Y;X+M/2,Y+N/2
CASE 2
   PLOT AREA:X,Y;X-M/2,Y-N/2;X,Y-N;X+M/2,Y-N/2
   PLOT AREA:X,Y;X+M/2,Y+N/2;X,Y+N;X-M/2,Y+N/2
END SELECT
END SUB
 

戻る