bat代码雨合集

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。

  1. (abcd) 可以表示为 (1000a + 100b + 10c + d)
  2. (abc) 可以表示为 (100a + 10b + c)
  3. (ab) 可以表示为 (10a + b)
  4. (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):

  1. 假设 (a = 1)
    [1111 \times 1 = 1111]
    [1370 - 1111 = 259]

  2. 剩余部分等于 (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)。

  • 11
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是一个简单的爱心.bat代码: ``` @echo off color 0a :start echo. echo ♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥ echo ♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥ echo ♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥ echo ♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥ echo ♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥ echo ♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥ echo ♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥ echo ♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥ echo ♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥ echo ♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥ echo ♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥ echo ♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥ echo ♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥ echo. timeout /t 1 /nobreak >nul goto start ``` 运行后,会在命令行窗口中不断地打印出爱心组成的滴。每秒钟打印一次,可以通过修改 `timeout /t 1` 中的数字来改变打印速度。想要停止程序,直接关闭命令行窗口即可。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值