Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re^3: Challenge: "Insanity" Cube Puzzleby Limbic~Region (Chancellor) |
on Jul 06, 2006 at 16:58 UTC ( [id://559626]=note: print w/replies, xml ) | Need Help?? |
Ieronim,
I told liverpole in the CB that I didn't really have time to play with this but since he indicated I was the reason he posted it as a Challenge (see some of my previous posts), I felt obligated to do so. Without thinking about it too much, I decided just to brute-force it and then see if there were any obvious optimizations on that. I do not expect it to be the fastest but it is fast enough. With regards to benchmarking, it is almost never a good idea to include IO. Basically, the routines should be verified to produce essentially the same results first and then the output should be omitted. In other words, doing any preparation IO work before the bench, run the bench, and omit any IO output. Update: Depending on how you count, the following only loops 1,152 times and still finds duplicates. And the following performs even fewer (< 500): Cheers - L~R
In Section
Meditations
|
|