
BAT畫畫由cmd1152和路過共同制作
需要第三方Cmos求評(píng)分QWQnclick="copycode($('code0'));">復(fù)制代碼
- @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=32,#y=32
- call :Clear
- call :ReAlloc %#x% %#y%
- :Loop 繪圖
- setlocal
- for /l %%a in (1,1,%#y%) do (set li%%a=┃
- for /l %%b in (1,1,%#x%) do (for /f %%c in (!.%%b.%%a!) do (set li%%a=!li%%a!!$%%c!)))
- cls
- echo;┏%$w%┓
- for /l %%a in (1,1,%#y%) do (echo;!li%%a!┃)
- echo;┗%$w%┛
- echo;保存讀取清除調(diào)整
- echo;%$%
- endlocal
- ::檢測鼠標(biāo)
- 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 defined .%nX%.%Y% (set/a .%nX%.%Y%=%.s%)
- 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,wy=#y+#z/#x+6
- mode con cols=%wx% lines=%wy%
- goto :eof
- :Save 保存
- cls&echo;保存到 *.batht2
- set /p bcwjm=文件名(不要后續(xù)名):^>
- (for /f delims= %%z in ('set #^&set .') do (echo;%%z))>%bcwjm%.batht2
- goto :eof
- :Read 讀取
- cls&echo;讀取 *.batht2
- set /p dqwjm=文件名(不要后續(xù)名):^>
- if exist %dqwjm%.batht2 (
- FOR /F delims= %%z in (%dqwjm%.batht2) 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 .s=0
- goto :eof
- :Adjust 調(diào)整窗口大小
- cls&echo;調(diào)整窗口大小
- set /p ckdx=請(qǐng)輸入新的窗口大小(格式[x,y],如[32,32]。):
- 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)
- call :ReAlloc %#x% %#y%
- goto :eof

