字典的文件名在开头定义,句子数量在开头定义
解密- @echo off
- echo %time%
- setlocal enabledelayedexpansion
- set dict=dictionary.txt
- set codex=2
- set "code_1=17-5-5-1 8-2-2-4 17-10-4-4 9-8-3-1 3-2-5-3 21-7-1-2 15-9-1-3"
- set "code_2=24-5-3-1 10-5-3-4 28-5-1-2 3-2-5-3 21-7-1-2 7-10-4-4 25-5-4-4 32-1-5-3 31-3-5-3 25-7-1-2 12-2-4-1 3-2-5-1"
- for /l %%a in (1,1,%codex%) do (set all=!all! !code_%%a!)
-
- ::for遍历记录将要用到的行,避免每次都读取文本。
- for /f "tokens=1,*" %%a in (%dict%) do (
- set now=%%a
- if "!now:~0,1!!now:~-1!"=="第版" (set "na=!now:第=!" &set "na=!na:版=!")
- if "!now:~0,1!!now:~-2!"=="第行:" (
- set "nb=!now:第=!" &set "nb=!nb:行:=!"
- for %%A in (!na!-!nb!) do (
- if not "!all: %%A=!"=="!all!" (
- set Line%%A=%%b
- )
- )
- )
- )
- ::针对那两句
- for /l %%a in (1,1,%codex%) do (
- for %%b in (!code_%%a!) do (
- set "now=%%b" &set "now=!now:-= !"
- set /a n=0
- for %%c in (!now!) do (set /a n+=1 &set num_!n!=%%c)
- set /a col=num_3*8-8+num_4*2-2
- for %%d in (!num_1!-!num_2!) do (set now=!Line%%d!)
- for %%d in (!col!) do (set /p=!now:~%%d,1!<nul)
- )
- echo,
- )
- echo %time%
- pause
复制代码 加密
- @echo off
- echo %time%
- setlocal enabledelayedexpansion
- set dict=dictionary.txt
- set /a sayx=2
- set "say_1=我想他肯定知道这个地方有段好难走的路"
- set "say_2=当敌人冲过来后你就拉响前面的警报"
- for /l %%a in (1,1,50) do (set one=111111!one!)
- for /l %%a in (1,1,%sayx%) do (
- set count=!say_%%a!#%one%
- set count=!count:~0,300!
- set count=!count:*#=!
- set /a count%%a=300!count:1=-1!-1-1
- for /l %%n in (0,1,!count%%a!) do (set "str_%%a=!str_%%a!!say_%%a:~%%n,1! ")
- set strx_%%a=!str_%%a!
- )
- set /a na=0
- ::for遍历记录将要用到的行,避免每次都读取文本。
- for /f "tokens=1,*" %%a in (%dict%) do (
- set now=%%a
- if "!now:~0,1!!now:~-1!"=="第版" (set /a na+=1,nb=0)
- if "!now:~0,1!!now:~-2!"=="第行:" (
- set /a nb+=1
- set now=%%b
- for /l %%A in (1,1,%sayx%) do (
- for %%B in (!str_%%A!) do (
- if not "!now:%%B=!"=="!now!" (
- set count=!now:*%%B=!#%one%
- set count=!count:~0,300!
- set count=!count:*#=!
- set /a count=300!count:1=-1!-1,count=40-count,nc=count/8+1,nd=count%%8+1,nd=nd/2
- for %%C in (!na!-!nb!-!nc!-!nd!) do (
- set strx_%%A=!strx_%%A:%%B=%%C!
- )
- set str_%%A=!str_%%A:%%B=!
- )
- )
- )
- )
- )
- for /l %%a in (1,1,%sayx%) do (echo !strx_%%a! &echo,)
- echo %time%
- pause
-
复制代码
[ 本帖最后由 523066680 于 2009-11-24 09:40 编辑 ] |