1585043198


1573156605

月齢


DECLARE EXTERNAL PICTURE moon

OPTION ANGLE DEGREES

LET m=0

 

20 SET WINDOW 0,300,0,300

    

   DATA 0,5,10,15,25,40,80,1000,1900,1920,1930,1960,1980,1990,2000,2000,2010,2020,2030,2040,2070,3000,-80,-40,-25,-15,-10,-5,0

    

   READ c

    

   LET m=m+1

   IF m= 29 THEN goto 400

    

   FOR ti=1 TO 1000000

   NEXT ti

    

   SET AREA COLOR 1

    

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

    

   IF c>1000 THEN GO TO 100

    

   IF c>2000 THEN GO TO 200

    

   IF c<0 THEN GO TO 300

    

   GOTO 80

    

80 DRAW moon(c)WITH ROTATE(0)*SCALE(1)*SHIFT(0,0)

    

   GOTO 20

    

100 LET c=c-1000

     

    DRAW moon2(c)WITH ROTATE(0)*SCALE(1)*SHIFT(0,0)

     

    GOTO 20

     

200 LET c=c-2000

     

    DRAW moon2(c) WITH ROTATE(180)*SCALE(1)*SHIFT(0,0)

     

    GOTO 20

     

300 DRAW moon(c) WITH ROTATE(0)*SCALE(1)*SHIFT(0,0)

     

    GOTO 20

     

400 RESTORE

    LET m=0

    GOTO 20

     

 END

  

 EXTERNAL PICTURE moon(c)

  

    SET AREA COLOR 1

     

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

     

    SET COLOR 1

     

    SET LINE WIDTH 150

     

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

     

    REM SET AREA STYLE "HATCH"

    REM SET AREA STYLE INDEX 5

     

    SET COLOR "yellow"

    DRAW disk WITH SCALE (49)*SHIFT (150,150)

     

    REM SET AREA STYLE "SOLID"

     

    SET COLOR 1

    DRAW disk WITH SCALE (SQR(c^2+50^2))*SHIFT (150-c,150)

     

 END PICTURE

  

 EXTERNAL PICTURE moon2(c)

  

    LET c=c-1000

     

    SET COLOR 1

     

    DRAW disk WITH SCALE (50)*SHIFT (150,150)

     

    SET COLOR "yellow"

     

    DRAW disk WITH SCALE (SQR(c^2+50^2))*SHIFT (150-c,150)

     

    SET COLOR 1

     

    SET LINE WIDTH 150

     

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

     

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

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

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

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

     

 END PICTURE

1570770732

サインとコサインのカーブ



10 OPTION ANGLE DEGREES
   
   
   SET WINDOW 0 , 360 , 0 , 360
   
   FOR d=0 TO 360
   
      SET POINT STYLE 1
      
      PLOT POINTS : d,180
      
      LET y1=SIN(d)*100
      
      LET y12=SIN(d+1)*100
      
      PLOT LINES: d, 180+y1;d+1,180+y12
      
      
      LET y2=cos(d)*100
      
      LET y22=COS(d+1)*100
      
      PLOT lineS: d, 180+y2;d+1,180+y22
      
   next d
   
END

1570374756

ランダム関数を使う


*40行から45行でランダムにn1,n2,dを発生させている。

10 DECLARE EXTERNAL PICTURE number
20 OPTION ANGLE DEGREES
30 SET WINDOW 0,300,0,300    
40 RANDOMIZE
       FOR t=1 TO 30
          LET n1=10+INT(250*RND)
             LET n2=10+INT(250*RND)
             LET d=1+(INT(10*RND))/5
             SET COLOR n1/2
             DRAW number WITH ROTATE(0)*SCALE(d)*SHIFT(n1,n2)       
45 NEXT t    
50 FOR ti=0 TO 10000000
   NEXT ti
       clear    
60 GOTO 40    
70 END

100 EXTERNAL PICTURE number
    OPTION ANGLE DEGREES
120 FOR n=0 TO 12
       SET TEXT ANGLE 30*n
130    PLOT TEXT, AT 10,10 :"3"
140 NEXT n
150 END PICTURE
1569441951

外部絵定義によって同じ図形を描く



10 DECLARE EXTERNAL PICTURE number
20 OPTION ANGLE DEGREES
30 SET WINDOW 0,300,0,300
40 DRAW number
45 DRAW number WITH ROTATE(0)*SCALE(1)*SHIFT(50,50)
50 DRAW number WITH ROTATE(0)*SCALE(2)*SHIFT(100,100)
55 DRAW number WITH ROTATE(0)*SCALE(3)*SHIFT(150,150)
60 DRAW number WITH ROTATE(0)*SCALE(4)*SHIFT(200,200)
70 END

100 EXTERNAL PICTURE number
      OPTION ANGLE DEGREES
     120 FOR n=0 TO 12
       SET TEXT ANGLE 30*n
130    PLOT TEXT, AT 10,10 :"3"
140 NEXT n
     150 END PICTURE  
1547125295

月齢


20 SET WINDOW 0,300,0,300    

INPUT c       
clear       

IF c>1000 THEN GOTO 100       

DRAW circle WITH SCALE (50)*SHIFT (150,150)       
DRAW circle WITH SCALE (SQR(c^2+50^2))*SHIFT (150-c,150)       
GOTO 20    

100 SET WINDOW 300,0,0,300         
LET  c=c-1000         
DRAW circle WITH SCALE (50)*SHIFT (150,150)         
DRAW circle WITH SCALE (SQR(c^2+50^2))*SHIFT (150-c,150)         
GOTO 20         

END
1538071050



増殖


5 REM life game by HAJIME HIRAO 2006

  

  FOR d=30 TO 120 STEP 10

     clear

8    option base 0

     set window 0,200,0,200

10    LET  px=0

      LET  py=0

      LET  t=0

20    print "LlFE"

40    DIM a(100,100),b$(100)

      

      

45    FOR y = 2 TO 99

         FOR x = 2 TO 99

            LET  a(x,y) = 0 

         next x

      next y

      

50    LET  h = 1

      print "絵の大きさは?(1以上)"

      LET  sc=2

60    print "Enter a pattern(type end when finished):"

70    LET  b$(h)="random"

75    IF b$(h) = "random" THEN GOTO 900

80    if b$(h) = "end" then

         LET  h = h-1

         goto 120

      END IF

90    IF LEN(b$(h)) > w THEN LET  w = LEN(b$(h))

100    LET  h = h+1

110    GOTO 70

120    LET  xmin = int(50-w/2)

       LET  ymin = int(50-h/2)

       LET  xmax = xmin+w

       LET  ymax = ymin+h

130    FOR y = 1 TO h

          FOR x = 1 TO w

140          IF b$(y)(x:x+1-1) = "." THEN GOTO 160

150          LET  a(x+xmin,y+ymin) = 1

160       next x

       NEXT y

170    LET  right = 1

       LET  left = 100

       LET  top = 100

       LET  bottom = 1

180    FOR y = ymin TO ymax

          FOR x = xmin TO xmax

190          IF a(x,y) = 11 THEN

                LET  a(x,y) = 1

                if a(x,y) = 10 then LET  a(x,y) = 0

             END IF

200          IF a(x,y) = 1 THEN

                gosub 600

                goto 220

             END IF

210          gosub 620

             goto 260

220          IF x > right THEN LET  right = x

230          IF x < left THEN LET  left = x

240          IF y < top THEN LET  top = y

250          IF y > bottom THEN LET  bottom = y

260       next x

          GOSUB 700

       NEXT y

270    REM for y = ymax+1 to 40

       REM   print

       REM next y

280    PRINT "LIFE";d;"GENERATION:";t

282    IF t=400 THEN GOTO 1000

       

285    REM WAIT DELAY .001

       LET  py=0+t/4

290    LET  xmin = left

       LET  ymin = top

       LET  xmax = right

       LET  ymax = bottom

300    if xmin < 3 then LET  xmin = 3

310    IF ymin < 3 THEN LET  ymin = 3

320    if xmax > 98 then LET  xmax = 98

330    if ymax > 98 then LET  ymax = 98

340    LET  t = t+1

       LET  xmin = xmin-1

       LET  ymin = ymin-1

       LET  xmax = xmax+1

       LET  ymax = ymax+1

350    for y = ymin to ymax

          for x = xmin to xmax

360          LET  nbrs = a(x-1,y-1)+a(x,y-1)+a(x+1,y-1)+a(x-1,y)

370          LET  nbrs = INT(nbrs/10)

380          LET  nbrs = nbrs+a(x+1,y)+a(x-1,y+1)+a(x,y+1)+a(x+1,y+1)

390          LET  nbrs = nbrs-10*INT(nbrs/10)

400          LET  a(x,y) = a(x,y)-10*INT(a(x,y)/10)

410          LET  a(x,y) = 10*a(x,y)

420          IF nbrs = 3 THEN GOTO 450

430          IF nbrs <> 2 THEN GOTO 460

440          if a(x,y) <> 10 then goto 460

450          LET  a(x,y) = a(x,y)+1

460       next x

       NEXT y

470    GOTO 180

       

600    if sc=1 then goto 605

       SET POINT STYLE 3

       GOTO 610

605    set point style 1

610    SET POINT COLOR t

       plot points : px,py

       LET  px = px+sc

       return

       

620    if sc=1 then goto 625

       set point style 3

       GOTO 630

625    set point style 1

       

       

630    REM set point color 0

       REM plot points : px,py

       LET  px = px+sc

       return

       

700    LET  py = py+sc

       LET  px = 0

       return

       

900    rem ramdomize

910    REM print "Enter density:"

920    REM LET  d=38

930    for y = 2 to 99

          for x = 2 to 99

935          IF y < 8 THEN

                LET  a(x,y) = 0 

             ELSE

                GOTO 950

             END IF

940          IF RND*(d+100) < d THEN LET  a(x,y) = 1

950       next x

       next y

960    LET  xmin = 3

       LET  ymin = 3

       LET  xmax = 98

       LET  ymax = 98

970    GOTO 180

1000 NEXT d

1100 GOTO 5

     END

     

     


1536257891

渦巻き



10 SET WINDOW  -2,2,2,-2

20 SET POINT STYLE 1

30 OPTION ANGLE DEGREES

40 FOR t=0 TO 360 STEP 6

   

      LET  x=SIN (t)

      LET  y=SIN(t)/3+COS (t)/3

      SET COLOR 1

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

      

      LET  x=SIN (t+2)/2

      LET  y=SIN(t-2)/4+COS (t-2)/4

      SET COLOR 1

      DRAW disk WITH SCALE(0.01)*SHIFT(x,y+0.2)

      

      LET  x=SIN (t+4)/3

      LET  y=SIN(t-4)/5+COS (t-4)/5

      SET COLOR 1

      DRAW disk WITH SCALE(0.01)*SHIFT(x,y+0.4)

      

      LET  x=SIN (t)/4

      LET  y=SIN(t)/3+COS (t)/3

      SET COLOR 1

      DRAW disk WITH SCALE(0.01)*SHIFT(x,y+0.6)

      

      LET  x=SIN (t)/5

      LET  y=SIN(t)/3+COS (t)/3

      SET COLOR 1

      DRAW disk WITH SCALE(0.01)*SHIFT(x,y+0.8)

      

      LET  x=SIN (t)/6

      LET  y=SIN(t)/3+COS (t)/3

      SET COLOR 1

      DRAW disk WITH SCALE(0.01)*SHIFT(x,y+1)

      

      

100    WAIT DELAY 0.1

110    CLEAR

120 NEXT t    

130 GOTO 10

500 END

    


- 1 - - 2 - - 3 - - 4 - - 5 - - 6 - - 7 - - 8 - - 9 -