Sorry about the code being a little squished... but I had to do it to make it easier to cut and paste... the code isn't terribly obfuscated or anything as I only spent enough time to get it down from 2k to under 512 bytes... it certainly isn't some confusing 1 liner (drats)...for $p (0..14) { $t[$p] = "000000010000000"; $t[7] = "1"x15; substr($t[$p], $p, 1) = "1"; substr($t[$p], 14-$p, 1) = "1"; } for $x (0..7) { for $y (0..7) { $m[$x+($y*8)] .= substr($t[7-$y+$_], 7-$x, 8) for 0..7; } } $b = "0" x 64; $a = $b; &z($_, $d+1) for 0..63; $s =~ s/([^\n]{8})/$1\n/g; print $s; sub z { my ($p,$d) = @_; ($b & $m[$p]) ne $a?return:eval 'substr($b, $p, 1) = "1"'; $d == 8?eval '$s .= "$b|" if $s !~ /$b/':&z($_, $d+1) for 0..63; substr($b, $p, 1) = "0"; }
Anyway... if any of you are interested enough good luck! If you have any questions about it, need hints or otherwise either post off of the thread or you can email me at gaspode_2000@yahoo.com...
Oh and as with most solutions to puzzles this one takes a pretty good time to find all the solutions... so you'll need a fast computer if you just wanted to let it run to find all the solutions... or let it run over the weekend... so good luck :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Puzzler
by myocom (Deacon) on Jan 19, 2001 at 23:50 UTC | |
by Anonymous Monk on Jan 20, 2001 at 02:17 UTC | |
by TStanley (Canon) on Jan 20, 2001 at 00:03 UTC |