第二次写加密,换个方式,我就用findstr ,不过用一次。
在我的机子上平均 0.35秒- @echo off
- echo %time%
- setlocal enabledelayedexpansion
- set dict=dictionary.txt
- set /a sayx=2,act=1,b=1
- 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=300!count:1=-1!-1-1
- for /l %%n in (0,1,!count!) do (set "str_%%a=!str_%%a!!say_%%a:~%%n,1! ")
- set str=!str! !str_%%a!
- )
-
- for /f "tokens=1,2,* delims=: " %%a in ('findstr /n /r "%str%" %dict%') do (
- set now=%%c
- set now=!now:~1!
- set /a na=%%a/14+1
- set nb=%%b
- set nb=!nb:第=!
- set nb=!nb:行=!
- for /l %%A in (1,1,%sayx%) do (
- for %%B in (!str_%%A!) do (
- if not "!now:%%B=!"=="!now!" (
- for /l %%n in (0,1,39) do (if "!now:~%%n,1!"=="%%B" set /a count=%%n+1)
- set /a nc=count/8+1,nd=count%%8+1,nd=nd/2
- for %%C in (!na!-!nb!-!nc!-!nd!) do (
- set say_%%A=!say_%%A:%%B= %%C!
- )
- set str_%%A=!str_%%A:%%B=!
- )
- )
- )
- )
- for /l %%a in (1,1,%sayx%) do (echo !say_%%a! &echo,)
- echo %time%
- pause
复制代码
[ 本帖最后由 523066680 于 2009-11-24 12:08 编辑 ] |