rsiedl has asked for the wisdom of the Perl Monks concerning the following question:
my $n = 4; for my $i (1..2**$n-1) { for my $j (0..$n-1) { if ($i & 2**$j) { print $j, "\n"; } # end-if } # end-for } # end-for
if ($i & 2**$j) { } # end-if
Any help would be appreciated.if ($i == 2**$j) { } # end-if
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: understanding for loops
by BrowserUk (Patriarch) on Nov 21, 2004 at 11:10 UTC | |
by rsiedl (Friar) on Nov 21, 2004 at 11:14 UTC | |
|
[DONE ;-)]
by Luca Benini (Scribe) on Nov 21, 2004 at 11:33 UTC | |
|
Re: understanding if conditions
by pg (Canon) on Nov 21, 2004 at 18:20 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |