Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Challenge: "Insanity" Cube Puzzleby bobf (Monsignor) |
on Jul 05, 2006 at 03:52 UTC ( [id://559239]=note: print w/replies, xml ) | Need Help?? |
Interesting puzzle, and a nice challenge. Thanks for the diversion. :-) I don't know if my solution is any more elegant, readable, or speedy*, but here it is: <Reveal this spoiler or all in this thread>
*Update: After downloading and running your code, my solution appears to be a bit faster. The short-circuiting that I used meant that I only checked 12,480 4-block combinations for the given input data, whereas your solution checks 331,776 combinations. I didn't run extensive benchmarks (which might be more interesting once other solutions are posted), but on my box your code took about 50 sec to run and mine took less than 1 sec. Your code has more error checking and output capability, though, so speed isn't everything. :-)
In Section
Meditations
|
|