复制代码
- @echo off&setlocal enabledelayedexpansion
- title 对联显示!
- mode con lines=25 cols=60
- set str=年年有余,家事,国事,天下事,风声,雨声,读书声
- set hengpi=%str:~0,4%
- set xialian=%str:~5,9%
- set shanglian=%str:~15,9%
- set c=0
- for /l %%i in (1 1 4) do (
- echo.&echo.&&set /a c+=1
- set /p= !hengpi:~0,%%i!<nul
- ping 127.1 -n 1 >nul
- if !c! lss 4 cls
- )
- echo.&echo.&echo.
- for /l %%j in (0 1 8) do (
- echo !xialian:~%%j,1!
- ping 127.1 -n 1 >nul
- )
- cls&echo.&echo.&echo 年年有余&echo.&echo.&echo.
- for /l %%k in (0 1 8) do (
- echo !shanglian:~%%k,1!
- ping 127.1 -n 1 >nul
- )
- cls&echo.&echo.
- echo 年 年 有 余
- echo 家 风
- echo 事 声
- echo , ,
- echo 国 雨
- echo 事 声
- echo , ,
- echo 天 读
- echo 下 书
- echo 事 声
- pause >nul
复制代码
- @echo off
- echo 批处理之家
- echo 违 版
- echo 规 规
- echo 标 面
- echo 题 前
- echo 必 人
- echo 锁 人
- echo 无 平
- echo 疑 等
- pause
复制代码
- @echo off
- set str=四四四四ABCDEFG1234567
- set "line= "
- set "sleep=ping 127.1 -n 2 >nul"
- echo.
- call :split 4 7 col
- call :split 11 7 col "cls&echo."
- call :split 0 4 line "cls"
- pause>nul
- goto :eof
- :split
- set /a _tmp1=%1+%2-1,count=0
- for /l %%a in (%1,1,%_tmp1%) do (
- set /a count+=1
- %~4
- if %~3 == col (
- call call set %3%%count%%=%%%%%3%%count%%%%%%%line%%%str:~%%a,1%%
- if %~1 == 4 (
- call :cout %%count%% %%count%% %~3
- ) else (
- call :cout 1 7 %~3
- )
- ) else (
- call set %3=%%%3%% %%str:~%%a,1%%
- call :cout 1 7 col "echo %%%3%%"
- )
- %sleep%
- )
- goto :eof
- :cout
- %~4
- for /l %%i in (%1,1,%2) do (
- call echo.%%%3%%i%%
- )
- goto :eof
欢迎光临 批处理之家 (http://bbs.bathome.net/) | Powered by Discuz! 7.2 |