|
Post by tsh73 on Jun 10, 2022 11:27:42 GMT
And someone showed me this animation (in python MatPlotLib I believe)
'tsh73 June 2022 nomainwin open "watch the rain" for graphics_nsb_nf as #gr #gr "trapclose [quit]" #gr "down; home; posxy cx cy"
N=20 dim x(N), y(N), r(N), d(N)
for k = 1 to N x(i)=int(rnd(0)*2*cx) y(i)=int(rnd(0)*2*cy) d(i)=int(rnd(0)*30+20) r(i)=int(rnd(0)*d(i)) next
While 1 scan for i = 1 to N #gr "place ";x(i);" ";y(i) #gr "color white;circle ";r(i) if r(i)<d(i) then r(i)=r(i)+1 cc=127+int(128*r(i)/d(i)) 'if i = 1 then print cc c$ = cc;" ";cc;" ";cc #gr "color ";c$;";circle ";r(i) else x(i)=int(rnd(0)*2*cx) y(i)=int(rnd(0)*2*cy) d(i)=int(rnd(0)*30+20) r(i)=1 end if next timer 1, [n] wait [n] timer 1 #gr "discard" wend
wait
[quit] close #gr end
|
|
|
Post by plus on Jun 10, 2022 14:23:32 GMT
Eh... that's a little sprinkle, here is rain in Ohio!
'tsh73 June 2022 nomainwin open "watch the rain" for graphics_nsb_nf as #gr #gr "trapclose [quit]" #gr "down; home; posxy cx cy"
N=2000 dim x(N), y(N), r(N), d(N)
for k = 1 to N x(i)=int(rnd(0)*2*cx) y(i)=int(rnd(0)*2*cy) d(i)=int(rnd(0)*30+20) r(i)=int(rnd(0)*d(i)) next
While 1 scan for i = 1 to N #gr "place ";x(i);" ";y(i) '#gr "color white;circle ";r(i) if r(i)<d(i) then r(i)=r(i)+1 cc=127+int(128*r(i)/d(i)) 'if i = 1 then print cc c$ = cc;" ";cc;" ";cc #gr "color ";c$;";circle ";r(i) else x(i)=int(rnd(0)*2*cx) y(i)=int(rnd(0)*2*cy) d(i)=int(rnd(0)*30+20) r(i)=1 end if next timer 1, [n] wait [n] timer 1 #gr "discard" wend
wait
[quit] close #gr end
|
|