in reply to Re^2: Challenge: "Insanity" Cube Puzzle
in thread Challenge: "Insanity" Cube Puzzle

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

Replies are listed 'Best First'.
Re^4: Challenge: "Insanity" Cube Puzzle
by Ieronim (Friar) on Jul 10, 2006 at 20:21 UTC
    I compared my new solution with your final and semi-final.

    Here's the benchmark's code:

    And here are the results:
    Rate L~R (semi) L~R (final) ieronim (new) L~R (semi) 15.5/s -- -94% -97% L~R (final) 258/s 1566% -- -48% ieronim (new) 500/s 3128% 94% --