这是一个签名,我给大概改了一下。大家试试看啊,记得输入时一定要汉语哦。
经过Batcher提醒,把更新信息列出。
更新历史:2008.11.11 可以支持字母,数字,汉字以及之间的相互组合(这里要谢谢youxi01的建议)!
2008.11.12 解决了输入为空输出缺少空格的问题(该问题见八楼)。
为方便比较,代码添加在下面。欢迎大家提供意见!- @echo off
- rem 同甘共苦 誠心誠意 珍貴友誼 分享喜悅
- setlocal enabledelayedexpansion
- set a=◢█◣◢█◣
- set b=█ █
- set c=◥████◤
- set d= ◥██◤
- set e= ◥◤
- set /p cy="请输入你最喜欢的四个成语用(用空格隔开):"
- :a
- set /a num=0
- for %%b in (%cy%) do (
- set /a num+=1
- set a!num!=%%b
- )
- set "str1= "
- set /a _color=!random!%%15
- set str=123456789abcedf
- color 0!str:~%_color%,1!
- for /l %%i in (1 1 3) do (
- set /a s=!random!%%4+1
- set b=█!a%s%!█
- for %%j in (a b c d e) do (
- set str=
- if "%%j" equ "b" set "str= "
- if "%%j" equ "d" set "str= "
- if "%%j" equ "e" set "str= "
- if %%i equ 2 (echo !%%j! !str!!%%j!) else echo !%%j!
- )
- )
- ping -n 1 127.1>nul
- ping -n 1 127.1>nul
- cls
- goto a
复制代码 2008.11.12更新后:- @echo off
- setlocal enabledelayedexpansion
- set a=◢█◣◢█◣
- set b=█ █
- set c=◥████◤
- set d= ◥██◤
- set e= ◥◤
- set /p cy="请输入你最喜欢的四个成语用(用空格隔开):"
- :a
- set /a num=0
- for %%b in (%cy%) do (
- set /a num+=1
- set a!num!=%%b
- )
- set /a _color=!random!%%15
- set str=123456789abcedf
- color 0!str:~%_color%,1!
- for /l %%i in (1 1 3) do (
- set /a s=!random!%%4+1
- if "!a%s%!"=="" (set kong=0) else call :length !a%s%! %kong%
- set /a s1=8-!kong!
- set /a s1=s1/2
- set /a s2=8-!s1!-!kong!
- call :ko !s1! &set str1=!k!
- call :ko !s2! &set str2=!k!
- set b=█!str1!!a%s%!!str2!█
- for %%j in (a b c d e) do (
- set str=
- if "%%j" equ "d" set "str= "
- if "%%j" equ "e" set "str= "
- if %%i equ 2 (echo !%%j! !str!!%%j!) else echo !%%j!
- )
- )
- ping -n 1 127.1>nul
- ping -n 1 127.1>nul
- cls
- goto a
-
- :length
- set sss=a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9
- set var=%1
- set n=0
- for /l %%i in (0 1 10) do (
- set flag=1
- if "!var:~%%i,1!"=="" set kong=!n! && goto :eof
- for %%b in (%sss%) do (
- if /i "!var:~%%i,1!" equ "%%b" (set flag=0 )
- )
- if !flag! equ 1 ( set /a n+=2 ) else set /a n+=1
- )
-
- :ko
- set k=
- if "%1"=="" goto :eof
- for /l %%i in (1 1 %1) do set "k=!k! "
复制代码
|