BAT脚本实现黑客的数字雨

@echo off
:: @echo off 表示不显示脚本文本内容
title Number Rain
:line
color 0a
setlocal ENABLEDELAYEDEXPANSION
for /l %%i in (0) do (
set "line="
for /l %%j in (1,1,80) do (
:: /a 表示数学计算
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! ")
)
:: /p 表示提示用户输入。/p=!line!省掉变量,相当于只做显示用,<nul指去掉换行
set /p=!line!<nul
)
goto line