RosettaCodeData/Task/Matrix-digital-rain/M2000-Interpreter/matrix-digital-rain.m2000
2025-02-27 18:35:13 -05:00

56 lines
1.6 KiB
Text
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

module MatrixRain {
a$="寿司历史可追溯至2000年前日本开始发展水稻种植的时期。寿司的雏形出现于弥生时代当时的人发明了将食用鱼加盐在米饭中发酵的做法即今日的熟寿司此时米饭为发酵所用材料并不食用。到了室町时代其中发酵过的米饭变得也可以食用。在江户时代醋逐渐取代了发酵米饭的地位。而到了近现代寿司则成为了一种与日本文化紧密相关的快餐食品。"
r=random(!4324234)
p3=pi*3/2
double m[120]
single x[120], y[120]
long t[120], k[120], s[120], z[120], q[120], p[120]
hide
background {
for i=1 to 120
t[i]=random(1, 10)
x[i]=random(0, scale.x)
y[i]=random(-1000, scale.y/2)
k[i]=random(20, 50)
s[i]=random(30, 60)
z[i]=random(8, 22)
q[i]=random(1, len(a$)-20)
p[i]=10
m[i]=1+rnd/100
next
refresh 1000
do
pen 0, 50
gradient 0, #002200
for i=1 to 120
if k[i]<20 then
y[i]+=twipsY*s[i]
move @f(x[i]), y[i] :m[i]*=1.006
pen #00aa00, t[i]*(22-p[i])/20+20
legend mid$(a$, q[i],p[i]), fontname$, z[i], p3
if p[i]>2 then q[i]++:p[i]--
end if
k[i]--
if k[i]=0 then
q[i]=random(1, len(a$)-20):p[i]=10
y[i]=random(-1000, scAle.y/4): k[i]=random(15, 30):z[i]=random(8, 22)
m[i]=1+rnd/100:s[i]=random(30, 60)
end if
next
refresh 1000
if inkey$=" " then exit
pen 14, 255
always
}
background {cls}
show
function f(x)
if x<scale.x/2 then
=scale.x/2-(scale.x/2-x)*m[i]
else
=scale.x/2+(x-scale.x/2)*m[i]
end if
end function
}
MatrixRain