1.不算太猛:
@echo off
title Digital Rain
color 0a
setlocal ENABLEDELAYEDEXPANSION
:: Define the character set to be used for the rain
set "chars=0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()"
:: Get the length of the character set
set "charlen=72"
:: Set the maximum width and speed range
set "maxWidth=80"
set "minSpeed=10"
set "maxSpeed=25"
:: Initialize random seed
set /a "seed=%random%"
:: Infinite loop for the digital rain
:mainLoop
set "line="
:: Loop through each column to generate the characters
for /L %%j in (1,1,%maxWidth%) do (
set /a "Down%%j=Down%%j-1"
set "x=!Down%%j!"
:: If the column needs a new drop, reset the drop counter
if !x! lss 0 (
set /a "Arrow%%j=!random! %% 3"
set /a "Down%%j=!random! %% (%maxSpeed% - %minSpeed% + 1) + %minSpeed%"
)
:: Determine whether to print a character or space
if !Arrow%%j! == 2 (
:: Get a random character from the set
set /a "index=!random! %% %charlen%"
call set "char=!chars:~%index%,1!"
set "line=!line!!char! "
) else (
set "line=!line! "
)
)
:: Print the line with color variation
set /a "colorcode=!random! %% 8 + 2"
call color 0!colorcode!
set /p=!line!<nul
:: Introduce a slight delay to vary the speed
timeout /nobreak /t 1 > nul
goto mainLoop
endlocal
2.亿点点晕:
@echo off
title Digital Rain
color 0a
setlocal ENABLEDELAYEDEXPANSION
:: Define the character set to be used for the rain
set "chars=0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()"
:: Get the length of the character set (set manually since `set /a charlen=%%~LENGTH:!chars!%%` isn't possible)
set "charlen=72"
:: Set the maximum width and speed range
set "maxWidth=80"
set "minSpeed=10"
set "maxSpeed=25"
:: Infinite loop for the digital rain
:mainLoop
for /l %%i in (0) do (
set "line="
:: Loop through each column to generate the characters
for /l %%j in (1,1,%maxWidth%) do (
set /a "Down%%j-=1"
set "x=!Down%%j!"
:: If the column needs a new drop, reset the drop counter
if !x! LSS 0 (
set /a "Arrow%%j=!random!%%3"
set /a "Down%%j=!random!%%(%maxSpeed%-%minSpeed%+1)+%minSpeed%"
)
:: Determine whether to print a character or space
set "x=!Arrow%%j!"
if "!x!" == "2" (
:: Get a random character from the set
set /a "index=!random!%%charlen"
call set "char=!chars:~%index%,1!"
set "line=!line!!char! "
) else (
set "line=!line! "
)
)
:: Print the line with color variation
set /a "colorcode=!random!%%8+2"
call color 0!colorcode!
set /p=!line!<nul
:: Introduce a slight delay to vary the speed
ping -n 1 -w !random! 127.0.0.1 > nul
)
goto mainLoop
endlocal
3.晕倒了别怪我:
@echo off
title Digital Rain
color 0a
setlocal ENABLEDELAYEDEXPANSION
:: Define the character set to be used for the rain
set "chars=0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()"
:: Get the length of the character set (set manually since set /a charlen=%%~LENGTH:!chars!%% isn't possible)
set "charlen=72"
:: Set the maximum width and speed range
set "maxWidth=80"
set "minSpeed=10"
set "maxSpeed=25"
:: Infinite loop for the digital rain
:mainLoop
for /l %%i in (0) do (
set "line="
:: Loop through each column to generate the characters
for /l %%j in (1,1,%maxWidth%) do (
set /a "Down%%j-=1"
set "x=!Down%%j!"
:: If the column needs a new drop, reset the drop counter
if !x! LSS 0 (
set /a "Arrow%%j=!random!%%3"
set /a "Down%%j=!random!%%(%maxSpeed%-%minSpeed%+1)+%minSpeed%"
)
:: Determine whether to print a character or space
set "x=!Arrow%%j!"
if "!x!" == "2" (
:: Get a random character from the set
set /a "index=!random!%%charlen"
call set "char=!chars:~%index%,1!"
set "line=!line!!char! "
) else (
set "line=!line! "
)
)
:: Print the line with color variation
set /a "colorcode=!random!%%8+2"
call color 0!colorcode!
set /p=!line!<nul
:: Introduce a slight delay to vary the speed
ping -n 1 -w !random! 127.0.0.1 > nul
)
goto mainLoop
endlocal
给大家分享一个数学题,exercise一下脑袋,
已知abcd+abc+ab+a=1370,用位值原理求解abcd的值
答:
根据位值原理,将 (abcd + abc + ab + a = 1370) 进行分解:
设 (a)、(b)、(c)、(d) 为个位数,从 0 到 9。
- (abcd) 可以表示为 (1000a + 100b + 10c + d)
- (abc) 可以表示为 (100a + 10b + c)
- (ab) 可以表示为 (10a + b)
- (a) 本身就是 (a)
将这些分解表达式代入原方程:
[abcd + abc + ab + a = 1000a + 100b + 10c + d + 100a + 10b + c + 10a + b + a]
整理合并同类项:
[abcd + abc + ab + a = 1000a + 100b + 10c + d + 100a + 10b + c + 10a + b + a = 1111a + 111b + 11c + d]
所以我们得到了这个方程:
[1111a + 111b + 11c + d = 1370]
根据之前的分析,求解 (a)、(b)、(c)、(d):
-
假设 (a = 1)
[1111 \times 1 = 1111]
[1370 - 1111 = 259] -
剩余部分等于 (111b + 11c + d = 259)
假设 (b = 2)
[111 \times 2 = 222]
[259 - 222 = 37]
剩余部分等于 (11c + d = 37)
假设 (c = 3)
[11 \times 3 = 33]
[37 - 33 = 4]
剩余部分等于 (d = 4)
所以我们得到 (a = 1),(b = 2),(c = 3),(d = 4)。
验证一下:
[1111 \times 1 + 111 \times 2 + 11 \times 3 + 4 = 1111 + 222 + 33 + 4 = 1370]
结果正确。
因此,(abcd) 的值是 (1, 2, 3, 4)。