CMD命令实现数字雨
程序员文章站
2022-04-07 17:25:39
...
使用cmd命令可以实现类似黑客帝国中的数字雨,这里给出脚本和演示效果:
digitalrain.bat
@echo off
title digitalrain
color 0b
setlocal ENABLEDELAYEDEXPANSION
for /l %%i in (0) do (
set "line="
for /l %%j in (1,1,80) do (
set /a Down%%j-=2
set "x=!Down%%j!"
if !x! LSS 0 (
set /a Arrow%%j=!random!%%3
set /a Down%%j=!random!%%15+10
)
set "x=!Arrow%%j!"
if "!x!" == "2" (
set "line=!line!!random:~-1! "
) else (set "line=!line! ")
)
set /p=!line!<nul
)
win7 64位命令行下运行效果: