『楼 主』:
问题1:请问如何把批处理的显示刷新搞的又稳又快?
使用 LLM 解释/回答一下
假设有一个批处理模拟信息态玩具广义汉字编程电脑,
再假设其为三个部件组成:
1显示屏输出批处理
2键盘输入批处理
3二元存取储存字典运算的机体批处理
问题1:时间调的慢了,处理文本信息就反应不过来,调的快了,又闪眼睛。
这是不是无法解决的必然?
否则如果是有方法解决,请教如何解决?
@echo off
setlocal enabledelayedexpansion
mode con cols=200 lines=15
:0
for /f "skip=72" %%i in (%~fs0) do (
set a=%%i
set a=!a:1=□!
set a=!a:2=▉!
echo !a!
)
ping -n 5 127.0.0.1>nul
cls
goto 0
------------------------------------------
1批处理bat屏幕程序区:
1.1
@echo off
隐藏一些电脑执行过程内容,可能这样就主要显示结果了。
1.2
setlocal enabledelayedexpansion
变量延迟的东东,代码都是DOS联盟论坛,批处理之家,网络搜索抄来的,有了这才管用。
1.3
mode con cols=200 lines=15
设置CMD界面,手动字体5*8,程序里写200。这样一个长条的点阵屏幕就有了
1.4
:〇
goto跳转循环的引子,引导goto那句到这里再开始。(用数字会引导goto过来,所以用汉字
零表达下意思)
1.5
for /f "skip=72" %%i in (%~fs0) do (
代表自身的“%~f0”这个文本对象,选择数出来的从0算第72行,从1算是实际73行。
对指定行以后的内容处理,就是那121212组成的方阵。
1.6
set a=%%i
设置一个变量a对接for语句处理的%%i变量,也就是代号内容。
1.7
set a=!a:1=□!
用!!包围的a变量处理内容里,1替换成□。
1.8
set a=!a:2=▉!
用!!包围的a变量处理内容里,2替换成▉。
1.9
echo !a!
用!!前后包围,显示变量a整体,或者按照顺序显示现在a的样子。
1.10
)
与上面 1.5那个for语句的执行do后面括号对接,完整一句。
1.11
ping -n 5 127.0.0.1>nul
时间秒间隔,调整n后面的数字。
1.12
cls
清屏,写入,再循环,不加这个就一段一段的显示。
1.13
goto 0
跳转到 1.4 第4行句后面,循环执行。
------------------------------------------
2下面是屏幕显存区,通过修改显存,改变点阵。点阵先排16行,对应16点阵的字符,排满100列。
再通过字典加工进行输出需要的字符编码,列和行空间处理。
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122212221122
122212221222122212221222112211222122212221222122212221122112221222122212221222122211221122212221122
111211121211121111121222112111112111212111211111212221121111121112121112111112122211211122212221122
122212221222121111121212122111222122212221211111212121221112221222122212111112121212211122212221122
111212111112121111121212112111112121111121211111212121121111121211111212111112121211211122212221122
122212221222122212221222112211222122212221222122212221122112221222122212221222122211221122212221122
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122212221122
122211211222111211111112112111222112112221112111111121121112221121122211121111111211211122212221122
112111211121112211111121112111121112111211122111111211121111211121112111221111112111211122212221122
122212221222112111221211112111222122212221121112212111121112221222122211211122121111211122212221122
112111211121122111221121112111121112111211221112211211121111211121112112211122112111211122212221122
112112221222121112111112122211121122212221211121111121222111211222122212111211111212221122212221122
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122212221122
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122212221122
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122212221122
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122212221122
Last edited by zzz19760225 on 2021-8-9 at 00:34 ]
Suppose there is a batch processing simulation of an information-state toy general Chinese character programming computer,
and suppose it is composed of three components:
1. Display screen output batch processing
2. Keyboard input batch processing
3. The body batch processing of binary access storage dictionary operation
Question 1: The time is set too slow, and the text information is not responded to, and if it is set too fast, it makes the eyes flash.
Is this an inevitable thing that cannot be solved?
Otherwise, if there is a way to solve it, please ask how to solve it?
@echo off
setlocal enabledelayedexpansion
mode con cols=200 lines=15
:0
for /f "skip=72" %%i in (%~fs0) do (
set a=%%i
set a=!a:1=□!
set a=!a:2=▉!
echo !a!
)
ping -n 5 127.0.0.1>nul
cls
goto 0
------------------------------------------
1. Batch processing bat screen program area:
1.1
@echo off
Hide some computer execution process contents, maybe this will mainly display the results.
1.2
setlocal enabledelayedexpansion
The thing of variable delay, the code is all from the China DOS Union forum, Batch Processing Home, network search and copied, only with this can it work.
1.3
mode con cols=200 lines=15
Set the CMD interface, manually set the font 5*8, and write 200 in the program. In this way, a long dot matrix screen is available.
1.4
:〇
The lead of the goto jump loop, guiding the goto sentence to start here. (Using numbers will lead the goto over, so use the Chinese character "zero" to express the meaning.)
1.5
for /f "skip=72" %%i in (%~fs0) do (
Represent the text object of " %~f0" itself, select the line counted from 0 as the 72nd line, and from 1 it is actually the 73rd line.
Process the content after the specified line, which is the square matrix composed of 121212.
1.6
set a=%%i
Set a variable a to connect to the %%i variable processed by the for statement, that is, the code content.
1.7
set a=!a:1=□!
In the a variable processing content surrounded by!!, replace 1 with □.
1.8
set a=!a:2=▉!
In the a variable processing content surrounded by!!, replace 2 with ▉.
1.9
echo !a!
Surrounded by!! before and after, display the entire variable a, or display the current appearance of a in order.
1.10
)
Connect with the bracket after do of the above 1.5 for statement, a complete sentence.
1.11
ping -n 5 127.0.0.1>nul
Time second interval, adjust the number after n.
1.12
cls
Clear the screen, write, and then loop, without this, it will be displayed paragraph by paragraph.
1.13
goto 0
Jump to the sentence after line 1.4 line 4, and execute the loop.
------------------------------------------
2. Below is the screen video memory area, by modifying the video memory, the dot matrix is changed. The dot matrix is first arranged in 16 lines, corresponding to the characters of 16 dot matrix, and 100 columns are filled.
Then process the output character encoding, column and row space through the dictionary processing.
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122212221122
122212221222122212221222112211222122212221222122212221122112221222122212221222122211221122212221122
111211121211121111121222112111112111212111211111212221121111121112121112111112122211211122212221122
122212221222121111121212122111222122212221211111212121221112221222122212111112121212211122212221122
111212111112121111121212112111112121111121211111212121121111121211111212111112121211211122212221122
122212221222122212221222112211222122212221222122212221122112221222122212221222122211221122212221122
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122212221122
122211211222111211111112112111222112112221112111111121121112221121122211121111111211211122212221122
112111211121112211111121112111121112111211122111111211121111211121112111221111112111211122212221122
122212221222112111221211112111222122212221121112212111121112221222122211211122121111211122212221122
112111211121122111221121112111121112111211221112211211121111211121112112211122112111211122212221122
112112221222121112111112122211121122212221211121111121222111211222122212111211111212221122212221122
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122212221122
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122212221122
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122212221122
111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122212221122
Last edited by zzz19760225 on 2021-8-9 at 00:34 ]
|