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:
*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 reply to Re: Challenge: "Insanity" Cube Puzzle
by bobf
in thread Challenge: "Insanity" Cube Puzzle
by liverpole
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |