批处理-模拟黑客帝国数码雨( gawk )版
Gawk下载地址:[url]http://www.klabaster.com/progs/gawk32.zip@echo[/url] offmode con cols=80
color 02
gawk "/^#<-1/,/^#>-1/{if(!/^#/)print}" "%~f0" |gawk -f "-" %*
goto :EOF
:AwkScript
#<-1
function mt_rand(a,b) {
return int(((rand()*(1+b-a))+a))
}
BEGIN{
iWidth = 80
iDensity = 4
sText = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~`!@#%^&*(){}[]_+-=\\\"'|<>?.,/"
iText = length(sText) - 1
for (i = 0; i < iWidth; i++) {
aDown[i] = 0
}
for (;;) {
for (i = 0; i < iWidth; i++) {
aDown[i]--
if (aDown[i] < 0) {
aArrow[i] = mt_rand(0, iDensity)
aDown[i] = mt_rand(10, 25)
}
if (aArrow[i] == 1) {
printf "%s" , substr(sText, mt_rand(0, iText), 1)
} else {
printf " "
}
}
}
}
#>-1
goto :EOF
页:
[1]