Help for this page

Select Code to Download


  1. or download this
    my $length = 3;
    for (0..2**$length-1) {
        printf("%0${length}b\n", $_);
    }
    
  2. or download this
    sub bits {
        my ($length) = @_;
        return map sprintf("%0${length}b\n", $_), 0..2**$length-1;
    }