#print all combinations of 6 ones and 12 zeros for( 0b000000000000111111..0b111111000000000000 ) { my $x = sprintf("%018b",$_); next unless $x =~ /^0*10*10*10*10*10*10*$/; printf "$x\n",$_; }
Edit Masem 2002-02-19 - Added CODE tags, changed title from "Is there a faster way to do this?"
In reply to Permutations in binary by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |