Home>

### Batch processing to achieve chaotic rain (Matrix effects)

This article gives you a summary of the 3 types of digital rain effects similar to the Matrix that are implemented using batch processing.If you learn, you can also do special effects in Hollywood ^ _ ^

Without further ado,Go directly to the previous effect code

``````@echo off & mode con cols=42 lines=20 & color 02
set m=1&set v=1
set code == ^^^&%%%^:! \$#^>^<:== * ()@"" `;\ | -_ +?,. ghijklmnopqrstuvwxyz0123456789abcdef
setlocal enabledelayedexpansion
:begin
set/a num =%random %%%40 + 1, num1=num, num=200/num
title Rainstorm,Current rainfall:%num1%
:lp
set/a a =%random %%%63, b =%random %%%%numnum%
set a =! code:~%a%, 1!
if%b%equ 0 (set "b =! a!") else (set "b =")
set str%m%=! str%m%!! b!
set/a n +=1
if%n%lss 40 goto lp
set/a x +=1, w +=1
if%x%equ 40 call:lop
cls&for/l %%i in (%m%,-1,%v%) do echo.! str %%i!
set/a m +=1
if%m%geq 20 set/a v +=1
if%w%equ 100 (set w=0&goto begin) else (set n=0&goto lp)
:lop
set/a a =%random %%%15 + 1
set a =! code:~-%a%, 1!
color 0! a!&set x=0
``````

A little friend said,Why not change it to 101010?Isn't that like a picture in the Matrix???

Alright, let's make it happen

``````@echo off & mode con cols=42 lines=20 & color 02
setlocal enabledelayedexpansion
set code=123456789abcdef
set m=1&set v=1
title Digital Rain of the Matrix by bat-zw19750516
:begin
set/a a =%random %%%2, b =%random %%%3
if%b%neq 0 (set b =%a%) else (set "b =")
set str =%str %%b%
set/a n +=1
if%n%lss 40 goto begin
set/a m +=1, x +=1
if%m%geq 20 set/a v +=1
set str%m%=%str%
cls&for/l %%i in (%m%,-1,%v%) do echo.! str %%i!
if%x%equ 20 call:lp
set str =&set n=0
goto begin
:lp
set/a a =%random %%%15, x=0
set a =! code:~%a%, 1!
color 0%a%
``````

Of course the above is highly handwritten,Let's take a look at the simple completion of a novice

``````@echo off
title The Matrix Rain Effect
color 02
setlocal enabledelayedexpansion
for/l %%i in (1,1,80) do (
set down %%i=0
)
:heike
for/l %%j in (1,1,80) do (
set/a guxing %%j-=1
if! guxing %%j! lss 0 (
set/a hanye %%j =! random! %%​​4
set/a guxing %%j =! random! %%​​15 + 10
)
if "! hanye %%j!" == "1" (
set/a shu =! random! %%​​2
set/p =! shu!<nul
) else (
set/p =<nul
)
)
goto heike
``````

Is there a new understanding of this special effect?Do i want to master batch processing immediately?Work hard, guys.

• Previous The basics of a complete PHP regular expression tutorial