l = 500

t= 0

dim S(1000)

 

dim L(1000)

dim S1(1000)

'open "c:\list1.txt" for output as #1

dim L1(1000)

z=.5

 

'open "b" for graphics as #dra

'print #dra, "home ; up ; north ; turn 180 ; go 400 ; down ; north ; turn 90"

open "Draw" for graphics as #draw

for n=1 to 10

for j = 1 to 1000000

d1=40

st1=300

p= int(l * rnd(0))

li = int(l * rnd(0))

p1= st1+int(d1 * rnd(0))

li1 = int(d1 * rnd(0))

 

''if p1=p2 goto [q]

''if p1<75+n or p1>90+n goto [q1]

'if p<30+n or p>45+n goto [q2]

if p1+li1>p-li and p1+li1<p+li goto [q]

if p+li>p1-li1 and p+li<p1+li1 goto [q]

if (st1+d1-p1-li1)/d1 < rnd(0) then goto [qc]

if (-1*st1+p1-li1)/d1 < rnd(0) then goto [qc]

L1(p1)=L1(p1)+li1

 

S1(p1) = S1(p1) + 1

[qc]

 

if (l-p-li)/l < rnd(0) then goto [q]

if (p-li)/l < rnd(0) then goto [q]

 

L(p)=L(p)+li

 

S(p) = S(p) + 1

 

 

goto [q]

 

[q1]

'S1(p1)=0

goto [q]

[q2]

'S(p)=0

[q]

next j

'print #dra, "down ; place 0 0 ; go 1000  "

 

'for j = 1 to 50

'print #dra, "up ; goto " ; 100 + Po(j) ; " " ; j * 10

'print #dra, "down ; go " ; Lo(j)

 

'print #dra, "flush"

'next j

'rem wait

 

for k = 1 to l

print k , S(k),S(k)^.5,L(k)/(S(k)+1)

tx=tx+S(k)

tn=tn+L(k)/(S(k)+1)

 

print sin((k*3.14)/l)*sin((k*3.14)/l)*y

 

next k

y=7.5*tx/k

print tx,tn/l

 

 

 print #draw, "home ; down "

 

 for r = 1 to l

 'print #1, S(r)

 print #draw,"goto "; r * 2 ; " "; S(r)*5

 'print #draw, "flush"

 next r

 print #draw, "up ; home ;color red ; down"

  print #draw, "home ; down "

 

 for r = 1 to l

 'print #1, S1(r)

 print #draw,"goto "; r * 2 ; " "; S1(r)*1

 'print #draw, "flush"

 next r

 

 print #draw, "up ; home ;color red ; down"

 for e = 1 to l

 print #draw, "goto "; e* 2 ; " "; sin((e*3.14)/l)*sin((e*3.14)/l)*y

 'print #draw, "flush"

 next e

  print #draw, "up ; home ;color blue ; down"

 for e = 1 to l

 print #draw, "goto "; e* 2 ; " "; sin((e*3.14)/l)*y

 print #draw, "flush"

 next e

' close #1

print n

input g

print #draw, "cls"

next n

 wait

 'print #draw, "home ; up ; north ; turn 180 ; go 100"

 'print #draw, "down ; north ; turn 90 ; go 100 ; turn 180 ; go 100"

 'for r = 1 to 100

 'print #draw, "down ; north ; go ";  S(r)

 'print #draw, "up ; north ; turn 180 ; go "; S(r)

 'print #draw, "turn 90 ; go 1 ; flush"

 'next r

 'wait

 

 rem open "Draw" for graphics as #draw

rem  print #draw, " home ; north ; down"

rem  for r =     1 to 100

rem  print #draw, " home ; north ; goto  1,1"

  rem print #draw,  "turn 90 ; go " ; r

rem print #draw, "flush"

rem next r

rem wait