Programming Challenge!

Member
Posts: 196
Joined: 2003.10
Post: #1
Hi all!

So my girlfriend is a Math major, and she's spent the last few days obsessing over this rubix cube. Frankly, I don't have the patience for it - I spend about 3 minutes with it and get frustrated. But what I thought would be neat is if I could program some sort of brute force algorithm to solve it.

Now I'm sure this has been done countless times before, but here's my challenge:

Program in Objective C and Cocoa a program that will solve a rubix cube. Bonus points if you determine how to solve it using rules (to be followed in real life). Bonus points if your program actually displays a rubix cube. Major points if it's 3D. Major uber geeking rights if you can "play" - i.e. if you can rotate the segments yourself. Super incredible bonus geeking rights if you can peel off the stickers and cheat Wink

I think this should be a fun one. I look forward to seeing what people come up with. Note that the Obj-C and Cocoa is just a suggestion. Use your preferred API. Oh, and all source has to be open - I want to see how you do it!

Let's say a week time deadline, starting at the time of this post. Cheers!
Quote this message in a reply
Member
Posts: 41
Joined: 2005.02
Post: #2
Not to rain on your parade, but there's been a few implementations already...

http://www.javaonthebrain.com/java/rubik/
http://lar5.com/cube/ (bottom right solves it)
http://osx.hyperjeff.net/Apps/apps.php?s...0&t=0&fm=1

But that doesn't mean you can't have fun doing it.

~ Travis
Quote this message in a reply
Moderator
Posts: 771
Joined: 2003.04
Post: #3
blobbo Wrote:So my girlfriend is a Math major, and she's spent the last few days obsessing over this rubix cube. Frankly, I don't have the patience for it - I spend about 3 minutes with it and get frustrated.
[...]Major uber geeking rights if you can "play" - i.e. if you can rotate the segments yourself.
[...]

I spend about 2 minutes and I solve it Wink
My record was 45 seconds (many times), but... well, eventually you get bored of solving it Rasp

As ieafan said, there are already plenty of implementations, none of which use brute force - ask your Math major girlfriend how many different combinations are there for just 10 "rotations" Wink (quarter or half turn of any face/slice, including the middle one)
They are all based on rules (except for a few lame ones that can only "scramble and rollback every move" but they don't really "solve" anything!).

Note: It takes way more than 10 rotations Wink

Edit: New Record! 4 (four) " Wink " smilies in a single post! Woohoo!!!
Blush
Quote this message in a reply
Member
Posts: 41
Joined: 2005.02
Post: #4
PowerMacX Wrote:Edit: New Record! 4 (four) " Wink " smilies in a single post! Woohoo!!!
Blush

I saw "New Record! 4" and I thought you were going to tell us you solved a cube in four rotations. I was gonna flip out. Wink
Quote this message in a reply
Member
Posts: 509
Joined: 2002.05
Post: #5
Funny, I just got into the Rubik's cube, I have worked my way down to a 1:14 fast time with an average of 1:35 in about 3 weeks, my goal is an average of 1:00 and I am still learning new algorithms

Any cube can be solved in 28 or less moves, with there being 12 moves for the first move and 11 for each other move (no going forward and back to the same spot again) that would leave 12*11^27 combos for brute force . Thats a big number.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  GamePress Greatest Game Challenge VPrime 1 1,252 Oct 28, 2013 06:15 PM
Last Post: VPrime
  Moscrif game development challenge Turok 0 2,609 Oct 1, 2012 08:38 AM
Last Post: Turok
  Google AI Challenge OneSadCookie 13 12,053 Dec 2, 2010 06:42 PM
Last Post: PowerMacX
  Announcing the Macworld 2010 GameSalad Challenge! GameSalad 3 6,402 Dec 30, 2009 06:23 PM
Last Post: pinguoren
  Cocoa 48-Hour Programming Challenge Carlos Camacho 24 15,185 Jan 30, 2004 12:25 PM
Last Post: Oather