Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: How can one get all possible combinations of a string without changing positions & using window size?

by Kenosis (Priest)
on Apr 21, 2013 at 07:01 UTC ( #1029723=note: print w/ replies, xml ) Need Help??


in reply to Re^2: How can one get all possible combinations of a string without changing positions & using window size?
in thread How can one get all possible combinations of a string without changing positions & using window size?

Perhaps the following will be helpful as a pattern for generation combinations:

use warnings; use strict; my $i = 1; print $i++ . ". $_\n" for glob "{'I','You','We'}{' play',' do not play'}{' soccer'}{' at home.',' at +school.'}";

Output:

1. I play soccer at home. 2. I play soccer at school. 3. I do not play soccer at home. 4. I do not play soccer at school. 5. You play soccer at home. 6. You play soccer at school. 7. You do not play soccer at home. 8. You do not play soccer at school. 9. We play soccer at home. 10. We play soccer at school. 11. We do not play soccer at home. 12. We do not play soccer at school.


Comment on Re^3: How can one get all possible combinations of a string without changing positions & using window size?
Select or Download Code
Re^4: How can one get all possible combinations of a string without changing positions & using window size?
by supriyoch_2008 (Scribe) on Apr 23, 2013 at 16:06 UTC

    Hi Kenosis,

    Thank you very much for the code. Your code will help me solve a problem in computational genomics.

    With deep regards,

      You're most welcome, supriyoch_2008! Am glad it was helpful.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2014-09-02 06:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (20 votes), past polls