in reply to One Zero variants_without_repetition
Presuming you don't care about the order, the following may be what you are after:
use strict; use warnings; for my $left (1 .. 4) { for my $right (0 .. $left -1) { printf "%05b\n", (1 << $left) | (1 << $right); } }
Prints:
00011 00101 00110 01001 01010 01100 10001 10010 10100 11000
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: One Zero variants_without_repetition
by thenetfreaker (Friar) on Aug 07, 2007 at 11:11 UTC | |
by GrandFather (Saint) on Aug 07, 2007 at 11:46 UTC | |
by papidave (Pilgrim) on Aug 07, 2007 at 15:08 UTC | |
by tye (Sage) on Aug 07, 2007 at 16:29 UTC | |
by thenetfreaker (Friar) on Aug 07, 2007 at 11:58 UTC | |
by ohcamacj (Beadle) on Aug 08, 2007 at 02:59 UTC | |
by tye (Sage) on Aug 08, 2007 at 05:58 UTC | |
by GrandFather (Saint) on Aug 07, 2007 at 21:03 UTC |