I'm currently building a robot which solves a Rubik's Cube. I use an Android phone to scan the cube and I want to solve it in Andr开发者_如何学JAVAoid too. Is there a library which can solve a Rubik's Cube?
Thanks in advance
There is a VB 6.0 source code on this page: http://www.dutchthewiz.com/vb/games/
Porting the algorithm to Java will not be that difficult.
The problem comes in what type of cube you are doing? 2x2, 3x3, 4x4, 5x5 etc. Each of those will use the same algorithm to switch corners and edge pieces, however the trickier part will come with the center blocks.
http://www.wrongway.org/cube/solve.html is a good site to go to, you might be able to talk to the author about his algorithms.
http://www.swinburne.edu.au/ict/videos/media/Rubiks_cube_robot_480X270.html is another interesting site.
Don't be afraid to talk to people who have developed these ideas and solutions. They are sometimes willing to help you design yours.
Check out: http://sourceforge.net/projects/rubikcube3x3pac/
精彩评论