- @echo off&setlocal enabledelayedexpansion&cls&color 1a
- for /l %%1 in (1 1 80) do set "space= !space!"
- set /p side=请输入边长(默认值10,最大值38,最小值2)---
- set /a "y.center.min=%side%/2+4"
- set /a "x.center.max=79-%side%"
- set /a "y.center.max=42-%y.center.min%"
- set /p x.center=%side%^<"中心x坐标"^<%x.center.max%--请输入[默认值40]--
- set /p y.center=%y.center.min%^<"中心y坐标"^<%y.center.max%--请输入[默认值21]--
- set /a "side1=%side%-1"
- set /a "byte=%side%*2"
- set /a "side2=%side%-2"
- set /a "side3=%byte%-4"
- set /a "x.left=%x.center%-%byte%/2"
- set /a "x.right=%x.center%+%byte%/2"
- set /a "y.up=%y.center%-%side%/2"
- set /a "md=%side%%%2"
- if %md%==0 (set /a "y.up=%y.up%+1")
- set /a "y.down=%y.center%+%side%/2"
- mode con cols=80 lines=42
- :up
- for /l %%i in (1 1 !side2!) do (
- cls
- set /a "y.echo=!y.down!-%%i"
- for /l %%j in (1 1 !y.echo!) do echo.
- for /l %%k in (1 1 %%i) do (call echo %%space:~-!x.left!%%■)
- for /l %%1 in (1 1 30) do (call echo.>nul)
- )
-
- :right
- for /l %%i in (1 1 !side1!) do (
- cls
- for /l %%i in (1 1 !y.up!) do echo.
- set square.right=■!square.right!
- call set /p=%%space:~-!x.left!%%!square.right!<nul
- echo.
- for /l %%1 in (1 1 !side2!) do (call echo %%space:~-!x.left!%%■)
- for /l %%1 in (1 1 30) do (call echo.>nul)
- )
- :down
- for /l %%i in (1 1 !side1!) do (
- cls
- for /l %%j in (1 1 !y.up!) do echo.
- call set /p=%%space:~-!x.left!%%<nul
- for /l %%1 in (1 1 !side!) do set /p=■<nul
- echo.
- set /a "high=%%i-1"
- set /a "high1=!side2!-!high!"
- for /l %%k in (1 1 !high!) do (
- call echo %%space:~-!x.left!%%■%%space:~-!side3!%%■
- )
- for /l %%k in (1 1 !high1!) do (call echo %%space:~-!x.left!%%■)
- for /l %%1 in (1 1 30) do (call echo.>nul)
- )
-
- :left
- for /l %%i in (1 1 !side!) do (
- cls
- for /l %%j in (1 1 !y.up!) do echo.
- call set /p=%%space:~-!x.left!%%<nul
- for /l %%1 in (1 1 !side!) do set /p=■<nul
- echo.
- for /l %%2 in (1 1 !side2!) do (call echo %%space:~-!x.left!%%■%%space:~-!side3!%%■)
- call set sp=%%space:~-!x.right!%%
- set /a "ll=%%i*2"
- call set /p=%%sp:~!ll!%%<nul
- set square1=!square1!■
- set /p=!square1!<nul
- for /l %%1 in (1 1 30) do (call echo.>nul)
- echo.
- )
- echo.
- set rr="%space:~-17%---顺时针描点%side%x%side%正方形by myzwd------------"
- echo >%rr%
- findstr /a:cb .* %rr%*
- del %rr%
- pause >nul
复制代码
|