Skip to content

Instantly share code, notes, and snippets.

Created January 15, 2015 01:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/58437645a8aa131ac7b1 to your computer and use it in GitHub Desktop.
Save anonymous/58437645a8aa131ac7b1 to your computer and use it in GitHub Desktop.
my @vert = <0 1 2 03 14 25 36 47 58 6 7 8>;
my @horz = <0 01 02 2 3 34 45 5 6 67 78 8>;
my @bits = (@vert,@horz).map: { [+] .comb.map: 2 ** * };
my $count = 0;
for 8..^24 -> $i {
for 7..^$i -> $h {
for 6..^$h -> $g {
for 5..^$g -> $f {
for 4..^$f -> $e {
for 3..^$e -> $d {
for 2..^$d -> $c {
for 1..^$c -> $b {
for 0..^$b -> $a {
say ++$count, ": $a $b $c $d $e $f $g $h $i"
if 511 == [+|] @bits[$a,$b,$c,$d,$e,$f,$g,$h,$i];
}
}
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment