Recently, I saw a script made with PHP that simulates the digital rain effect in "The Matrix", which is very cool. Unfortunately, after I saved the script, I forgot to save the author's homepage, and the search didn't yield results, so I don't know who the author is.
I tried to implement it with pure batch processing but never succeeded. Considering that not everyone's machine may have PHP installed, I converted it into an awk script, which can make it more convenient to experience the effect first.
Let's see if any brothers can implement it with batch processing.
Awk version:
Save it and execute it as a batch.
Gawk download address: http://www.klabaster.com/progs/gawk32.zip
Original author's version:
——————————————Dividing line———————————————
***********************************
Moderation Log
***********************************
Operation: Sticky topic
Executor: 3742668
Reason: This post meets the standard for being a highlight in terms of both clicks and replies
Explanation: Since there is no clear highlight criterion at present, friends who have doubts about this operation can post a reply to point it out, or leave a message in the private message system.
***********************************
[ Last edited by 无奈何 on 2007-1-1 at 04:40 AM ]
I tried to implement it with pure batch processing but never succeeded. Considering that not everyone's machine may have PHP installed, I converted it into an awk script, which can make it more convenient to experience the effect first.
Let's see if any brothers can implement it with batch processing.
Awk version:
Save it and execute it as a batch.
@echo off
mode 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 = 0
}
for (;;) {
for (i = 0; i < iWidth; i++) {
aDown--
if (aDown < 0) {
aArrow = mt_rand(0, iDensity)
aDown = mt_rand(10, 25)
}
if (aArrow == 1) {
printf "%s" , substr(sText, mt_rand(0, iText), 1)
} else {
printf " "
}
}
}
}
#>-1
goto :EOF
Gawk download address: http://www.klabaster.com/progs/gawk32.zip
Original author's version:
<?PHP
$iWidth = 80; // Text width
$iDensity = 4; // Density
$aDown = array();
$sText = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
."~`!@#$%^&*(){}_+-=\\\"'|<>?.,/";
$iText = strlen($sText) - 1;
$aArrow = array();
for ($i = 0; $i < $iWidth; $i++) {
$aDown = 0;
}
while (1) {
for ($i = 0; $i < $iWidth; $i++) {
$aDown--;
if ($aDown < 0) {
$aArrow = mt_rand(0, $iDensity);
$aDown = mt_rand(10, 25);
}
if ($aArrow == 1) {
echo substr($sText, mt_rand(0, $iText), 1);
} else {
echo " ";
}
}
// echo "\n";
// usleep(1000);
}
?>
——————————————Dividing line———————————————
***********************************
Moderation Log
***********************************
Operation: Sticky topic
Executor: 3742668
Reason: This post meets the standard for being a highlight in terms of both clicks and replies
Explanation: Since there is no clear highlight criterion at present, friends who have doubts about this operation can post a reply to point it out, or leave a message in the private message system.
***********************************
[ Last edited by 无奈何 on 2007-1-1 at 04:40 AM ]
Recent Ratings for This Post
( 2 in total)
Click for details
☆开始\运行 (WIN+R)☆
%ComSpec% /cset,=何奈无── 。何奈可无是原,事奈无做人奈无&for,/l,%i,in,(22,-1,0)do,@call,set/p= %,:~%i,1%<nul&ping/n 1 127.1>nul
%ComSpec% /cset,=何奈无── 。何奈可无是原,事奈无做人奈无&for,/l,%i,in,(22,-1,0)do,@call,set/p= %,:~%i,1%<nul&ping/n 1 127.1>nul

DigestI