总算做出了自己第一个采用多种特效的批处理,所以cpu自然用很多了~ 不过也因此不必加sleep.com来延时,哈哈~
有几种特效集在一起了:
* 打字特效
* 居中特效
* Matrix特效(从上到下)- @echo off
- title THE BEST MATRIX by Raymai97
- color 2a
- mode con cols=80 lines=25
- setlocal enabledelayedexpansion
- set var=Every great achievement was once considered impossible.
-
- :initrandom
- ::RANDOM init (25 line will init)
- for /l %%i in (1 1 25) do (
- for /l %%j in (1 1 39) do (
- set /a ran=!random! %% 3
- if "!ran!"=="2" set "ran= "
- set l%%i=!ran! !l%%i!
- )
- )
-
- :inittxt
- set varstart=1
- set len_txt=0
-
- :txt_reset
- set txt=!var:~0,%varstart%!
-
- :len_txt_add
- if not "!txt:~%len_txt%!"=="" set /a len_txt+=1&goto len_txt_add
-
- set /a start=76/2-(!len_txt!/2)
- ::odd or even
- set /a tmp=!len_txt!/2*2
- set /a start2=!start!+!len_txt!+2
- set /a start-=2
-
- ::ECHO JOB HERE
- cls
- echo. !l1!
- echo. !l2:~0,%start%! !txt! !l2:~%start2%!
- for /l %%i in (3 1 24) do (echo. !l%%i!)
-
- ::MOVE VAR JOB HERE
- set num=25
- set num2=0
- :movevar
- if "!num2!"=="1" (
- set l1=
- for /l %%i in (1 1 39) do (
- set /a ran=!random! %% 3
- if "!ran!"=="2" set "ran= "
- set l1=!ran! !l1!
- )
- if not "!var:~%varstart%!"=="" (set /a varstart+=1)
- goto txt_reset
- )
- set /a num2=!num!-1
- set l!num!=!l%num2%!
- set /a num-=1
- goto movevar
复制代码
|