Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

RE: Cryptogram Generator

by btrott (Parson)
on Feb 07, 2000 at 23:30 UTC ( #3006=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    open IN, $infile or die "Can't open input file: $!";
    
  2. or download this
    my %set;
    my $substit = "";
    ...
            while $set{$randchar}++;
        $substit .= $randchar;
    }
    
  3. or download this
    my @alpha = split //, "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    
  4. or download this
    my @crypt = @alpha;
    fisher_yates_shuffle(\@crypt);
    
  5. or download this
    my $substit = join '', @crypt;
    
  6. or download this
    sub fisher_yates_shuffle {
        my $array = shift;
    ...
        }
        return join '', @$array;
    }
    
  7. or download this
    Benchmark: timing 5000 iterations of orig, f_yates, hash...
          orig: 33 secs (23.60 usr  0.00 sys = 23.60 cpu)
       f_yates:  5 secs ( 2.88 usr  0.00 sys =  2.88 cpu)
          hash: 13 secs ( 5.68 usr  0.00 sys =  5.68 cpu)
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://3006]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (17)
As of 2014-09-22 18:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (198 votes), past polls