1507241514


外部絵定義を使って同じ絵を何度も描く


10 DECLARE EXTERNAL PICTURE tri

20 OPTION ANGLE DEGREES

30 SET WINDOW 0,300,300,0

40 DRAW tri(3)

50 DRAW tri(3) WITH SCALE(1.2,1.2)*SHIFT(50,0)

55 DRAW tri(3) WITH SCALE(0.8,0.8)*SHIFT(-50,0)

60 END

100 EXTERNAL PICTURE tri(n)

130 PLOT LINES:100,100;150,100;200,200;100,100

150 END PICTURE

1505586919


だんご串刺しゲーム



5 SET WINDOW 0,300,300,0

  

50 LET a=30

   LET b=0

   LET i=5

   

   LET c=130

   LET d=0

   LET m=4

   

   LET e=230

   LET f=0

   LET k=7

   

   LET c1=1

   LET c2=1

   LET c3=1

   LET c4=0

   LET c5=0

   LET c6=0

   

60 FOR ti=1 TO 10000

   NEXT ti

   

   SET AREA COLOR 0

   PLOT AREA : 0,0;300,0;300,300;0,300;0,0

   

70 LET b=b+i

   

   LET d=d+m

   

   LET f=f+k

   

80 SET AREA COLOR c1

   

   DRAW disk WITH SCALE(5)*SHIFT(b,a)

   

   SET AREA COLOR c2

   

   DRAW disk WITH SCALE(8)*SHIFT(d,c)

   

   SET AREA COLOR c3

   

   DRAW disk WITH SCALE(10)*SHIFT(f,e)

   

90 CHARACTER INPUT NOWAIT: a$

   IF a$ = "i" THEN LET  y = y-2

   IF a$ = "j" THEN LET  x = x-2

   IF a$ = "l" THEN LET  x = x+2

   IF a$ = "m" THEN LET  y = y+2

   

   SET COLOR c4

   DRAW disk WITH SCALE(5)*SHIFT(150+x,150+y)

   SET COLOR c5

   DRAW disk WITH SCALE(8)*SHIFT(150+x,170+y)

   SET COLOR c6

   DRAW disk WITH SCALE(10)*SHIFT(150+x,200+y)

     

   SET LINE COLOR 4

   SET LINE WIDTH 10

   PLOT LINES : 150+x,150+y;150+x,250+y

   

   FOR ti=1 TO 100000

   NEXT ti

   

   IF 150+x=b THEN GOTO 100

   IF 150+x=d THEN GOTO 110

   IF 150+x=f THEN GOTO 120

   

   GOTO 160

   

100 IF 150+y=a THEN GOTO 130

110 IF 150+y=c THEN GOTO 140

120 IF 150+y=e THEN GOTO 150

    

    GOTO 160   

    

130 LET c1=0

    LET  c4=1

    GOTO 160

    

140 LET c2=0

    LET c5=1 

    GOTO 160

    

150 LET c3=0

    LET c6=1    

    GOTO 160

    

 160 IF b>300 THEN GOTO 300

     

     IF d>300 THEN GOTO 400

     

     IF f>300 THEN GOTO 500

     

270 GOTO 60

     

300 RANDOMIZE

    

    LET i=1+INT(4*RND)

    

    LET b=0

    LET a=INT(100*RND)

    

    GOTO 80

 

400 RANDOMIZE

    

    LET m=1+INT(4*RND)

    

    LET d=0

    LET c=INT(200*RND)

    

    GOTO 80

    

500 RANDOMIZE

    

    LET k=1+INT(4*RND)

    LET f=0

    LET e=INT(280*RND)

    

    GOTO 80

      

600 GOTO 60

    

    END

     

1505583554

ルーレットおみくじ



OPTION ANGLE DEGREES

5 LET  total=100

10 SET WINDOW  0,300,300,0

   LET  t=0

   SET TEXT FONT "MS 明朝",30

   PRINT "sキーを押して下さい。"

50 REM CHARACTER INPUT NOWAIT,ELAPSED n: s$

   

   CHARACTER INPUT CLEAR,ELAPSED n: s$

   

   IF s$ = "s" THEN GOTO 100

   GOTO 50

   

100 RANDOMIZE

    LET  om=INT(RND*18+1)*20*n

    FOR i=0 TO 720+om STEP 20

    

       CLEAR

       

       LET  t=i*i/10000

       LET  a=INT(RND*10)

       LET  p=a

       

       LET  a$=p$

       LET  b=INT(RND*10)

       LET  p=b

        

       LET  b$=p$

       LET  c=INT(RND*10)

       LET  p=c

       

       LET  c$=p$

       LET  d=INT(RND*10)

       LET  p=d

       

       LET  d$=p$

       LET  e=INT(RND*10)

       LET  p=e

       

       LET  e$=p$

       LET  f=INT(RND*10)

       LET  p=f

       

       LET  f$=p$

       LET  g=INT(RND*10)

       LET  p=g

       

       LET  g$=p$

       LET  h=INT(RND*10)

       LET  p=h

       

       LET  h$=p$

       LET  j=INT(RND*10)

       LET  p=j

        

       LET  j$=p$

       REM       PLOT TEXT ,AT 100,110,USING "## ## ##" : a$,b$,c$

       REM       PLOT TEXT ,AT 100,140,USING "## ## ##" : d$,e$,f$

       REM       PLOT TEXT ,AT 100,170,USING "## ## ##" : g$,h$,i$

       

       DRAW circle WITH SCALE(100)*SHIFT(150,150)

       DRAW circle WITH SCALE(80)*SHIFT(150,150)

       DRAW disk WITH SCALE(5)*SHIFT(90*COS(i)+150,90*SIN(i)+150)

       

       DRAW circle WITH SCALE(5)*SHIFT(90*COS(20)+150,90*SIN(20)+150)

       DRAW circle WITH SCALE(5)*SHIFT(90*COS(40)+150,90*SIN(40)+150)

       DRAW circle WITH SCALE(5)*SHIFT(90*COS(60)+150,90*SIN(60)+150)

       DRAW circle WITH SCALE(5)*SHIFT(90*COS(80)+150,90*SIN(80)+150)

       DRAW circle WITH SCALE(5)*SHIFT(90*COS(100)+150,90*SIN(100)+150)

       DRAW circle WITH SCALE(5)*SHIFT(90*COS(120)+150,90*SIN(120)+150)

       DRAW circle WITH SCALE(5)*SHIFT(90*COS(140)+150,90*SIN(140)+150)

       DRAW circle WITH SCALE(5)*SHIFT(90*COS(160)+150,90*SIN(160)+150)

       DRAW circle WITH SCALE(5)*SHIFT(90*COS(180)+150,90*SIN(180)+150)

       DRAW circle WITH SCALE(5)*SHIFT(90*COS(200)+150,90*SIN(200)+150)

       DRAW circle WITH SCALE(5)*SHIFT(90*COS(220)+150,90*SIN(220)+150)

       DRAW circle WITH SCALE(5)*SHIFT(90*COS(240)+150,90*SIN(240)+150)

       DRAW circle WITH SCALE(5)*SHIFT(90*COS(260)+150,90*SIN(260)+150)

       DRAW circle WITH SCALE(5)*SHIFT(90*COS(280)+150,90*SIN(280)+150)

       DRAW circle WITH SCALE(5)*SHIFT(90*COS(300)+150,90*SIN(300)+150)

       DRAW circle WITH SCALE(5)*SHIFT(90*COS(320)+150,90*SIN(320)+150)

       DRAW circle WITH SCALE(5)*SHIFT(90*COS(340)+150,90*SIN(340)+150)

       DRAW circle WITH SCALE(5)*SHIFT(90*COS(360)+150,90*SIN(360)+150)

       

       WAIT DELAY t/800

       

    NEXT i

    

    500 SET TEXT HEIGHT 20

        

        IF COS(i)= COS(20) THEN PLOT TEXT ,AT 150,150 : "大 吉"

        IF COS(i)= COS(40) THEN PLOT TEXT ,AT 150,150 : "大 吉"

        IF COS(i)= COS(60) THEN PLOT TEXT ,AT 150,150 : "大 吉"

        IF COS(i)= COS(80) THEN PLOT TEXT ,AT 150,150 : "大 吉"

        IF COS(i)= COS(100) THEN PLOT TEXT ,AT 150,150 : "大 吉"

        IF COS(i)= COS(120) THEN PLOT TEXT ,AT 150,150 : "大 吉"

        IF COS(i)= COS(140) THEN PLOT TEXT ,AT 150,150 : "大 吉"

        IF COS(i)= COS(160) THEN PLOT TEXT ,AT 150,150 : "大 吉"

        IF COS(i)= COS(180) THEN PLOT TEXT ,AT 150,150 : "大 吉"

        IF COS(i)= COS(200) THEN PLOT TEXT ,AT 150,150 : "大 吉"

        IF COS(i)= COS(220) THEN PLOT TEXT ,AT 150,150 : "大 吉"

        IF COS(i)= COS(240) THEN PLOT TEXT ,AT 150,150 : "大 吉"

        IF COS(i)= COS(260) THEN PLOT TEXT ,AT 150,150 : "大 吉"

        IF COS(i)= COS(280) THEN PLOT TEXT ,AT 150,150 : "大 吉"

        IF COS(i)= COS(300) THEN PLOT TEXT ,AT 150,150 : "大 吉"

        IF COS(i)= COS(320) THEN PLOT TEXT ,AT 150,150 : "大 吉"

        IF COS(i)= COS(340) THEN PLOT TEXT ,AT 150,150 : "大 吉"

        IF COS(i)= COS(360) THEN PLOT TEXT ,AT 150,150 : "大 吉"

        

        

        GOTO 10

        STOP

                 

   2000 END

1505579011

波紋が一部欠けてしまうバグについて。


SET LINE COLOR 0 の次の

plot lines を   PLOT POINTS に書き換える。


1504805379


コピー生成プログラム

 

10 SET WINDOW  0,300,300,0

20 LET  i=0

   LET a$=""

   LET b$=""

   

   

30 CLEAR

  

   SET TEXT FONT "MS 明朝",20

   

   PLOT TEXT ,AT 50,50 : "どの商品を宣伝する?"

   PLOT TEXT ,AT 50,100 : "1 ポカリ"

   PLOT TEXT ,AT 50,150 : "2 コーラ"

   PLOT TEXT ,AT 50,200 : "3 マヨネーズ"

   PLOT TEXT ,AT 50,250 : "4 カロリーメイト"

   

   

50 CHARACTER INPUT NOWAIT: s$

   IF s$ = "1" THEN GOTO 100

   IF s$ = "2" THEN GOTO 100

   IF s$ = "3" THEN GOTO 100

   IF s$ = "4" THEN GOTO 100

   

   GOTO 50

   

100 CLEAR

    

    RANDOMIZE 

    

    LET  i=INT(4*RND+1)

    IF i=1 THEN GOTO 120

    IF i=2 THEN GOTO 130

    IF i=3 THEN GOTO 140

    IF i=4 THEN GOTO 150

    

120 LET a$="天国"

    LET b$="地獄"

    GOTO 200

    

130 LET a$="左"

    LET b$="右"

    GOTO 200

    

140 LET a$="夜"

    LET b$="昼"

    GOTO 200

    

150 LET a$="空"

    LET b$="海"

    GOTO 200

    

200 SET TEXT FONT "MS 明朝",30

    

    PLOT TEXT ,AT 50,150 : aINSERT:CONTENT:ENDamp;"と"&b$

    

    

250 CHARACTER INPUT NOWAIT: s$

    PLOT TEXT ,AT 50,250 : "nを押して下さい。"

    

    IF s$ = "n" THEN GOTO 300   

    GOTO 250

    

300 GOTO 30

    

    END




線や図形を重ねて描く


 

5 SET WINDOW 0,300,300,0

  

20 LET x=0

   LET y=0

   LET x1=0

   LET y1=0

   

30 FOR i=1 TO 60

   

40    LET  x=INT(300*RND)

      LET  y=INT(300*RND)

      

      RANDOMIZE

      LET  x1=INT(150+150*RND)

      LET  y1=INT(150+150*RND)

      

      RANDOMIZE

      LET cl=INT(20*RND)

      

50    SET LINE COLOR cl

      SET LINE WIDTH 5

      

      PLOT LINES :x,y; x1,y1

      

      FOR k=1 TO 800000

      NEXT k

      

   NEXT i

   

   END

1504802741

ワープ


 

OPTION ANGLE DEGREES

 

5 SET WINDOW 0,300,300,0

  SET POINT STYLE 1

  

20 LET a=0

   LET b=0

   LET c=0

   LET d=0

   

30 SET AREA COLOR 1

   PLOT AREA:0,0;300,0;300,300;0,300;0,0

   

40 LET  x=INT(10*RND)

   LET  y=INT(10*RND)

   LET z=INT(10*RND)

   

   RANDOMIZE

   LET  xa=INT(10*RND)

   LET  ya=INT(10*RND)

   LET za=INT(10*RND)

   

 50 FOR i=1 TO 150

    

 70    LET a=150+z*i

       LET b=150+i

       

       LET c=150+za*i

       LET d=150+i

       

       LET e=150-z*i

       LET f=150+i

       

       LET g=150-za*i

       LET h=150+i

       

       SET COLOR 0 

       

80    PLOT POINTS:a,b

      PLOT POINTS:c,d

      

      PLOT POINTS:e,f

      PLOT POINTS:g,h

      

90    FOR k=1 TO 8000

      

100    NEXT k

       

       REM 150    IF b>150 THEN GOTO 500

          

    NEXT i

    

500 GOTO 20

    

    END

1504800806

ひまわり


OPTION ANGLE DEGREES

10 SET WINDOW  0,300,300,0

20 LET  t=1

   LET  i=0

   

100 RANDOMIZE 

    

    LET  i=INT(17*RND+1)

    LET  t=INT(30*RND+1)

    

120 FOR m=1 TO t

       clear

       LET  i=i+i

       

       DRAW circle WITH SCALE(60)*SHIFT(150,150)

       

       DRAW circle WITH SCALE(30)*SHIFT(90*COS(20+i)+150,90*SIN(20+i)+150)

       DRAW circle WITH SCALE(30)*SHIFT(90*COS(60+i)+150,90*SIN(60+i)+150)

       DRAW circle WITH SCALE(30)*SHIFT(90*COS(100+i)+150,90*SIN(100+i)+150)

       DRAW circle WITH SCALE(30)*SHIFT(90*COS(140+i)+150,90*SIN(140+i)+150)

       DRAW circle WITH SCALE(30)*SHIFT(90*COS(180+i)+150,90*SIN(180+i)+150)

       DRAW circle WITH SCALE(30)*SHIFT(90*COS(220+i)+150,90*SIN(220+i)+150)

       DRAW circle WITH SCALE(30)*SHIFT(90*COS(260+i)+150,90*SIN(260+i)+150)

       DRAW circle WITH SCALE(30)*SHIFT(90*COS(300+i)+150,90*SIN(300+i)+150)

       DRAW circle WITH SCALE(30)*SHIFT(90*COS(340+i)+150,90*SIN(340+i)+150)

       

       FOR ti=0 TO 1000000

       

       NEXT ti

       

    NEXT m

    

    200 SET TEXT FONT "MS 明朝",30

        PRINT "sキーを押して下さい。"

    250 CHARACTER INPUT NOWAIT: s$

        IF s$ = "s" THEN GOTO 300

        GOTO 250

        

    300 GOTO 100

        

        END

1504797053

雨がふりしきる


 

OPTION ANGLE DEGREES

 

5 SET WINDOW 0,300,300,0

  SET POINT STYLE 1

  

20 LET a=0

   LET b=0

30 SET AREA COLOR 1

   PLOT AREA:0,0;300,0;300,300;0,300;0,0

   

   

40 LET  x=INT(300*RND)

   LET  y=INT(20*RND)

   LET z=INT(10*RND)/20

   

   RANDOMIZE

   LET  xa=INT(300*RND)

   LET  ya=INT(20*RND)

   LET za=INT(10*RND)/20

   

 50 FOR i=1 TO 300 

    

 70    LET a=x-z*i

       LET b=y+i

       

       LET c=xa-za*i

       LET d=ya+i*0.9

       

       SET COLOR 0 

       

80    PLOT POINTS:a,b

      PLOT POINTS:c,d

      

90    FOR k=1 TO 8000

100    NEXT k

       

150    IF b>250 THEN GOTO 200

       

    NEXT i

    

200 FOR n=20 TO 160 STEP 20

    

       FOR h=0 TO 360

       

          LET x1=a+SIN(h)*n

          LET y1=b+COS(h)/3*n

           

          LET x2=c+SIN(h)*n

          LET y2=d+COS(h)/3*n-10

          

          SET LINE COLOR 0

          PLOT LINES: x1,y1   

          PLOT LINES: x2,y2   

          

       NEXT h

       

220 NEXT n

    

    FOR k=1 TO 100000

    NEXT k

    

500 GOTO 20

     

- 1 - - 2 - - 3 - - 4 - - 5 - - 6 -