bat实现的模仿黑客帝国里面的数码雨

时间:2021-05-23

::黑客帝国里数码雨
@echo%dbg%off
::Codebyredtek2006-11-2CMD@XP
::出处:http://www.cn-dos.net/forum/viewthread.php?tid=24418
setlocalENABLEDELAYEDEXPANSION
modeconcols=80lines=30
cls

set退格=
setredtek=""

setend=0

:start

set/aend+=1

call:calc

set/p=!setspaces!nul

set/p=%退格%<NUL

set/p=%redtek:~1,79%<NUL&ECHO.

goto:start

:calc

if%end%==28(

set/aend=0&cls&set/acols=!random:~0,2!

echo...风力:!cols!...

if!cols!GTR76setcols=76

if!cols!LSS2setcols=2

setsetspaces=!redtek:~1,%cols%!!random:~0,1!

goto:eof

)

@echooff
::CodebyJM2006-11-3CMD@XP
::出处:http://www.cn-dos.net/forum/viewthread.php?tid=24418
::test.txt内容为:1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~`!@#%&*(){}[]_+-=\"'?.,/
::暂时不能处理|<>^
modeconcols=80
color02
for/f%%iin(test.txt)dosetstr_char=%%i
setstr_blank=
setlocalenabledelayedexpansion

:loop
::取随机位置上的字符
set/anum_char=1%random:~-1%%random:~0,1%-100
setchar=!str_char:~-%num_char%,1!

::设置随机长度的空格
set/anum_blank=1%random:~-1%%random:~0,1%-100
setblank=!str_blank:~0,%num_blank%!
echo.%blank%%char%
gotoloop

@echooff
::Codeby不得不爱2006-11-3CMD@XP
::出处:http://www.cn-dos.net/forum/viewthread.php?tid=24418
modeconcols=80
seta=1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~`!@#%.*(){}[]_+-=\"'?.,/^&^^^>^<
setb=
setlocalenabledelayedexpansion
:a
set/anum=%random%%%92
set字符=!a:~-%num%,1!
set/ac=%random%%%80
set空格=!b:~-%c%!
echo%空格%^%字符%
gotoa


@echooff
::Codebyyfd112006-11-3CMD@XP
::出处:http://www.cn-dos.net/forum/viewthread.php?tid=24418
modeconcols=80LINES=30
seta=1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~`!@#%.*(){}[]_+-=\"'?.,/^&^^^>^<
setb=
setlocalenabledelayedexpansion
:a
set/anum=%random%%%92
set字符=!a:~-%num%,1!
set/ac=%random%%%80
set空格=!b:~-%c%!
::echo.%空格%^%字符%

set/ai+=1
rem指针=i尾指针=j
set/aj=i-30
setline%i%=%空格%^%字符%
FOR/L%%vIN(%i%,-1,%j%)DOecho.!line%%v!
::ping/n127.1>nul
gotoa

@echooff
::Codebyhxuan9992006-11-12CMD@XP
::出处:http://www.cn-dos.net/forum/viewthread.php?tid=24418
::modeconcols=80
setlocalENABLEDELAYEDEXPANSION
color02

gotoBEGIN
goto:eof

::functionmt_rand"a""b"
:mt_rand
::(
seta=%~1
setb=%~2
set/a_mt_rand=(!random!%%(%b%-%a%))+%a%
exit/b0
::)

:BEGIN
::{--
SETiWidth=80
SETiDensity=6
SETsText="#$&'()*+,-./0123456789:;<>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
SETsText=!sText:"=!
set/AiText=90-1

for/l%%iin(1,1,%iWidth%)do(
setaDown%%i=0
)

:loop
for/l%%Iin(1,1,%iWidth%)do(
set/aaDown%%I-=1
if!aDown%%I!LSS0(
call:mt_rand"0""%iDensity%"&&setaArrow%%I=!_mt_rand!
call:mt_rand"10""25"&&setaDown%%I=!_mt_rand!
)
if!aArrow%%I!EQU1(
call:mt_rand"0""%iText%"&&(FOR%%MIN("!_mt_rand!")DOSETaa=!sText:~%%~M,1!)
set/p=!aa!<NUL
)else(
set/p=<NUL
)
)
gotoloop
::--}

:exit
exit/b0

@echooff
::Codebyhxuan9992006-11-12CMD@XP
::出处:http://www.cn-dos.net/forum/viewthread.php?tid=24418
setlocalENABLEDELAYEDEXPANSION
color02

for/l%%iin(1,1,80)do(
setDown%%i=0
)

:loop
for/l%%jin(1,1,80)do(
set/aDown%%j-=1
if!down%%j!LSS0(
set/aArrow%%j=!random!%%4
set/aDown%%j=!random!%%15+10
)
if"!Arrow%%j!"=="1"(
set/achr=!random!%%2
set/p=!chr!<NUL
)else(
set/p=<NUL
)
)
gotoloop
goto:eof

@echooff
::Codebynewaifi2006-11-16CMD@XP
::出处:http://www.cn-dos.net/forum/viewthread.php?tid=24418
setlocalENABLEDELAYEDEXPANSION
for/l%%iin(1,1,80)do(
setDown%%i=0
)

for/l%%iin(0)do(
setline=
for/l%%jin(1,1,80)do(
set/aDown%%j-=1
callsetx=!down%%j!
if!x!LSS0(
set/aArrow%%j=!random!%%6
set/aDown%%j=!random!%%15+10
)
callsetx=!Arrow%%j!
if"!x!"=="1"(
setline=!line!1
)else(set"line=!line!")
)
callset/p=!line!<NUL
)

声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。

相关文章