中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-09-16 07:02
47,812 topics / 349,917 posts / today 0 new / 48,268 members
DOS批处理 & 脚本技术(批处理室) » Another colorful small animation [updated to call a function]
Printable Version  4,352 / 18
Floor1 bat-zw Posted 2008-04-23 19:20
金牌会员 Posts 1,276 Credits 3,105
Not yet fully done, posted first:
-----------------------------------
Updated to the function call on the sixth floor (simplifying the code to the greatest extent)


[ Last edited by zw19750516 on 2008-4-24 at 05:32 PM ]
Floor2 huahua0919 Posted 2008-04-23 19:26
银牌会员 Posts 780 Credits 1,608
The command is so familiar
Floor3 bat-zw Posted 2008-04-23 22:36
金牌会员 Posts 1,276 Credits 3,105
```batch
@echo off&color 0c&mode con cols=45 lines=5&title 小动画
set a=●&set b=○&set clo=0123456789abcdef
set "f1=for /l %%i in (1,1,10) do"&set "f2=for /l %%i in (1,1,20) do"
set "f3=for /l %%i in (1,1,40) do"
set "sp=set /p= <nul"
:begin
set /a m=%random%%%16
call,color 0%%clo:~%m%,1%%
cls&echo.&echo
echo.
call :lp
%f2% %sp%>%a%&findstr /a:%c% .* "%a%*" 2>nul
%f3% %sp%
call :lp
%f2% %sp%>%b%&findstr /a:%c% .* "%b%*" 2>nul
%f3% %sp%
call :lp
%f1% %sp%>%a%%b%&findstr /a:%c% .* "%a%%b%*" 2>nul
%f3% %sp%
call :lp
%f1% %sp%>%b%%a%&findstr /a:%c% .* "%b%%a%*" 2>nul
%f3% %sp%
call :lp
%f1% %sp%>%a%&findstr /a:%c% .* "%a%*" 2>nul
call :lp
%f1% %sp%>%b%&findstr /a:%c% .* "%b%*" 2>nul
%f3% %sp%
call :lp
%f1% %sp%>%b%&findstr /a:%c% .* "%b%*" 2>nul
call :lp
%f1% %sp%>%a%&findstr /a:%c% .* "%a%*" 2>nul
%f3% %sp%
call :lp
%f2% %sp%>%b%&findstr /a:%c% .* "%b%*" 2>nul
%f2% %sp%
call :lp
%f1% %sp%>%a%&findstr /a:%c% .* "%a%*" 2>nul
%f3% %sp%
call :lp
%f2% %sp%>%a%&findstr /a:%c% .* "%a%*" 2>nul
%f2% %sp%
call :lp
%f1% %sp%>%b%&findstr /a:%c% .* "%b%*" 2>nul
%f3% %sp%
goto begin
:lp
set /a n=%random%%%16
call,set c=%%clo:~%n%,1%%
del /q %a% %b% %a%%b% %b%%a% 2>nul
```

[ Last edited by zw19750516 on 2008-4-23 at 10:45 PM ]
Floor4 plp626 Posted 2008-04-23 22:43
银牌会员 Posts 1,020 Credits 2,278
It is suggested that brother simplify the code. Such code is too repetitive: otherwise, the colstr function is written in vain.
Floor5 bat-zw Posted 2008-04-23 22:46
金牌会员 Posts 1,276 Credits 3,105
I don't want that function. It's not very useful. I'll write one myself.
Floor6 plp626 Posted 2008-04-23 22:56
银牌会员 Posts 1,020 Credits 2,278
Hey, Helpless......
Floor7 bat-zw Posted 2008-04-24 17:28
金牌会员 Posts 1,276 Credits 3,105
```@echo off&color 0c&mode con cols=45 lines=5&title 小动画
set a=●&set b=○&set clo=0123456789abcdef
:begin
set /a m=%random%%%16
if "%m%"=="0" goto begin
call,color 0%%clo:~%m%,1%%
cls&echo.&echo
echo.
call :lp 20 %%a%% 40
call :lp 20 %%b%% 40
call :lp 20 %%a%% 40
call :lp 20 %%b%% 40
call :lp 10 %%a%%%%b%% 40
call :lp 10 %%b%%%%a%% 40
call :lp 10 %%a%%%%b%% 40
call :lp 10 %%b%%%%a%% 40
call :lp 20 %%a%% 20
call :lp 10 %%b%% 40
call :lp 20 %%b%% 20
call :lp 10 %%a%% 40
call :lp 10 %%a%%
call :lp 10 %%b%% 40
call :lp 10 %%a%%
call :lp 10 %%b%% 40
call :lp 10 %%b%%
call :lp 10 %%a%% 40
call :lp 10 %%b%%
call :lp 10 %%a%% 40
goto begin
:lp
set /a m=%random%%%16
if "%m%"=="0" goto lp
for /l %%i in (1,1,%1) do set /p= <nul>%2&findstr /a:%m% .* "%2*" 2>nul
for /l %%i in (1,1,%3) do set /p= <nul
del /q %a% %b% %a%%b% %b%%a% 2>nul
[ Last edited by zw19750516 on 2008-4-26 at 12:18 PM ]
```
Floor8 rootkit Posted 2008-04-24 18:12
初级用户 Posts 32 Credits 63
The upstairs is it! But, why is there still a strange file generated under the directory -- ○●
Floor9 moniuming Posted 2008-04-25 13:39
银牌会员 Posts 574 Credits 1,335 From 广西
Originally posted by zw19750516 at 2008-4-24 17:28:
Floor10 523066680 Posted 2008-04-25 14:03
银牌会员 Posts 1,133 Credits 2,361
Floor11 tireless Posted 2008-04-25 14:10
银牌会员 Posts 1,122 Credits 2,025
Floor12 tireless Posted 2008-04-25 15:19
银牌会员 Posts 1,122 Credits 2,025
This... Does it modify something? After running this script, the font in the system has changed, becoming darker and rounder, a bit like Microsoft YaHei. Maybe it's just my monitor or computer is broken :(
Floor13 bat-zw Posted 2008-04-25 15:33
金牌会员 Posts 1,276 Credits 3,105
Originally posted by tireless at 2008-4-25 15:19:
This... Does it modify something? After running this script, the font in the system changed, becoming darker and rounder, a bit like Microsoft YaHei

Maybe it's just my monitor or computer that's broken :(

Absolutely not, you take a close look at the lp function part, which is just output display. Your problem should be something wrong with your system.

[ Last edited by zw19750516 on 2008-4-25 at 03:36 PM ]
Floor14 tireless Posted 2008-04-25 17:03
银牌会员 Posts 1,122 Credits 2,025
Hey! Okay. After leaving the computer and coming back, it's fine... According to this line of reasoning, it seems like it's a problem with my eyes -_-#
Floor15 jfm034 Posted 2008-04-29 17:43
新手上路 Posts 8 Credits 16
Newcomer here.

It's a bit dizzying to look at.

It seems I need to study hard.
1 2  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023