I have to program a solver for a Rubik's cube 2x2x2, but i'm not getting it. I've already thought about some solutions, but not getting there
Can someone help me?
I have to program a solver for a Rubik's cube 2x2x2, but i'm not getting it. I've already thought about some solutions, but not getting there
Can someone help me?
There is a full fledged example in SWI-Prolog distribution, with interactive GUI. It's a fairly complex sample, you will need to remove a large part of (relatively) non interesting stuff.
If you install SWI-Prolog in Windows, you can find it from menu:
Help / XPCE (GUI) Manual ... / File / Demo Programs ... / Rubiks Cube
Dennis Merritt has published a detailed account of the Rubik's cube puzzle in the PC AI magazine, and his account is available on the site of the Amzi! Prolog. He covers a 3x3x3 cube but the discussion of the data representation as well as the main structure of the solution should be applicable in your case as well.