prints:perl -e 'for my $d(0..127){ for (0..3){ next unless ($d & 3<<($_+$_))==0; $count++; } }; print qq|\nCount=$count\n|'
I also considered using 'grep' instead of the inner loop - but this is somewhat clearer.
..to maintain is to slowly feel your soul, sanity and sentience ebb away as you become one with the Evil.
In reply to Re: binary string
by NetWallah
in thread binary string
by alih110
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |