* ken: WAP fixes.
[filters.git] / jibberish
CommitLineData
7e3afbba 1#!/usr/bin/perl
2# jibberish -- run all filters in random order
3
4$ENV{PATH}.=":/usr/games";
5
6@all= qw(
dc17484a 7eleet
8b1ff
9chef
10jethro
11upside-down
12kraut
13cockney
7e3afbba 14jive
7e3afbba 15nyc
0652168f 16rasterman
dc17484a 17);
18
19@nonfree= qw(
20kyoote
7e3afbba 21newspeak
7e3afbba 22);
23
dc17484a 24# Test to see if non-free filters are here, if so, add them to @all.
25foreach (@nonfree) {
26 if (-x "/usr/games/$_") {
27 push @all, $_;
28 }
29}
30
7e3afbba 31# shuffle order
32srand;
33for (0..$#all) {
34 my $n= @all*rand;
35 my $was= $all[$_];
36 $all[$_]= $all[$n];
37 $all[$n]= $was;
38}
39
40# start the pipe...
41my $pipe= join '|', @all;
42open FILTER, "$pipe|"
43 or die ""Never mind...\n";;
44
45# display the results
46while (<FILTER>) {
47 print $_
48}
49
50# This could be optimized: take the last program off the pipeline,
51# open the pipeline as standard input, then exec that last program.
52#
53# But you have to ask yourself: how important is it to optimize
54# the generation of jibberish?
This page took 0.013077 seconds and 4 git commands to generate.