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-07-01 13:37
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Share][Original] Batch Script to Write Big Character Special Effect Editor View 1,884 Replies 4
Original Poster Posted 2008-12-28 13:53 ·  中国 广东 揭阳 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline
First published at http://www.cn-dos.net/forum/viewthread.php?tid=45423&fpage=1
Author: 523066680
blog: http://hi.baidu.com/523066680

Just for entertainment, a whim. If it wastes everyone's time, please don't mind.
The special regret is that the code is quite long.

@echo off&setLocal enabLedeLayedexpansion
::made by 523066680 2008-12-25
title made by 523066680@cn-dos.net
mode con coLs=45 Lines=22
set num=0123456789abcdefghi
set L0=0 1 2 3 4 5 6 7 8 9 a b c d e f g h
for /l %%a in (1,1,18) do (set L=□!L!)
for /l %%a in (1,1,18) do (set L%%a=%L%)
for /l %%a in (0,1,18) do (set n!num:~%%a,1!=%%a)
for /l %%a in (0,1,18) do (echo, !L%%a! !num:~%%a,1!)

:a
set /p n="(yx): "
if "%n%"=="quit" (exit)
if "%n%"=="exit" (echo,@set evern=%evern%>x.x &exit)
set evern=%evern% %n%
if "%n:~-1%"=="#" (set "str=□") else (set "str=■")
if "%n:~3%"=="" (set "do=::") else (set "do=")

set /a ya=n%n:~0,1%,xa=n%n:~1,1%,xa2=xa+1
%do% set /a yb=n%n:~2,1%,xb=n%n:~3,1%,xb2=xb+1
%do% set "YorX=%n:~4,1%" &set "add=%n:~5,1%"

:a-1
set L%ya%=!L%ya%:~0,%xa%!%str%!L%ya%:~%xa2%!
%do% set /a %YorX%a%add%=1,xa2=xa+1
%do% if not !%YorX%a! equ !%YorX%b! (goto :a-1)
%do% set L%ya%=!L%ya%:~0,%xa%!%str%!L%ya%:~%xa2%!

:echo
ping -n 1 127.1>nul
cLs
for /l %%a in (0,1,18) do (echo, !L%%a! !num:~%%a,1!)
goto :a


0 1 2 3 4 5 6 7 8 9 a b c d e f g h 0
□□□□□□□□□□□□□□□□□□ 1
□□□□□□□□□□□□□□□□□□ 2
□□□□□□□□□□□□□□□□□□ 3
□□□□□□□□□□□□□□□□□□ 4
□□□□□□□□□□□□□□□□□□ 5
□□□□□□□□□□□□□□□□□□ 6
□□□□□□□□□□□□□□□□□□ 7
□□□□□□□□□□□□□□□□□□ 8
□□□□□□□□□□□□□□□□□□ 9
□□□□□□□□□□□□□□□□□□ a
□□□□□□□□□□□□□□□□□□ b
□□□□□□□□□□□□□□□□□□ c
□□□□□□□□□□□□□□□□□□ d
□□□□□□□□□□□□□□□□□□ e
□□□□□□□□□□□□□□□□□□ f
□□□□□□□□□□□□□□□□□□ g
□□□□□□□□□□□□□□□□□□ h
□□□□□□□□□□□□□□□□□□ i

Usage:
Directly input coordinates, such as: 10, which will draw the point at the 0th number in the first line on the screen, actually the first point in the first line
If you regret entering this point, enter 10# again to remove this point
For slanted curves, you can only draw point by point.
If it is a vertical line or a horizontal line, you can input the coordinates of the two endpoints and "parameters"
For example, if you need to draw points from position 1 to f in the first line, from 11 to 1f, enter 111fx+
If from 1f to 11, enter 1f11x-; for a vertical line, for example, 10i0y+ or i010y- because it is a straight line, so one of the coordinates is fixed
(It's all requirements for the user... If you enter incorrectly, it will go into an infinite loop)
You can still cancel the entire line, for example: 111fx+#
(The one with # at the end means cancellation)

When a character is edited,
Enter exit to end, and the code entered during the process will be output to the x.x file. The code records the order. Paste it at the beginning of the already compiled special effect script line, and it's done. Actually, the special effect script and the code of the editor are mostly the same. The editor is just to facilitate seeing the result and editing, and the special effect script just automatically "inputs" the original input information once.
Enter quit to end, and no x.x file will be generated

Because there is a part to cancel the drawn point with the # symbol, the special effect will generally copy the process. For example, if there is 111dx+ 111dx+# in the input information, find this part, remove 111dx+ 111dx+#, and the process will skip this.

The following is a special effect template:

The code in the first line is an example, and there is a process of writing wrong and then erasing. You can try to remove 1b1cx+ 1b1cx+# and then see again.
To see your own editing effect: replace the entire line of the code you edited with the first line of the following code.

@set evern= 1151y+ 1316x+ 1636y+ 3633x- 3353y+ 5356x+ 181bx+ 1b1cx+ 1b1cx+# 1b 1b5by+ 383ax+ 585ax+
@echo off&setLocal enabLedeLayedexpansion
mode con coLs=40 Lines=22
color 40
set "L0=" &set "num=0123456789abcdefghi"
for /l %%a in (1,1,18) do (set L=□!L!)
for /l %%a in (1,1,18) do (set L%%a=%L%)
for /l %%a in (0,1,18) do (set n!num:~%%a,1!=%%a)
for %%a in (%evern%) do (call :a %%a)
pause
exit
:a
set n=%~1
if "%n:~-1%"=="#" (set "str=□") else (set "str=■")
if "%n:~3%"=="" (set "do=::") else (set "do=")
set /a ya=n%n:~0,1%,xa=n%n:~1,1%,xa2=xa+1
%do% set /a yb=n%n:~2,1%,xb=n%n:~3,1%,xb2=xb+1
%do% set "YorX=%n:~4,1%" &set "add=%n:~5,1%"
:a-1
set L%ya%=!L%ya%:~0,%xa%!%str%!L%ya%:~%xa2%!
call :echo
%do% set /a %YorX%a%add%=1,xa2=xa+1
%do% if not !%YorX%a! equ !%YorX%b! (goto :a-1)
%do% set L%ya%=!L%ya%:~0,%xa%!%str%!L%ya%:~%xa2%!
%do% for /l %%a in (1,1,3) do (ping -n 1 127.1>nul)
:echo
for /l %%a in (1,1,3) do (ping -n 1 127.1>nul)
cLs
for /l %%a in (0,1,18) do (echo, !L%%a!)
goto :eof


In fact, after modification, it can also be used to edit and obtain character patterns. The following is the combination of characters edited by yourself (not very well compiled...):
 
 ■
■■ ■
■■■■■■■■ ■■■■■■■■■
■■■■ ■■■
■■■ ■■■■■■■■
■■■■■■■■■■■■■■ ■■
■■■ ■■
■■■■■■■ ■■
■■■ ■■■■■■■■■■■
■■■■■ ■
■■■■■ ■
■■■ ■
■■■ ■
■■■■ ■

 
 
 
■■ ■
■■ ■
■■■■■■■■ ■■
■■■■ ■■■■
■■■■■ ■■
■■■■■ ■■
■■■■■■■■■■■ ■■
■■ ■
■■ ■
■■■ ■■■
■■■ ■■■
■■■ ■■■
■■■■ ■
■ ■
 ■■
 

[ Last edited by 523066680 on 2008-12-28 at 14:15 ]
Recent Ratings for This Post ( 2 in total) Click for details
RaterScoreTime
Helloworld +1 2008-12-28 13:57
HAT +2 2008-12-28 20:49
Floor 2 Posted 2008-12-28 13:56 ·  中国 广东 江门 电信
中级用户
★★
Credits 338
Posts 175
Joined 2007-10-21 15:30
18-year member
UID 100351
Gender Male
Status Offline
That's pretty good. Why not make one that supports the mouse?
http://www.bathome.cn/thread-2919-1-1.html
Floor 3 Posted 2008-12-28 14:07 ·  中国 台湾 中华电信(HiNet)数据中心
初级用户
Credits 26
Posts 25
Joined 2008-11-07 16:06
17-year member
UID 130293
Gender Male
Status Offline
Heheh, a great batch script to write big character special effect editor. Got it and will study it. ;)
Floor 4 Posted 2008-12-28 14:11 ·  中国 广东 揭阳 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline
I'm going to read books, everyone. I really like the world of batch processing, but circumstances force me to leave this world.
(Exaggerated....)

So basically, I'll just take a look at everyone's suggestions for improving the code. I don't have time for major changes.
Floor 5 Posted 2008-12-28 14:15 ·  中国 广东 江门 电信
中级用户
★★
Credits 338
Posts 175
Joined 2007-10-21 15:30
18-year member
UID 100351
Gender Male
Status Offline
Forum Jump: