标题: [游戏娱乐] 批处理数字雨 [打印本页]
作者: CrLf 时间: 2013-2-19 23:49 标题: 批处理数字雨
以前写的,清理文件的时候翻到,稍微改了下发上来,呃,好吧挺老套的
cls 刷屏会闪,删掉它也可以正常运行,只是显示时好像也会偶尔抖一抖
常数 K 的值和出现新数字串的频率成正比:- @echo off&setlocal enabledelayedexpansion&color a
- set K=80
- for /l %%b in (1 3 77) do set "last=!last! "
- set "space= "
-
- for /l %%a in (0 1 22) do set "screen=!last! !screen!"
- set screen=!screen:~2!
-
- for /l %%a in () do (
- for /l %%b in (1 3 77) do (
- if "!last:~%%b,1!"==" " (
- set /a "$=(!random!%%(K+2))-K"
- ) else (
- set /a "$=(!random!/2000+8)/9-1"
- )
- if !$! lss 0 (set "str=!str! ") else set "str=!str! !$! "
- )
- set "screen=!str! !screen!"
- set last=!str!&set "str="
- cls
- echo;!screen:~,590!!space!!screen:~610,60! !time! !screen:~690,60!!space!!screen:~770!
- for /l %%a in (1 1 2) do ping /n 1 127.1 >nul
- set "screen=!screen:~,-80!"
- )
复制代码
作者: bat1311 时间: 2013-2-20 21:45
回复 1# CrLf
翻老帖找的, 配上音乐更有感哦- @echo off & title The Matrix & setlocal enabledelayedexpansion
- for /f "tokens=2 delims=[]" %%a in ('ver') do for /f "tokens=2 delims=. " %%a in ("%%a") do set /a "FullScreen=-((%%a-6)>>31)"
- if "%1"=="" (
- for %%a in ( FontSize:00060004
- FontFamily:00000030
- WindowSize:00320050
- ScreenColors:0000000a
- CodePage:000001b5
- ScreenBufferSize:00320050
- FullScreen:!FullScreen!
- ) do for /f "tokens=1,2 delims=:" %%b in ("%%a") do (
- >nul reg add HKCU\Console\TheMatrix /v %%b /t reg_dword /d 0x%%c /f
- )
- start "TheMatrix" /max "%ComSpec%" /c "%~s0" 1 & exit
- ) else ( >nul reg delete HKCU\Console\TheMatrix /f )
-
-
- REM "Main Title/Trinity Infinity" – 3:54
- start /min wmplayer http://pisa.ucsd.edu/cse125/2001/cse190g1/matrix4.mp3
- REM "Unable to Speak" – 1:15
- REM http://www.dondavis.net/media/matrix/matrix_2.mp3
-
- REM "The Power Plant" – 2:41
- REM "Welcome to the Real World" – 2:28
- REM "The Hotel Ambush" – 5:23
- REM "Exit Mr. Hat" – 1:23
- REM http://dt.leonards.info/COFFdD0xMzM4ODkzOTQ3Jmk9MTE3LjY0Ljg1LjY2JnU9U29uZ3MvdjEvZmFpbnRRQy9jYi8yZDUzNDI2OGY5N2YwNGY4ODNkZWMzNjUxMTBjMDVjYi5tcDMmbT04NDhmMjdmN2ViZmZkZDQ1ZmViZjExZGY5NDkxNjA3OSZ2PWRvd24mbj1FeGl0JTIwTXIuJTIwSGF0JnM9tefTsNStyfkmcD1z.mp3
-
-
- REM "A Virus" – 1:33
- REM "Bullet-Time" – 1:10
- REM "Ontological Shock" – 3:32
- REM "Anything Is Possible" – 6:48
-
-
-
- set "Matrix="
- set /a "wid=80,hei=50,iMax=wid*hei, sumOfStream=wid*1/2"
- for /l %%i in (1 1 !iMax!) do set "Matrix= !Matrix!"
- set "bss=!Matrix: =!"
-
- rem 下行有好些字符想必被论坛处理掉了, 会影响效果啊, 请下载附件吧
- set "dic=*_-+|<>'`:.1麴9痫?ō83佧?70?6??
- set "dicLen=42"
-
- for /l %%# in (1 1 !sumOfStream!) do set "s%%#=0"
- for /l %%* in (0 0 0) do (
- for /l %%# in (1 1 !sumOfStream!) do (
- if !s%%#! leq 1 (
- set /a "h%%#=!random!%%(hei-1)+2,p0%%#=!random!%%(wid*(hei+1-h%%#))+1,l%%#=!random! %% h%%# + 1,s%%#=l%%#+h%%#,h%%#+=1,pg%%#=p0%%#,pc%%#=p0%%#"
-
- )
- set /a "s%%#-=1,l%%#-=1,h%%#-=1,old=(l%%#-1)>>31,grow=-h%%#>>31, old0=-^!l%%#,pc%%#=(old0&p0%%#)|(~old0&pc%%#)"
-
- if !old! neq 0 (set "chrc= ") else set "chrc="
- if !grow! neq 0 (
- set /a "r=!random! %% dicLen"
- for %%r in (!r!) do set "chrg=!dic:~%%r,1!"
- ) else set "chrg="
-
- for %%i in (g c) do (
- if defined chr%%i (
- set /a "lL=p%%i%%#-1, lR=iMax-p%%i%%#, r=!random! %% dicLen"
- for /f "tokens=1-3" %%a in ("!lL! !p%%i%%#! !lR!") do (set "Matrix=!Matrix:~0,%%a!!chr%%i!!Matrix:~%%b,%%c!")
- set /a "p%%i%%#+=wid"
- )
- )
- )
- cls & <nul set /p "=!Matrix:~0,-1!!bss!"
- set "title="
- for /l %%i in (0 !wid! 1000) do set "title=!title!!Matrix:~%%i,1!"
- title,"!title!
- )
- exit
复制代码
作者: 嘻哈啊 时间: 2014-7-16 14:50
为什么窗口很小?
作者: hsc8570841 时间: 2014-8-4 07:29
顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶
作者: hnldwhm52 时间: 2014-9-11 12:07
xuexuexuexi!!
欢迎光临 批处理之家 (http://bathome.net./) |
Powered by Discuz! 7.2 |