China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-01 08:48
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Another colorful small animation [updated to call a function] View 4,018 Replies 18
Original Poster Posted 2008-04-23 19:20 ·  中国 湖南 株洲 电信
金牌会员
★★★★
永远的学习者
Credits 3,105
Posts 1,276
Joined 2008-03-08 13:00
18-year member
UID 112398
Gender Male
Status Offline
Not yet fully done, posted first:
-----------------------------------
Updated to the function call on the sixth floor (simplifying the code to the greatest extent)
@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 "f4=for /l %%i in (1,1,5) do"
set "sp=set /p= <nul"
:begin
set /a m=%random%%%16
call,color 0%%clo:~%m%,1%%
cls&echo.&call,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%&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%%


[ Last edited by zw19750516 on 2008-4-24 at 05:32 PM ]
Recent Ratings for This Post ( 2 in total) Click for details
RaterScoreTime
huahua0919 +4 2008-04-23 19:26
523066680 +8 2008-07-30 11:54
批处理之家新域名:www.bathome.net
Floor 2 Posted 2008-04-23 19:26 ·  中国 江苏 苏州 移动
银牌会员
★★★
Credits 1,608
Posts 780
Joined 2007-10-07 10:19
18-year member
UID 99089
Gender Male
Status Offline
The command is so familiar
Floor 3 Posted 2008-04-23 22:36 ·  中国 湖南 株洲 电信
金牌会员
★★★★
永远的学习者
Credits 3,105
Posts 1,276
Joined 2008-03-08 13:00
18-year member
UID 112398
Gender Male
Status Offline
```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 ]
批处理之家新域名:www.bathome.net
Floor 4 Posted 2008-04-23 22:43 ·  中国 陕西 西安 电信
银牌会员
★★★★
钻石会员
Credits 2,278
Posts 1,020
Joined 2007-11-19 13:34
18-year member
UID 103127
Gender Male
Status Offline
It is suggested that brother simplify the code. Such code is too repetitive: otherwise, the colstr function is written in vain.
山外有山,人外有人;低调做人,努力做事。

进入网盘(各种工具)~~ 空间~~cmd学习
Floor 5 Posted 2008-04-23 22:46 ·  中国 湖南 株洲 电信
金牌会员
★★★★
永远的学习者
Credits 3,105
Posts 1,276
Joined 2008-03-08 13:00
18-year member
UID 112398
Gender Male
Status Offline
I don't want that function. It's not very useful. I'll write one myself.
批处理之家新域名:www.bathome.net
Floor 6 Posted 2008-04-23 22:56 ·  中国 陕西 西安 电信
银牌会员
★★★★
钻石会员
Credits 2,278
Posts 1,020
Joined 2007-11-19 13:34
18-year member
UID 103127
Gender Male
Status Offline
Hey, Helpless......
山外有山,人外有人;低调做人,努力做事。

进入网盘(各种工具)~~ 空间~~cmd学习
Floor 7 Posted 2008-04-24 17:28 ·  中国 湖南 株洲 电信
金牌会员
★★★★
永远的学习者
Credits 3,105
Posts 1,276
Joined 2008-03-08 13:00
18-year member
UID 112398
Gender Male
Status Offline
```@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 ]
```
批处理之家新域名:www.bathome.net
Floor 8 Posted 2008-04-24 18:12 ·  中国 陕西 西安 联通
初级用户
Credits 63
Posts 32
Joined 2007-12-21 20:57
18-year member
UID 106402
Gender Male
Status Offline
The upstairs is it! But, why is there still a strange file generated under the directory -- ○●
Floor 9 Posted 2008-04-25 13:39 ·  中国 广西 百色 中移铁通
银牌会员
★★★
永远的菜鸟
Credits 1,335
Posts 574
Joined 2007-11-27 12:50
18-year member
UID 103929
Gender Male
From 广西
Status Offline
Originally posted by zw19750516 at 2008-4-24 17:28:
@echo off&color 0c&mode con cols=45 lines=5&title 小动画
set a=●&set b=○&set clo=0123456789abcdef
:begin
set /a m=%random%%%16
call if "%m%"=="0& ...

call if "%m%"=="0" goto begin

[ Last edited by moniuming on 2008-4-25 at 01:44 PM ]
Floor 10 Posted 2008-04-25 14:03 ·  中国 广东 揭阳 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline
Floor 11 Posted 2008-04-25 14:10 ·  中国 江西 赣州 安远县 电信
银牌会员
★★★★
Credits 2,025
Posts 1,122
Joined 2007-09-05 20:15
18-year member
UID 96653
Gender Male
Status Offline
Floor 12 Posted 2008-04-25 15:19 ·  中国 江西 赣州 安远县 电信
银牌会员
★★★★
Credits 2,025
Posts 1,122
Joined 2007-09-05 20:15
18-year member
UID 96653
Gender Male
Status Offline
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 :(
Floor 13 Posted 2008-04-25 15:33 ·  中国 湖南 株洲 电信
金牌会员
★★★★
永远的学习者
Credits 3,105
Posts 1,276
Joined 2008-03-08 13:00
18-year member
UID 112398
Gender Male
Status Offline
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 ]
批处理之家新域名:www.bathome.net
Floor 14 Posted 2008-04-25 17:03 ·  中国 江西 赣州 电信
银牌会员
★★★★
Credits 2,025
Posts 1,122
Joined 2007-09-05 20:15
18-year member
UID 96653
Gender Male
Status Offline
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 -_-#
Floor 15 Posted 2008-04-29 17:43 ·  中国 广东 东莞 电信
新手上路
Credits 16
Posts 8
Joined 2006-12-07 00:46
19-year member
UID 72764
Gender Male
Status Offline
Newcomer here.

It's a bit dizzying to look at.

It seems I need to study hard.
Forum Jump: