1504121035



スロットマシンを改造したルーレット


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 CHARACTER INPUT NOWAIT: s$

   IF s$ = "s" THEN GOTO 100

   GOTO 50

    

100 RANDOMIZE

    LET  om=INT(RND*18)*20

    FOR i=0 TO 720+om STEP 20

       CLEAR

       LET  t=i*i/10000

       LET  a=INT(RND*10)

       LET  p=a

       GOSUB 1000

       LET  a$=p$

       LET  b=INT(RND*10)

       LET  p=b

       GOSUB 1000

       LET  b$=p$

       LET  c=INT(RND*10)

       LET  p=c

       GOSUB 1000

       LET  c$=p$

       LET  d=INT(RND*10)

       LET  p=d

       GOSUB 1000

       LET  d$=p$

       LET  e=INT(RND*10)

       LET  p=e

       GOSUB 1000

       LET  e$=p$

       LET  f=INT(RND*10)

       LET  p=f

       GOSUB 1000

       LET  f$=p$

       LET  g=INT(RND*10)

       LET  p=g

       GOSUB 1000

       LET  g$=p$

       LET  h=INT(RND*10)

       LET  p=h

       GOSUB 1000

       LET  h$=p$

       LET  j=INT(RND*10)

       LET  p=j

       GOSUB 1000

       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

     

    IF a$=b$ AND b$=c$ THEN 

       PLOT TEXT ,AT 70,220 : "JACK POT !!!"

       LET  gain=10

       PLOT TEXT ,AT 70,250,USING "##":gain

       GOTO 500

    END IF

    IF d$=e$ AND e$=f$ THEN 

       PLOT TEXT ,AT 70,220 : "JACK POT !!!"

       LET  gain=20

       PLOT TEXT ,AT 70,250,USING "##":gain

       GOTO 500

    END IF

    IF g$=h$ AND h$=j$ THEN 

       PLOT TEXT ,AT 70,220 : "JACK POT !!!"

       LET  gain=30

       PLOT TEXT ,AT 70,250,USING "##":gain

       GOTO 500

    END IF

    IF a$=d$ AND d$=g$ THEN 

       PLOT TEXT ,AT 70,220 : "JACK POT !!!"

       LET  gain=40

       PLOT TEXT ,AT 70,250,USING "##":gain

       GOTO 500

    END IF

    IF b$=e$ AND e$=h$ THEN 

       PLOT TEXT ,AT 70,220 : "JACK POT !!!"

       LET  gain=50

       PLOT TEXT ,AT 70,250,USING "##":gain

       GOTO 500

    END IF

    IF c$=f$ AND f$=j$ THEN 

       PLOT TEXT ,AT 70,220 : "JACK POT !!!"

       LET  gain=60

       PLOT TEXT ,AT 70,250,USING "##":gain

       GOTO 500

    END IF

    IF a$=e$ AND e$=j$ THEN 

       PLOT TEXT ,AT 70,220 : "JACK POT !!!"

       LET  gain=70

       PLOT TEXT ,AT 70,250,USING "##":gain

       GOTO 500

    END IF

    IF c$=e$ AND e$=g$ THEN 

       PLOT TEXT ,AT 70,220 : "JACK POT !!!"

       LET  gain=80

       PLOT TEXT ,AT 70,250,USING "##":gain

       GOTO 500

    END IF

    LET  gain=-10

    500 LET  total=total+gain

        PLOT TEXT ,AT 70,280,USING "TOTAL=###":total

        IF total=0 THEN GOTO 2000 

        GOTO 10

        STOP

         

        1000 IF p=1 THEN LET  p$="○"

        1010 IF p=2 THEN LET  p$="×"

        1020 IF p=3 THEN LET  p$="△"

        1030 IF p=4 THEN LET  p$="◎"

        1040 IF p=5 THEN LET  p$="▽"

        1050 IF p=6 THEN LET  p$="◇"

        1060 IF p=7 THEN LET  p$="□"

        1070 IF p=8 THEN LET  p$="●"

        1080 IF p=9 THEN LET  p$="■"

1090 RETURN

      

      

   2000 END

1499371292

空間の中のボール


5 SET WINDOW 0,300,0,300

  clear

10 PRINT "input x:0-300"

   INPUT x

   

20 PRINT "input y:0-300"

   INPUT y

   

30 LET o=x-20

   LET p=y-20

   LET q=x+20

   LET r=y+20

   

40 LET a=30

   LET b=30

   LET i=1

   LET j=1

   

50 CLEAR

   

   SET COLOR 1

   DRAW disk WITH SCALE(3)*SHIFT(x,y)

   

   PLOT LINES: 10,10 ; 290,10

   PLOT LINES: 10,290 ; 290,290

   PLOT LINES: 10,10 ; 10,290

   PLOT LINES: 290,10 ; 290,290

   PLOT LINES: 90,80 ; 180,80

   PLOT LINES: 90,170 ; 180,170

   PLOT LINES: 90,80 ; 90,170

   PLOT LINES: 180,80 ; 180,170

   

   PLOT LINES: 10,10 ; 90,80

   PLOT LINES: 10,290 ; 90,170

   PLOT LINES: 290,290 ; 180,170

   PLOT LINES: 290,10 ; 180,80   

   

70 LET a=a+i

   LET b=b+j

   

85 SET AREA COLOR 4

   

   DRAW disk WITH SCALE(10+i+j)*SHIFT(a,b)

   

   

86 FOR k=1 TO 30000

   

87 NEXT k

   

   

95 IF a>o THEN GOTO 100 ELSE GOTO 130

   

100 IF a<q THEN GOTO 110 ELSE GOTO 130

    

110 IF b>p THEN GOTO 120 ELSE GOTO 130

    

120 IF b<r THEN GOTO 200 ELSE GOTO 130

    

130 IF a<50 THEN GOTO 300

140 IF b<50 THEN GOTO 300

150 IF a>250 THEN GOTO 330

160 IF b>250 THEN GOTO 330

    

170 GOTO 50

    

200 RANDOMIZE

    LET n=INT(4*RND)

    

210 IF n=0 THEN 300

220 IF n=1 THEN 310

230 IF n=2 THEN 320

240 IF n=3 THEN 330

    

300 LET i=INT(4*RND)

    RANDOMIZE

    LET j=INT(4*RND)

    GOTO 50

    

310 LET i=INT(-4*RND)

    RANDOMIZE

    LET j=INT(4*RND)

    GOTO 50

    

320 LET i=INT(4*RND)

    RANDOMIZE

    LET j=INT(-4*RND)

    GOTO 50

    

330 LET i=INT(-4*RND)

    RANDOMIZE

    LET j=INT(-4*RND)

    GOTO 50

    

500 GOTO 50

    

    END

1482165978

BASICと書く。


10 SET WINDOW 0,500,500,0
            DATA 50,100,0,1
    DATA 55,100,1,0.5
   DATA 90,125,-1,0.5
   DATA 55,150,1,0.5
   DATA 90,175,-1,0.5
       DATA 120,190,0.25,-1
   DATA 145,100,0.25,1
   DATA 130,160,1,0.25
       DATA 240,105,-1,0.5
   DATA 205,120,0.5,1
   DATA 240,180,-1,0.5
       DATA 280,100,0,1
        DATA 330,100,0,1
    DATA 335,100,1,0.5
   DATA 365,175,-1,0.5
        50 READ IF MISSING THEN 2000 : m,n,p,q
    110 LET x=x+p
    LET y=y+q
         SET COLOR "black"
        DRAW circle WITH SCALE(2)*SHIFT(m+x,n+y)
         SET COLOR "white"
           DRAW disk WITH SCALE(1.9)*SHIFT(m+(x-1),n+y-1)
          200 IF x>30 THEN GOTO 1000
220 IF y>90 THEN GOTO 1000
230 IF x<-30 THEN GOTO 1000
240 IF y<-90 THEN GOTO 1000
260 IF x=0 THEN GOTO 280
280 IF y=0 THEN GOTO 1000
       300 FOR ti=0 TO 100000
    NEXT ti
         GOTO 110
     1000 LET x=0
     LET y=0
           GOTO 50
      2000 END         

1480187736


枠線だけで文字を書く

(直系の小さな白円盤で黒円盤の内部を塗りつぶす)

10 SET WINDOW 0,300,300,0     
20 FOR ti=0 TO 10000000
   NEXT ti       
CLEAR       
LET m=20   
LET n=125       
FOR a=0 TO 5.1*PI          
CLEAR             
LET x=10*(SIN (a))      
LET y=10*(COS (a))                  
SET COLOR "black"      
DRAW disk WITH SCALE(10)*SHIFT(m+x,n+y)      
SET COLOR "white"             
DRAW disk WITH SCALE(9)*SHIFT(m+x,n+y)            
 FOR ti=0 TO 1000000      
NEXT ti          
NEXT a        
100 LET x=0    
LET y=0    
LET m=20    
LET n=120     
110 LET x=x+1    
LET y=y+1        
 SET COLOR "black"     
150 DRAW disk WITH SCALE(10)*SHIFT(m+x/2,n+y)         
SET COLOR "white"           
DRAW disk WITH SCALE(9)*SHIFT(m+(x-1)/2,n+y-1)     
200 IF x>100 THEN GOTO 400     
300 FOR ti=0 TO 100000    
NEXT ti         
GOTO 110     
400 LET x=0    
LET y=0    
LET m=70    
LET n=220     
420 LET x=x+1    
LET y=y-1         
SET COLOR "black"         
DRAW disk WITH SCALE(10)*SHIFT(m+x/2,n+y)         
SET COLOR "white"           
DRAW disk WITH SCALE(9)*SHIFT(m+(x-1)/2,n+y+1)         
IF x>100 THEN GOTO 500         
FOR ti=0 TO 100000    
NEXT ti         
GOTO 420          
500 LET x=0    
LET y=0    
LET m=120    
LET n=120     
520 LET x=x+1    
LET y=y+1         
SET COLOR "black"         
DRAW disk WITH SCALE(10)*SHIFT(m+x/2,n+y)         
SET COLOR "white"           
DRAW disk WITH SCALE(9)*SHIFT(m+(x-1)/2,n+y-1)              
IF x>100 THEN GOTO 600         
FOR ti=0 TO 100000    
NEXT ti         
GOTO 520     
600 LET x=0    
LET y=0    
LET m=170    
LET n=220     
620 LET x=x+1    
LET y=y-1         
SET COLOR "black"         
DRAW disk WITH SCALE(10)*SHIFT(m+x/2,n+y)         
SET COLOR "white"           
DRAW disk WITH SCALE(9)*SHIFT(m+(x-1)/2,n+y+1)              
IF x>100 THEN GOTO 20         
FOR ti=0 TO 100000    
NEXT ti         
GOTO 620          
1000 END

1479743801



データ文によって複数の文字を書く


10 SET WINDOW 0,300,300,0 

    

   DATA 12,12.0,0.05,.1,17,22.0,0.05,-.1,22,12.0,0.05,.1,27,22,0.05,-.1

    

   DATA 39,12,0,.1 

    

   DATA 48,22,0,-0.1,51,12,0.05,0.1,59,22,0,-0.1,59,12,0,0

    

50 READ IF MISSING THEN 2000 : m,n,p,q

    

    

   FOR a=0 TO 5.1*PI

    

      LET xs=1.5*(SIN (a))

      LET ys=1.5*(COS (a))     

       

      DRAW disk WITH SCALE(0.2)*SHIFT(m+xs,n+ys)

       

      FOR ti=0 TO 500000

      NEXT ti

       

   NEXT a

    

110 LET x=x+p

    LET y=y+q

          

150 DRAW disk WITH SCALE(2)*SHIFT(m+x,n+y)

     

200 IF x>5 THEN GOTO 1000

220 IF y>10 THEN GOTO 1000

240 IF y<-10 THEN GOTO 1000

260 IF x=0 THEN GOTO 280

280 IF y=0 THEN GOTO 1000  

     

300 FOR ti=0 TO 10000

    NEXT ti

     

    GOTO 110

     

1000 LET x=0

     LET y=0

      

     GOTO 50

      

2000 END

1479661128


丸が動いて文字を書く


10 SET WINDOW 0,300,300,0     
20 FOR ti=0 TO 10000000
   NEXT ti 
      CLEAR
       LET m=20 
  LET n=125
       FOR a=0 TO 5.1*PI
          clear
             LET x=10*(SIN (a))
      LET y=10*(COS (a))
                  DRAW disk WITH SCALE(10)*SHIFT(m+x,n+y)
             FOR ti=0 TO 1000000
      NEXT ti
          NEXT a
100 LET x=0
    LET y=0
    LET m=20
    LET n=120     
110 LET x=x+1
    LET y=y+1
150 DRAW disk WITH SCALE(10)*SHIFT(m+x/2,n+y)     
200 IF x>100 THEN GOTO 400     
300 FOR ti=0 TO 100000
    NEXT ti 
        GOTO 110     
400 LET x=0
    LET y=0
    LET m=70
    LET n=220     
420 LET x=x+1
    LET y=y-1
         DRAW disk WITH SCALE(10)*SHIFT(m+x/2,n+y)
         IF x>100 THEN GOTO 500
         FOR ti=0 TO 100000
    NEXT ti         
GOTO 420          
500 LET x=0
    LET y=0
    LET m=120
    LET n=120     
520 LET x=x+1
    LET y=y+1 
        DRAW disk WITH SCALE(10)*SHIFT(m+x/2,n+y)
         IF x>100 THEN GOTO 600
         FOR ti=0 TO 100000
    NEXT ti
         GOTO 520     
600 LET x=0
    LET y=0
    LET m=170
    LET n=220     
620 LET x=x+1
    LET y=y-1
         DRAW disk WITH SCALE(10)*SHIFT(m+x/2,n+y)
         IF x>100 THEN GOTO 20
         FOR ti=0 TO 100000
    NEXT ti
         GOTO 620

          1000 END

1476354867


らせん正多角形


40行の2.5を変えると多角形が変化する


10 DEF g(t)=SIN(t)

20 SET WINDOW -8,8,-8,8

30 DRAW axes

40 FOR t=0 TO 40*PI STEP PI/2.5

50 PLOT LINES: f(t)*t/20,g(t)*t/20;

60FOR TI=0 TO 10000

NEXT TI

80 NEXT t

90 END

1474489428


テトリスのようなゲーム→球をきれいに並べて積み重ねる


CLEAR

OPTION BASE 1

SET WINDOW  0 , 300 , 0 ,300

20 DIM a(6),b(6)

FOR n=1 TO 6

LET b(n)=400

NEXT n

LET j=-1

LET h=h+40

FOR m=1 TO 6

LET a(m)=150

LET b(m)=300

60 CLEAR

CHARACTER INPUT NOWAIT: a$

IF a$ = "j" THEN LET a(m) = a(m)-1

IF a$ = "k" THEN LET a(m) = a(m)

IF a$ = "l" THEN LET a(m) = a(m)+1

70 LET b(m)=b(m)+j

85 SET AREA COLOR 1

DRAW disk WITH SCALE(20)*SHIFT(a(1),b(1))

SET AREA COLOR 2

DRAW disk WITH SCALE(20)*SHIFT(a(2),b(2))

SET AREA COLOR 3

DRAW disk WITH SCALE(20)*SHIFT(a(3),b(3))

SET AREA COLOR 4

DRAW disk WITH SCALE(20)*SHIFT(a(4),b(4))

SET AREA COLOR 5

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

SET AREA COLOR 7

DRAW disk WITH SCALE(20)*SHIFT(a(6),b(6))

86 FOR k=1 TO 150000

87 NEXT k

140 IF b(m)<h THEN GOTO 330

270 GOTO 60

330 LET b(m)=h

RANDOMIZE

LET j=INT(-3*RND)

500 NEXT m

600 LET sum=a(1)+a(2)+a(3)+a(4)+a(5)+a(6)-720

IF sum>=-10 AND sum<=60 THEN GOTO 20

1000 END


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