Acme-Matrix

 view release on metacpan or  search on metacpan

lib/Acme/Matrix.pm  view on Meta::CPAN

66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
                for (0..$wchar) {
                        if (int(rand(5) + 0.5) > 4) {
                                my $i = 0;
                                push @{$word_lines{$_}}, (int(rand(1) + 0.5))
                                        ? sprintf("\033[38;5;%sm%s", $COLOURS[int(rand(scalar @COLOURS))], $CHARS[int(rand(scalar @CHARS))])
                                        : map { sprintf("\033[38;5;%sm%s", $COLOURS[$i++], $_) } @{ $WORDS[int(rand(scalar @WORDS))] }, $space;
                        }
                        print shift(@{$word_lines{$_}}) || $space;
                }
                print "\n";
                select(undef, undef, undef, $delay);
        }
}
 
sub shutdown {
        print "\033[0m";
        print "\033c";
        exit;
}
 
__END__



( run in 1.079 second using v1.01-cache-2.11-cpan-49f99fa48dc )