Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2021-04-11 06:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?