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

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

  1. ::黑客帝国里数码雨
  2. @echo %dbg% off
  3. :: Code by redtek 2006-11-2 CMD@XP
  4. :: 出处:http://www.cn-dos.net/forum/viewthread.php?tid=24418
  5. setlocal ENABLEDELAYEDEXPANSION
  6. mode con cols=80 lines=30
  7. cls
  8. set 退格=
  9. set redtek=" "
  10. set end=0
  11. :start
  12. set /a end+=1
  13. call :calc
  14. set /p=!setspaces! nul
  15. set /p=%退格%<NUL
  16. set /p=%redtek:~1,79%<NUL&ECHO.
  17. goto :start
  18. :calc
  19. if %end%==28 (
  20. set /a end=0 & cls & set /a cols=!random:~0,2!
  21. echo ... 风力:!cols! ...
  22. if !cols! GTR 76 set cols=76
  23. if !cols! LSS 2 set cols=2
  24. set setspaces=!redtek:~1,%cols%!!random:~0,1!
  25. goto :eof
  26. )
  27. @echo off
  28. :: Code by JM 2006-11-3 CMD@XP
  29. :: 出处:http://www.cn-dos.net/forum/viewthread.php?tid=24418
  30. :: test.txt内容为:1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~`!@#%&*(){}[]_+-=\"'?.,/
  31. :: 暂时不能处理 |<>^
  32. mode con cols=80
  33. color 02
  34. for /f %%i in (test.txt) do set str_char=%%i
  35. set str_blank=
  36. setlocal enabledelayedexpansion
  37. :loop
  38. :: 取随机位置上的字符
  39. set /a num_char=1%random:~-1%%random:~0,1%-100
  40. set char=!str_char:~-%num_char%,1!
  41. :: 设置随机长度的空格
  42. set /a num_blank=1%random:~-1%%random:~0,1%-100
  43. set blank=!str_blank:~0,%num_blank%!
  44. echo.%blank%%char%
  45. goto loop
  46. @echo off
  47. :: Code by 不得不爱 2006-11-3 CMD@XP
  48. :: 出处:http://www.cn-dos.net/forum/viewthread.php?tid=24418
  49. mode con cols=80
  50. set a=1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~`!@#%.*(){}[]_+-=\"'?.,/^&^^^>^<
  51. set b=
  52. setlocal enabledelayedexpansion
  53. :a
  54. set /a num=%random%%%92
  55. set 字符=!a:~-%num%,1!
  56. set/a c=%random%%%80
  57. set 空格=!b:~-%c%!
  58. echo %空格%^%字符%
  59. goto a
  60. @echo off
  61. :: Code by yfd11 2006-11-3 CMD@XP
  62. :: 出处:http://www.cn-dos.net/forum/viewthread.php?tid=24418
  63. mode con cols=80 LINES=30
  64. set a=1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~`!@#%.*(){}[]_+-=\"'?.,/^&^^^>^<
  65. set b=
  66. setlocal enabledelayedexpansion
  67. :a
  68. set /a num=%random%%%92
  69. set 字符=!a:~-%num%,1!
  70. set/a c=%random%%%80
  71. set 空格=!b:~-%c%!
  72. ::echo. %空格%^%字符%
  73. set/a i+=1
  74. rem 指针=i 尾指针=j
  75. set/a j=i-30
  76. set line%i%=%空格%^%字符%
  77. FOR /L %%v IN (%i%,-1,%j%) DO echo.!line%%v!
  78. ::ping /n 127.1>nul
  79. goto a
  80. @echo off
  81. :: Code by hxuan999 2006-11-12 CMD@XP
  82. :: 出处:http://www.cn-dos.net/forum/viewthread.php?tid=24418
  83. ::mode con cols=80
  84. setlocal ENABLEDELAYEDEXPANSION
  85. color 02
  86. goto BEGIN
  87. goto :eof
  88. ::function mt_rand "a" "b"
  89. :mt_rand
  90. ::(
  91. set a=%~1
  92. set b=%~2
  93. set /a _mt_rand=(!random!%%(%b%-%a%))+%a%
  94. exit /b 0
  95. ::)
  96. :BEGIN
  97. ::{--
  98. SET iWidth=80
  99. SET iDensity=6
  100. SET sText="#$&'()*+,-./0123456789:;<>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
  101. SET sText=!sText:"=!
  102. set /A iText=90-1
  103. for /l %%i in (1,1,%iWidth%) do (
  104. set aDown%%i=0
  105. )
  106. :loop
  107. for /l %%I in (1,1,%iWidth%) do (
  108. set /a aDown%%I-=1
  109. if !aDown%%I! LSS 0 (
  110. call :mt_rand "0" "%iDensity%"&&set aArrow%%I=!_mt_rand!
  111. call :mt_rand "10" "25"&&set aDown%%I=!_mt_rand!
  112. )
  113. if !aArrow%%I! EQU 1 (
  114. call :mt_rand "0" "%iText%"&&(FOR %%M IN ("!_mt_rand!") DO SET aa=!sText:~%%~M,1!)
  115. set /p=!aa!<NUL
  116. ) else (
  117. set /p= <NUL
  118. )
  119. )
  120. goto loop
  121. ::--}
  122. :exit
  123. exit /b 0
  124. @echo off
  125. :: Code by hxuan999 2006-11-12 CMD@XP
  126. :: 出处:http://www.cn-dos.net/forum/viewthread.php?tid=24418
  127. setlocal ENABLEDELAYEDEXPANSION
  128. color 02
  129. for /l %%i in (1,1,80) do (
  130. set Down%%i=0
  131. )
  132. :loop
  133. for /l %%j in (1,1,80) do (
  134. set /a Down%%j-=1
  135. if !down%%j! LSS 0 (
  136. set /a Arrow%%j=!random!%%4
  137. set /a Down%%j=!random!%%15+10
  138. )
  139. if "!Arrow%%j!" == "1" (
  140. set /a chr=!random!%%2
  141. set /p=!chr!<NUL
  142. ) else (
  143. set /p= <NUL
  144. )
  145. )
  146. goto loop
  147. goto :eof
  148. @echo off
  149. :: Code by newaifi 2006-11-16 CMD@XP
  150. :: 出处:http://www.cn-dos.net/forum/viewthread.php?tid=24418
  151. setlocal ENABLEDELAYEDEXPANSION
  152. for /l %%i in (1,1,80) do (
  153. set Down%%i=0
  154. )
  155. for /l %%i in (0) do (
  156. set line=
  157. for /l %%j in (1,1,80) do (
  158. set /a Down%%j-=1
  159. call set x=!down%%j!
  160. if !x! LSS 0 (
  161. set /a Arrow%%j=!random!%%6
  162. set /a Down%%j=!random!%%15+10
  163. )
  164. call set x=!Arrow%%j!
  165. if "!x!" == "1" (
  166. set line=!line!1
  167. ) else (set "line=!line! ")
  168. )
  169. call set /p=!line!<NUL
  170. )
复制代码
ㄗs:A good programming is 99% sweat and 1% coffee!--①個亾

============ >   hi.baidu.com/novaa   <============

太强大了,真是太佩服楼主

TOP

回复 8楼 的帖子

有往下的,本论坛搜索“雨”。
我帮忙写的代码不需要付钱。如果一定要给,请在微信群或QQ群发给大家吧。
【微信公众号、微信群、QQ群】http://bbs.bathome.net/thread-3473-1-1.html
【支持批处理之家,加入VIP会员!】http://bbs.bathome.net/thread-67716-1-1.html

TOP

呵呵,可惜雨是往上的 。。。。

模拟度不够~~~ 不要介意啊

TOP

回复 6楼 的帖子

答应你什么?
扣分吗?我可以代劳^_^
我帮忙写的代码不需要付钱。如果一定要给,请在微信群或QQ群发给大家吧。
【微信公众号、微信群、QQ群】http://bbs.bathome.net/thread-3473-1-1.html
【支持批处理之家,加入VIP会员!】http://bbs.bathome.net/thread-67716-1-1.html

TOP

呵呵...LZ老大答应我吧

TOP

我也来凑个热闹:
  1. ::code by WANKOILZ 2008/5/28
  2. @echo off&setlocal enabledelayedexpansion&color 02&mode con lines=30&title 黑客帝国数码雨
  3. setlocal&set flag=0&set code=1234567890abcdefghijklmnopqrstuvwxyz#*$~\/:
  4. :loop
  5. if %flag% lss 30 (set/a flag+=1) else (call :chang)
  6. for /l %%i in (1,1,26) do (
  7.   if defined a%%i (call :set %%i&set tmp=!a%%i!
  8.   ) else (if !random! lss 1000 (call :set %%i&set tmp=!a%%i!
  9.          ) else (set tmp= ))
  10. call set line%flag%=%%line!flag!%%  !tmp!
  11. )
  12. cls&for /l %%i in (%flag%,-1,1) do echo.!line%%i!
  13. for /l %%i in (1,1,100) do ver>nul
  14. ::ping /n 1 127.1>nul
  15. if !random! lss 500 (endlocal&setlocal&set flag=0&set code=1234567890abcdefghijklmnopqrstuvwxyz#*$~\/:)
  16. goto :loop
  17. :chang
  18. for /l %%i in (1,1,29) do (
  19. set/a tmp=%%i+1
  20. call set line%%i=%%line!tmp!%%
  21. )
  22. set line%flag%=
  23. goto :eof
  24. :set
  25. set/a rnd=%random%%%43
  26. set a%1=!code:~%rnd%,1!
复制代码

TOP

好厉害哦

我是新手,多教教我把

TOP

有趣有趣。是不是可以做的再好些。哈

TOP

厉害啊.....找LZ做我师傅,,,,呵呵...LZ老大答应我吧

TOP

返回列表