Matrix digital rain: Difference between revisions
Content deleted Content added
→{{header|J}}: include a still image from the animation |
m →{{header|J}}: be slightly more robust in the face of some typical development contexts |
||
Line 1,288:
rain_timer=: {{
try.
glfill 0 0 0 255▼
wd 'psel rain'
glfont font=.'courier ',":0.8*scale▼
glsel 'green'
upd=. 0>._3++/?2 2 2 2 4▼
▲ glfill 0 0 0 255
cols=: cols,upd{.(?~{.sz)-.(-<.0.3*{:sz){.cols▼
▲ glfont font=.'courier ',":0.8*scale
rows=: (#cols){.rows▼
▲ upd=. 0>._3++/?2 2 2 2 4
live=: }.live,<(scale*cols,.rows),.?(#cols)##junk▼
▲ cols=: cols,upd{.(?~{.sz)-.(-<.0.3*{:sz){.cols
for_p. live do.▼
▲ rows=: (#cols){.rows
gltextcolor glrgb p_index{heat▼
▲ live=: }.live,<(scale*cols,.rows),.?(#cols)##junk
▲ for_p. live do.
glfont font,' bold'▼
▲ gltextcolor glrgb p_index{heat
end.▼
▲ glfont font,' bold'
gltextxy 2{.xyj▼
for_xyj.;p do.
▲ gltextxy 2{.xyj
gltext 8 u:junk{~{:xyj
▲ end.
end.
glpaint''▼
keep=: rows<{:sz-1▼
cols=: keep#cols▼
rows=: keep#rows+1▼
EMPTY▼
catch.
wd'ptimer 0'
end.
▲ glpaint''
▲ keep=: rows<{:sz-1
▲ cols=: keep#cols
▲ rows=: keep#rows+1
▲ EMPTY
}}
|