Skip to main content
GameDev.net gamedev.net
🔒 Locked

rubiks cube AI in this program?

Started by harmeht Sep 24, 2004 at 12:13 AM 5 replies 2.7k views
Original Post
harmeht
harmeht
hi, i am trying to write a rubiks cube program and I came along this freeware http://www.atmansoftware.com/webfiles/coda.htm i was wondering if anybody knew how they are doing this? is it actually using an algorithm to solve the cube or is it some hack? it looks convincing to me. i havent checked with a real cube though. any pointers on how to solve the cube in the shortest possible time would be helpful. out of curiousity, is there an opengl for dos? i think i will post this in a diff forum. thank you harmeth
Rixter
Rixter
Oddly enough, I was talking about a program solving a rubik's cube with a friend just today. What he suggested (that a program might do), is it starts with a solved cube, then messes it all up, but you could easily record the moves it made, including those of the user, then when "solved" is pressed, it simply does those moves in reverse order. Sorry I don't have time to check your link, but this would be an easy way to do it.
tekno
tekno
check out:
http://jeays.net/rubiks.htm

And there is some sort of opengl for dos, but then you don't have hardware support, so it's software only....

eleusive
eleusive
There was a guy that held a rubicks cube programming contest awhile ago. Here is the link to the site (you can download the submitted source code, and there are some REALLY smart and efficient algorithms).

http://tomas.rokicki.com/cubecontest/winners.html
"What are you trying to tell me? That I can write an O(N^2) recursive solution for a 2-dimensional knapsack?" "No, programmer. I'm trying to tell you that when you're ready, you won't have to." -Adapted from "The Matrix"
Stru
Stru
Isn't it supposed to be able to be solved with 14 turns from any position? If this is true then you could just brute force try each way until you get it right. This would be the fastest to solve as far as number of turns to get it to completion.

There is also the systematic way to solve it. Thats how I solve them (In real life) but it will require many more turns, and will probably be a little more involved to program (especially if you cant do a real one). This would be the fastest way for the computer to solve it, but not efficient as far as the number of turns you have to make.
shatter
shatter
If you buy an actual cube it comes with the "solution/algorithm" with how to solve it. It should be no problem coding it up from there...also if you google rubik's cube algorithm you can see all kinds of solutions...I guess there is 40+ different ways. Here is one that my brother uses to solve them.
Good Luck!
ICQ 11133295AIM shatterstar98MSN shatter98@hotmail.com

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.