In a theme similar to the movie Matrix a little procedure to create falling random number animation, and in this example 0's and 1's hence the name binary rain.
MatrixRotaterows := proc (arows, bcolumns, randstart, randend, iterations)
local a, i, b, c, d, e, f, g:
a := Matrix(arows, bcolumns, 0):
for i to iterations do
b := Matrix(1, bcolumns, rand(randstart .. randend)):
a := ArrayTools:-CircularShift(a, 1, 0):
a[1,..] := b:
c := [seq(seq([i, j, a[arows+1-j, i]], i = 1 .. bcolumns), j = 1 .. arows)];
d[i] := plots:-textplot(c, color = COLOR(RGB, 9/100, 21/25, 43/300), font = [Arial, trunc(700/2*arows+2*bcolumns))])
end do:
e := plots:-display(seq(d[i], i = 1 .. iterations), insequence = true, axes = none):
f := plots:-implicitplot(1, x = 0 .. bcolumns+1, y = 0 .. arows+1, coloring = [black, black], filledregions = true):
g := plots:-display({e, f})
end proc:
MatrixRotaterows(28,12,0,1,28) # 28 row, 12 column matrix, random numbers 0 to 1 with 28 iterations
