Thursday night at dinner, one of Stephanie’s colleagues gave me a puzzle to play with.

The idea is to twist and turn the little blocks until they form a 3×3x3 cube. This morning, after messing with it for a few minutes, I decided I didn’t want to brute-force it manually. So I wrote a little script.

And that, my friends, is just about a perfect Saturday morning.

(The script is here.)
Posted on 8 November 2008
- Leave a comment
- Subscribe with Google Reader
- Follow me on Twitter
Did you like this article?
-
Would you mind sharing the script?
-
thanks!
-
You should get one of these for a v2.0

http://www.amazon.com/Winning-Moves-5002-Rubiks-Twist/dp/B00005BY2A -
The only thing missing now is to create a robot to do all the twisting for you.
-
My girlfriend bought me similar puzzle. When I compared it to yours, it seems that they are not the same. Here’s the photo of mine: http://img526.imageshack.us/img526/8053/dsc0056te8.jpg
-
Hi Nat,
I noticed your interesting keyboard in two pieces in the picture. Can you tell which brand and/or model it is? I would like to buy one myself.
-
Nice work!
I had this kind of puzzle to solve:
http://images.google.fi/images?q=Lucifers+Friend+PuzzleI managed to create script to solve it(using bruteforce) but running that script would take ages.. So, then I searched and found found burrtools:
http://burrtools.sourceforge.net/
(I also packaged it in obs, so you can find it using package search)Not sure, if it can solve yours one but amazing software.. Solves many kind of puzzles in seconds.
-
You’re a Linux developer, so could you please explain to me why I spot a Mac keyboard in the background?
-
Glad to see you’re blogging again Nat, and that you’re using ruby. Good stuff!
-
Hi Nat,
does that keyboard ship with the wrist rest part we see in the picture?
-
The script isn’t useless at all Nat. It’s an excellent intro to Ruby and a good demonstration of problem abstraction.
Good job!
-
Pingback from tecosystems » links for 2008-11-09 on 9 November 2008 at 8:06 pm
-
Hey what font do you use in your Emacs? I like the curly brackets
& by the way cool puzzle. -
Spiffy!
-
Wow, nice solution. It is great to see programmers go to great lengths to solve things with programs rather than just figuring it out. Of course, we have to figure it out to solve it in a way.
It reminds me of my high school days writing a program on a TRS-80 in BASIC to balance chemistry equations. It was fun to program but it didn’t make chemistry any better. lol
-
I used to have the same puzzle as a kid, I think. It could make several different shapes and you had to figure them out. I never had the patience for it. I love that you went outside of the box and wrote the script – GENIUS! I don’t think I would have the patience to write that either. What a great Saturday!
-
Wow. Its amazing what programming can do these days. I think the puzzle would have been much more difficult if the tiles were all the same color, rather than different colors.

27 comments