本帖最后由 cmd1152 于 2021-8-23 19:24 编辑
需要第三方:sybcexe.exe- @echo off
- title 画画
- color 0f
- set $=%path%
- for /f "delims== eol=$" %%a in ('set ') do (set "%%a=")
- set path=%$%
- setlocal enabledelayedexpansion
- set "$=□▁▂▃▄▅▆▇▏▎▍▌▋▊▉█■★☆▲△▼▽●○◆◇∶∵∴∷※←↑→↓↖↗↘↙┃━┏┓┗┛┣┫┳┻╋×√§◎¤()《》<>①②③④⑤⑥⑦⑧⑨⑩∞∝∽≌∈∩∪∧∨⊙⊕⌒⊿∥⊥∠∫‰%〒℉℃°±╔╦╗╠╬╣╚╩╝═║▓卍卐〓囧の♀♂*‖,。?!:;、·…~&@#︵︶︷︸︹︺︿﹀︽︾﹁﹂﹃﹄︻︼/|\︴_﹏﹍﹎ ̄﹋﹉﹊ˋˇ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
- for /l %%a in (0,1,1024) do (set C=!$:~%%a,1!
- if "!C!" neq "" (set $%%a=!C!&set #Z=%%a))
- set/a #x=19,#y=19
- set ##=0123456789abcdef
- call :Clear
- call :ReAlloc %#x% %#y%
-
- :Loop 绘图
- setlocal
- set sybc0=10000$0f字体颜色!##:~%.f%,1! $0!##:~%.f%,1!画$0f【$00$10$20$30$40$50$60$70$80$90$a0$b0$c0$d0$e0$f0$0f】;$0f背景颜色!##:~%.b%,1! $!##:~%.b%,1!f$0f【$00$10$20$30$40$50$60$70$80$90$a0$b0$c0$d0$e0$f0$0f】
- set/a all=0,ct=1
- sybcexe sybc0
- set sybc1=10200$0f┏%$w%┓;
- for /l %%a in (1,1,%#y%) do (
- for /f %%z in ("!ct!") do (
- set sybc%%z=!sybc%%z!$0f┃
- for /l %%b in (1,1,%#x%) do (
- for /f %%c in ("!.%%b.%%a!") do (
- set/a "sc=%%c %% 16,txt=%%c / 256,fc=(%%c %% 256) / 16"
- for /f "tokens=1-3" %%d in ("!txt! !fc! !sc!") do (set sybc%%z=!sybc%%z!$!##:~%%e,1!!##:~%%f,1!!$%%d!
- set/a all+=5)
- )
- )
- set sybc%%z=!sybc%%z!$0f┃;
- )
- if !all! gtr 6000 (set/a ct+=1,all=0,nl=%%a+3
- set sybc!ct!=1!nl!00)
- )
- set sybc%ct%=!sybc%ct%!$0f┗%$w%┛;$0f保存 读取 清除 调整;$0f%$%
- set sbc=sybcexe
- for /l %%a in (1,1,%ct%) do (set sbc=!sbc! sybc%%a)
- (%sbc%)
- endlocal
-
- ::检测鼠标
- title 画笔!$%.s%!
- cmos 0 -1 1
- set /a P=%errorlevel%
- set /a X=%P:~0,-3%
- set /a Y=%P%-1000*%X%-1
- set /a "nX=(X-1)/2"
- if !y! lss 2 (
- set/a cX=nX-7
- if !cX! geq 0 (
- if !cX! lss 16 (
- if !y!==0 (set/a .f=cX)
- if !y!==1 (set/a .b=cX)
- )
- )
- )
- set/a y-=2
- if defined .%nX%.%Y% (set/a ".%nX%.%Y%=%.s%*256+%.f%+%.b%*16")
- if !Y! gtr %#y% (
- set/a Y-=2
- if !Y!==%#y% (
- set/a sx=nx/2
- if !sx!==0 (call :Save)
- if !sx!==2 (call :Read)
- if !sx!==4 (call :Clear)
- if !sx!==6 (call :Adjust)
- ) else (
- set/a "n=(Y-#Y-1)*wx/2+nx"
- if defined $!n! (set/a .s=n)
- )
- )
- goto :Loop
-
- :ReAlloc [x] [y] 重新分配
- set/a #x=%1,#y=%2
- for /l %%x in (1,1,%1) do (for /l %%y in (1,1,%2) do (if not defined .%%x.%%y (set/a .%%x.%%y=0)))
- set "$w="
- for /l %%a in (1,1,%#x%) do (set $w=!$w!━)
- set/a wx=#x*2+16+10,wy=#y+#z/#x+7
- mode con cols=%wx% lines=%wy%
- goto :eof
-
- :Save 保存
- cls&echo;保存到 *.batsybcht1
- set /p bcwjm=文件名(不要后续名):^>
- (for /f "delims=" %%z in ('set #^&set .') do (echo;%%z))>%bcwjm%.batsybcht1
- goto :eof
-
- :Read 读取
- cls&echo;读取 *.batht
- set /p dqwjm=文件名(不要后续名):^>
- if exist %dqwjm%.batsybcht1 (
- FOR /F "delims=" %%z in (%dqwjm%.batsybcht1) do (set %%z)
- for /l %%x in (1,1,%#x%) do (for /l %%y in (1,1,%#y%) do (if not defined .%%x.%%y (set/a .%%x.%%y=0))))
- call :ReAlloc %#x% %#y%
- goto :eof
-
- :Clear 清空
- for /f "delims==" %%z in ('set .') do (set "%%z=")
- for /l %%a in (1,1,%#x%) do (for /l %%b in (1,1,%#y%) do (set .%%a.%%b=0))
- set/a .s=0,.f=15,.b=0
- goto :eof
-
- :Adjust 调整窗口大小
- cls&echo;调整窗口大小
- set /p ckdx=请输入新的窗口大小(格式[x,y],如[16,16]。):
- for /f "delims=, tokens=1-3*" %%x in ("%ckdx%") do (if "%%y" neq "" (if "%%z"=="" (set/a #x=%%x,#y=%%y)))
- if %#x% lss 8 (set/a #x=8)
- if %#y% lss 8 (set/a #y=8)
- if %#x% gtr 19 (set/a #x=19)
- if %#y% gtr 19 (set/a #y=19)
- call :ReAlloc %#x% %#y%
- goto :eof
复制代码
|