]>
Commit | Line | Data |
---|---|---|
7e3afbba | 1 | #!/usr/bin/perl |
2 | # jibberish -- run all filters in random order | |
3 | ||
4 | $ENV{PATH}.=":/usr/games"; | |
5 | ||
6 | @all= qw( | |
dc17484a | 7 | eleet |
8 | b1ff | |
9 | chef | |
10 | jethro | |
11 | upside-down | |
12 | kraut | |
13 | cockney | |
7e3afbba | 14 | jive |
7e3afbba | 15 | nyc |
bc19f2cf | 16 | ken |
17 | ky00te | |
0652168f | 18 | rasterman |
7e3afbba | 19 | newspeak |
9edc0e61 | 20 | studly |
7e3afbba | 21 | ); |
22 | ||
23 | # shuffle order | |
24 | srand; | |
25 | for (0..$#all) { | |
26 | my $n= @all*rand; | |
27 | my $was= $all[$_]; | |
28 | $all[$_]= $all[$n]; | |
29 | $all[$n]= $was; | |
30 | } | |
31 | ||
32 | # start the pipe... | |
33 | my $pipe= join '|', @all; | |
34 | open FILTER, "$pipe|" | |
35 | or die ""Never mind...\n";; | |
36 | ||
37 | # display the results | |
38 | while (<FILTER>) { | |
39 | print $_ | |
40 | } | |
41 | ||
42 | # This could be optimized: take the last program off the pipeline, | |
43 | # open the pipeline as standard input, then exec that last program. | |
44 | # | |
45 | # But you have to ask yourself: how important is it to optimize | |
46 | # the generation of jibberish? |