in reply to all binary combinations
sub bits { glob join "", map "{0,1}", 1..$_[0] } say for bits(10); __END__ 0000000000 0000000001 0000000010 0000000011 0000000100 0000000101 ... 1111111011 1111111100 1111111101 1111111110 1111111111
Update: On second thoughts, that's too long:
Yes, perlrocks, perl rocks!sub bits { glob "{0,1}" x $_[0] }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: all binary combinations
by ikegami (Patriarch) on Sep 04, 2009 at 17:09 UTC | |
by FunkyMonk (Bishop) on Sep 04, 2009 at 23:05 UTC | |
by perlrocks (Acolyte) on Sep 05, 2009 at 15:33 UTC | |
|
Re^2: all binary combinations
by perlrocks (Acolyte) on Sep 04, 2009 at 16:12 UTC | |
by FunkyMonk (Bishop) on Sep 04, 2009 at 16:31 UTC | |
by ikegami (Patriarch) on Sep 04, 2009 at 16:24 UTC | |
by perlrocks (Acolyte) on Sep 04, 2009 at 16:27 UTC | |
by ikegami (Patriarch) on Sep 04, 2009 at 17:07 UTC |