[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[游戏娱乐] 批处理数字雨

以前写的,清理文件的时候翻到,稍微改了下发上来,呃,好吧挺老套的
cls 刷屏会闪,删掉它也可以正常运行,只是显示时好像也会偶尔抖一抖
常数 K 的值和出现新数字串的频率成正比:
  1. @echo off&setlocal enabledelayedexpansion&color a
  2. set K=80
  3. for /l %%b in (1 3 77) do set "last=!last!   "
  4. set "space=                    "
  5. for /l %%a in (0 1 22) do set "screen=!last!  !screen!"
  6. set screen=!screen:~2!
  7. for /l %%a in () do (
  8.    for /l %%b in (1 3 77) do (
  9.       if "!last:~%%b,1!"==" " (
  10.          set /a "$=(!random!%%(K+2))-K"
  11.       ) else (
  12.          set /a "$=(!random!/2000+8)/9-1"
  13.       )
  14.       if !$! lss 0 (set "str=!str!   ") else set "str=!str! !$! "
  15.    )
  16.    set "screen=!str!  !screen!"
  17.    set last=!str!&set "str="
  18.    cls
  19.    echo;!screen:~,590!!space!!screen:~610,60!    !time!     !screen:~690,60!!space!!screen:~770!
  20.    for /l %%a in (1 1 2) do ping /n 1 127.1 >nul
  21.    set "screen=!screen:~,-80!"
  22. )
复制代码

回复 1# CrLf

翻老帖找的, 配上音乐更有感哦
  1. @echo off & title The Matrix & setlocal enabledelayedexpansion
  2. for /f "tokens=2 delims=[]" %%a in ('ver') do for /f "tokens=2 delims=. " %%a in ("%%a") do set /a "FullScreen=-((%%a-6)>>31)"
  3. if "%1"=="" (
  4.   for %%a in (  FontSize:00060004
  5.                 FontFamily:00000030
  6.                 WindowSize:00320050
  7.                 ScreenColors:0000000a
  8.                 CodePage:000001b5
  9.                 ScreenBufferSize:00320050
  10.                 FullScreen:!FullScreen!
  11.   ) do for /f "tokens=1,2 delims=:" %%b in ("%%a") do (
  12.     >nul reg add HKCU\Console\TheMatrix /v %%b /t reg_dword /d 0x%%c /f
  13.   )
  14.   start "TheMatrix" /max "%ComSpec%" /c "%~s0" 1 & exit
  15. ) else ( >nul reg delete HKCU\Console\TheMatrix /f )
  16. REM "Main Title/Trinity Infinity" – 3:54
  17. start /min wmplayer http://pisa.ucsd.edu/cse125/2001/cse190g1/matrix4.mp3
  18. REM "Unable to Speak" – 1:15
  19. REM http://www.dondavis.net/media/matrix/matrix_2.mp3
  20. REM "The Power Plant" – 2:41
  21. REM "Welcome to the Real World" – 2:28
  22. REM "The Hotel Ambush" – 5:23
  23. REM "Exit Mr. Hat" – 1:23
  24. REM http://dt.leonards.info/COFFdD0xMzM4ODkzOTQ3Jmk9MTE3LjY0Ljg1LjY2JnU9U29uZ3MvdjEvZmFpbnRRQy9jYi8yZDUzNDI2OGY5N2YwNGY4ODNkZWMzNjUxMTBjMDVjYi5tcDMmbT04NDhmMjdmN2ViZmZkZDQ1ZmViZjExZGY5NDkxNjA3OSZ2PWRvd24mbj1FeGl0JTIwTXIuJTIwSGF0JnM9tefTsNStyfkmcD1z.mp3
  25. REM "A Virus" – 1:33
  26. REM "Bullet-Time" – 1:10
  27. REM "Ontological Shock" – 3:32
  28. REM "Anything Is Possible" – 6:48
  29. set "Matrix="
  30. set /a "wid=80,hei=50,iMax=wid*hei, sumOfStream=wid*1/2"
  31. for /l %%i in (1 1 !iMax!) do set "Matrix= !Matrix!"
  32. set "bss=!Matrix: =!"
  33. rem 下行有好些字符想必被论坛处理掉了, 会影响效果啊, 请下载附件吧
  34. set "dic=*_-+|<>'`:.1麴9痫?ō83佧?70?6??
  35. set "dicLen=42"
  36. for /l %%# in (1 1 !sumOfStream!) do set "s%%#=0"
  37. for /l %%* in (0 0 0) do (
  38.   for /l %%# in (1 1 !sumOfStream!) do (
  39.     if !s%%#! leq 1 (
  40.       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%%#"
  41.     )
  42.     set /a "s%%#-=1,l%%#-=1,h%%#-=1,old=(l%%#-1)>>31,grow=-h%%#>>31, old0=-^!l%%#,pc%%#=(old0&p0%%#)|(~old0&pc%%#)"
  43.     if !old! neq 0 (set "chrc= ") else set "chrc="
  44.     if !grow! neq 0 (
  45.       set /a "r=!random! %% dicLen"
  46.       for %%r in (!r!) do set "chrg=!dic:~%%r,1!"
  47.     ) else set "chrg="
  48.     for %%i in (g c) do (
  49.       if defined chr%%i (
  50.         set /a "lL=p%%i%%#-1, lR=iMax-p%%i%%#, r=!random! %% dicLen"
  51.         for /f "tokens=1-3" %%a in ("!lL! !p%%i%%#! !lR!") do (set "Matrix=!Matrix:~0,%%a!!chr%%i!!Matrix:~%%b,%%c!")
  52.         set /a "p%%i%%#+=wid"
  53.       )
  54.     )
  55.   )
  56.   cls & <nul set /p "=!Matrix:~0,-1!!bss!"
  57.   set "title="
  58.   for /l %%i in (0 !wid! 1000) do set "title=!title!!Matrix:~%%i,1!"
  59.   title,"!title!
  60. )
  61. exit
复制代码

TOP

为什么窗口很小?

TOP

顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶

TOP

xuexuexuexi!!

TOP

返回列表