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-06-24 11:50
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » 【Visual Category】A square frame that gradually expands from the middle and then shrinks + changes color View 4,810 Replies 17
Original Poster Posted 2008-05-25 13:08 ·  中国 广东 揭阳 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline
This version's editing---if exist Q523066680

@echo off&mode con cols=60 lines=30 &color 0a
setlocal enabledelayedexpansion
set omax=oooooooooooooooooooooooooooooooooooooooo
set kmax=%omax:o= %
set n=4

:a
set /a n+=4
set /a upkh=15-%n%/4,kleft=30-%n%/2,zk=%n%-4,zkh=%n%/2-2
set leftk=!kmax:~0,%kleft%!
set zk=oo!kmax:~0,%zk%!oo
set hang=!omax:~0,%n%!
for /l %%a in (1,1,%upkh%) do echo.
echo.%leftk%%hang%
for /l %%a in (1,1,%zkh%) do echo.%leftk%%zk%
echo.%leftk%%hang%
echo.%n%
for /l %%a in (1,1,2) do ping -n>nul
cls
if %n%==40 set /a n=4
goto a

[ Last edited by 523066680 on 2008-7-8 at 10:01 PM ]
Floor 2 Posted 2008-05-25 13:10 ·  中国 广东 揭阳 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline
@echo off&mode con cols=64 lines=32 &color 0a
setlocal enabledelayedexpansion
set omax=oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
set kmax=%omax:o= %
set /a a=0,b=64

:a
if %a% leq 56 (set /a a+=4,n=%a%) else (set /a b-=4,n=%b%)
if %b% equ 0 (set /a a=4,b=60)

set /a upkh=16-%n%/4,kleft=32-%n%/2,zk=%n%-4,zkh=%n%/2-2
set leftk=!kmax:~0,%kleft%!
set zk=oo!kmax:~0,%zk%!oo
set hang=!omax:~0,%n%!
for /l %%a in (1,1,%upkh%) do echo.
echo.%leftk%%hang%
for /l %%a in (1,1,%zkh%) do echo.%leftk%%zk%
echo.%leftk%%hang%
echo.%n%
ping -n>nul
cls
goto a

[ Last edited by 523066680 on 2008-6-3 at 05:08 PM ]
Recent Ratings for This Post ( 5 in total) Click for details
RaterScoreTime
ThinKing +4 2008-05-26 01:19
plp626 +15 2008-05-26 16:47
WANKOILZ +2 2008-05-28 14:13
pusofalse +5 2008-05-28 23:52
26933062 +9 2008-05-29 03:26
Floor 3 Posted 2008-05-26 01:19 ·  中国 湖北 武汉 电信
中级用户
★★
Credits 471
Posts 207
Joined 2007-05-03 14:53
19-year member
UID 87369
Gender Male
Status Offline
Not bad, give an extra point to encourage ~~
Floor 4 Posted 2008-05-26 07:07 ·  中国 江西 南昌 电信
初级用户
Credits 101
Posts 39
Joined 2006-11-21 22:04
19-year member
UID 71280
Gender Male
Status Offline
Please provide the full context or more relevant information so that I can accurately translate and handle this content. Currently, the given content is incomplete for a comprehensive translation and analysis.
Floor 5 Posted 2008-05-26 23:12 ·  中国 重庆 奉节县 电信
中级用户
★★
Credits 363
Posts 162
Joined 2007-04-22 21:31
19-year member
UID 86104
Gender Male
Status Offline
Floor 6 Posted 2008-05-28 14:14 ·  中国 重庆 渝中区 联通
初级用户
★★
Credits 198
Posts 89
Joined 2007-09-06 23:22
18-year member
UID 96746
Gender Male
From 重庆
Status Offline
Nice to see, good effect, especially the second floor.
Floor 7 Posted 2008-05-28 23:03 ·  中国 广东 韶关 电信
高级用户
★★★
CMD感染者
Credits 691
Posts 383
Joined 2008-05-23 00:38
18-year member
UID 119451
Gender Male
Status Offline
Why can't I see the effect
Floor 8 Posted 2008-05-28 23:15 ·  中国 重庆 电信
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
Originally posted by radem at 2008-5-28 11:03 PM:
Why can't I see the effect :(

What is your system version?
What is the name of the batch file you saved?
Is there any error message?

[ Last edited by HAT on 2008-5-29 at 12:39 PM ]
Floor 9 Posted 2008-05-29 18:17 ·  中国 甘肃 兰州 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
Floor 10 Posted 2008-05-29 18:25 ·  中国 广东 韶关 电信
高级用户
★★★
CMD感染者
Credits 691
Posts 383
Joined 2008-05-23 00:38
18-year member
UID 119451
Gender Male
Status Offline
Originally posted by HAT at 2008-5-28 11:15 PM:

What is your system version?
What is the name of the batch file you saved?
Is there any error message?

[ Last edited by HAT on 2008-5-29 at 12:39 PM ]


1.WIN XPSP2
2.t.bat
3.no!

YYYYY???
Floor 11 Posted 2008-05-30 02:04 ·  中国 广东 广州 荔湾区 电信
初级用户
Credits 20
Posts 9
Joined 2008-05-30 01:41
18-year member
UID 120050
Gender Male
Status Offline
Floor 12 Posted 2008-06-01 23:32 ·  中国 湖南 衡阳 祁东县 电信
新手上路
Credits 10
Posts 5
Joined 2008-03-16 15:40
18-year member
UID 113131
Gender Male
Status Offline
Bump
Floor 13 Posted 2008-06-03 17:16 ·  中国 广东 揭阳 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline
The key part of the code on my 2nd floor is in the red part. I want the box to enlarge and then shrink, and I don't want to add too much to the code. Those two ifs are the results of my long thinking!

Personally, if I want to make a circular enlargement, I should first try to make a batch script that displays a quadratic function graph. I will work hard, but I'll only have internet access after the summer vacation. Everyone can also try more! The key points of the above batch script are --- determine the center coordinates (horizontal 32, vertical 16), calculate the number of empty lines above, calculate the number of left spaces, 00 the number of middle spaces 00 and the number of such lines.
Floor 14 Posted 2008-06-22 12:34 ·  中国 广东 揭阳 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline
::This version of the edit---if exist Q523066680
@echo off&mode con cols=68 lines=34
setlocal enabledelayedexpansion
set omax=oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
set kmax=%omax:o= %
set /a a=0,b=60
set /a num1=0,num=0
for %%C in (1 2 3 4 5 6) do (
set /a num1+=1
set color!num1!=%%C
)


:a
if %num% leq 5 (set /a num+=1) else set num=0
color !color%num%!

if %a% leq 56 (set /a a+=4,n=%a%) else (set /a b-=4,n=%b%)
if %b% equ 0 (set /a a=4,b=60)

set /a upkh=17-%n%/4,kleft=32-%n%/2,zk=%n%-4,zkh=%n%/2-2
set leftk=!kmax:~0,%kleft%!
set zk=oo!kmax:~0,%zk%!oo
set hang=!omax:~0,%n%!
for /l %%a in (1,1,%upkh%) do echo.
echo.%leftk%%hang%
for /l %%a in (1,1,%zkh%) do echo.%leftk%%zk%
echo.%leftk%%hang%
echo.%n%
for /l %%g in (1,1,8000) do rem
cls
goto a

[ Last edited by 523066680 on 2008-7-14 at 07:45 AM ]
Floor 15 Posted 2008-06-25 13:31 ·  中国 广东 电信
高级用户
★★★
Credits 740
Posts 373
Joined 2008-05-23 14:40
18-year member
UID 119498
Gender Male
From 中国,广东
Status Offline
Doing these things with P causes extremely high CPU usage. The one upstairs, once started, the CPU usage reaches 60%!
Forum Jump: