Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

RE: Cryptogram Generator

by btrott (Parson)
on Feb 07, 2000 at 23:30 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://3006]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (2)
As of 2024-04-20 05:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found