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

Re: character generator

by tmoertel (Chaplain)
on Oct 25, 2004 at 20:00 UTC ( #402295=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
        #!/usr/bin/perl -l
            return \@product;
  2. or download this
        use Data::Dumper;
        $Data::Dumper::Terse = 1;
        print Dumper( combinations( [1..3], ["a","b"] ) ), "\n";
        # [[1,'a'],[1,'b'],[2,'a'],[2,'b'],[3,'a'],[3,'b']]
  3. or download this
        sub charset_combinations {
            my @charsets = map [split//], @_;
            map join("", @$_), @{ combinations( @charsets ) };
  4. or download this
    my @abcees3 = charset_combinations( ("abc") x 3 );
    print "@abcees3\n";
    # aaa aab aac aba abb abc aca acb acc\
    # baa bab bac bba bbb bbc bca bcb bcc\
    # caa cab cac cba cbb cbc cca ccb ccc
  5. or download this
        my @charsets = qw( abc 123 !@$ );
        # 3: a1! a1@ a1$ a2! a2@ a2$ a3! a3@ a3$\
        #    b1! b1@ b1$ b2! b2@ b2$ b3! b3@ b3$\
        #    c1! c1@ c1$ c2! c2@ c2$ c3! c3@ c3$

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2023-06-02 09:39 GMT
Find Nodes?
    Voting Booth?

    No recent polls found