Computer Science Canada To Program a Rubrik's Cube |
Author: | Cervantes [ Mon May 24, 2004 5:31 pm ] |
Post subject: | To Program a Rubrik's Cube |
how oh how?! anyone got any ideas? it can't be just a simple 3x3x3 array because the portions of the cube have different face colours (a corner has 3 colours, for example). perhaps adding another element to the array (from 1 .. 3) to track the colour of each face, but that would quickly become a nightmare. |
Author: | Tony [ Mon May 24, 2004 6:18 pm ] |
Post subject: | |
well its ether 3x3x3 of a type that contains 6 faces or 6x3x3 (6 faces, 3x3 each) ether way, I guess the hardest part would be keeping tack of proper shifts during rotations |
Author: | AsianSensation [ Mon May 24, 2004 7:46 pm ] |
Post subject: | |
OpenGL |
Author: | Andy [ Tue May 25, 2004 9:27 am ] |
Post subject: | |
if any one can make a rubix cube program that solves it completely, i'll award 500 bits. |
Author: | Dan [ Tue May 25, 2004 12:36 pm ] |
Post subject: | |
To make a progame to solve a rubic cube whould not be that hard. There are like 10-20 sets that if you do right no matter what it will solve the cube. Dose not mater where the colors start, if u do a scrent combiation it will all ways solve it. I used to have a book on it . |
Author: | Andy [ Tue May 25, 2004 7:30 pm ] |
Post subject: | |
woa.. cool... but i meant like making it spin and all that... |
Author: | bugzpodder [ Tue May 25, 2004 7:32 pm ] |
Post subject: | |
i dont know 3d graphics maybe i'll learn directX over the summer |
Author: | Tony [ Wed May 26, 2004 8:05 am ] |
Post subject: | |
3D graphics are just the visualization of the cube. For the purposes for the program, 6 separate 2D faces could be displayed just as well |
Author: | Catalyst [ Thu May 27, 2004 6:07 am ] |
Post subject: | |
thats no fun |
Author: | Dan [ Thu May 27, 2004 2:11 pm ] |
Post subject: | |
dodge_tomahawk wrote: woa.. cool... but i meant like making it spin and all that...
Oh, lol. That whould be a cool app to watch. Probly easyested to make it 3dmax and just render it as a video. |
Author: | @DRI@N [ Thu May 27, 2004 9:50 pm ] |
Post subject: | |
Don't go nuts Andy! Rubix Cube is very very hard..... I don't really care about bits that much...do you want mine Andy? [mod:af2b188502="amailer"] Meh, use the edit button next time insted of making a new post, also pm the user for such things as I don't really care about bits that much...do you want mine Andy?[/mod:af2b188502] |
Author: | Andy [ Fri May 28, 2004 8:05 pm ] |
Post subject: | |
ummm im a mod... my bits are set at 1000... and stop posting useless stuff adrian |
Author: | thegoose [ Thu Jun 24, 2004 11:22 am ] |
Post subject: | |
Will random graphs do? There are so many possible solutions for a rubix cube that if you check enough sets of random moves (around 1,000,000) with a little pruning, you are bound to hit one |
Author: | wtd [ Thu Jun 24, 2004 1:39 pm ] |
Post subject: | |
thegoose wrote: Will random graphs do? There are so many possible solutions for a rubix cube that if you check enough sets of random moves (around 1,000,000) with a little pruning, you are bound to hit one
I've tried that. Be prepared to watch your computer sit there and do nothing for a very long time, even if you have a decent computer. |
Author: | thegoose [ Thu Jun 24, 2004 2:35 pm ] |
Post subject: | |
Not if you do it properly, 1,000,000 is nothing programming wise (no recursive search required) |
Author: | Cervantes [ Fri Jun 25, 2004 8:07 am ] |
Post subject: | |
by all means, its worth trying! dan when you say that there are 10-20 sets, are you talking about 10-20 turns and twists and whatnot, or 10-20 tricks? |
Author: | Dan [ Fri Jun 25, 2004 11:44 am ] |
Post subject: | |
Cervantes wrote: by all means, its worth trying!
dan when you say that there are 10-20 sets, are you talking about 10-20 turns and twists and whatnot, or 10-20 tricks? i mean there are 10-20 sets of instuctions to solve it if you start from any random point. |
Author: | thegoose [ Fri Jun 25, 2004 12:46 pm ] |
Post subject: | |
Because of symmetry, there has got to be more than that (I'm expecting at least somewhere in the 5-digits if the path is 80 in length). |
Author: | Tony [ Fri Jun 25, 2004 12:52 pm ] |
Post subject: | |
thegoose - if the path is 80 in length, how many bruteforce solutions will end up wrong? |
Author: | thegoose [ Fri Jun 25, 2004 2:49 pm ] |
Post subject: | |
The point here is that if we hit one 'GOOD' solution, we are done. The good thing here is that the program can run as long as we want (about 1 minute is reasonalbe). If you read probablity books, even if the odds are miniscule, if we try it 1,000,000 (or more, since the cost of checking is linear), the odds compound to be in favour of getting at least 1 right solution. Also, the ones which are obviously stupid (aka. 3 consecutive moves which are the same, you get the idea) can be easily eliminated. I couldn't explain this THAT well online using theories (wholes books were written on this). But it belongs to a catagory of math called random graphs. |
Author: | Tony [ Fri Jun 25, 2004 3:17 pm ] |
Post subject: | |
there are books writen on solving the rubics cube by randomly spinning it around? |
Author: | thegoose [ Fri Jun 25, 2004 3:26 pm ] |
Post subject: | |
No, I was not refering to this specific example. I'm refering to this strategy of solving problem using random generation. The most commonly know example is Monty Carlo while Rubix-cube is just another spin-off. You'll be suprised how many problems which look very difficult can be solved this way. I have a friend who is working on how to solve the Hamiltonian tour (NP-complete) using a spin-off of this method. Because of the typo, I think it's quite interesting to mention that entire books HAVE in fact been devoted to the various methods of solving the rubix cube and I presume this strategy is one of them. |
Author: | TheZsterBunny [ Mon Jun 28, 2004 6:01 pm ] |
Post subject: | |
simple solution: you don't write it to solve the cube, you write it to undo moves made by the user. you start with a difficulty level, and based on that, have the computer make a number of turns (hidden) this allows you to have a legal, solveable cube. now, from this point, you track every move made (in addition to the starting moves), cancel the redundant ones (opposing moves in series) and just trace your steps backwards. seriously, if professors have written books on the subject, and still resort to randomly turning the blocks, its unlikely that teenage novice programmers are going to get it. thats my idea. its a whole lot simpler to script than it is to solve. -Z i remember as a kid, when i couldn't solve the cubes, i'd disassemble them and reassemble them correctly. or, if I was feeling evil, i would create an impossible puzzle, and set the task upon my father. hehehe... |
Author: | thegoose [ Mon Jun 28, 2004 6:24 pm ] |
Post subject: | |
TheZsterBunny wrote: simple solution:
you don't write it to solve the cube, you write it to undo moves made by the user. you start with a difficulty level, and based on that, have the computer make a number of turns (hidden) this allows you to have a legal, solveable cube. now, from this point, you track every move made (in addition to the starting moves), cancel the redundant ones (opposing moves in series) and just trace your steps backwards. seriously, if professors have written books on the subject, and still resort to randomly turning the blocks, its unlikely that teenage novice programmers are going to get it. thats my idea. its a whole lot simpler to script than it is to solve. -Z I take it that we are not looking for a program which lets the user play the Rubix cube, but one where the user inputs the initial configuration and the program gives the solution (or outputs it's not solvable). The finding solution part doesn't look that bad (considering random generator can do the trick), but the part to determine if it's solvable or not is HARD because it's just recursion plus pruning and that can be VERY painful. The profs did not RESORT to randomness. They just mentioned it as ONE OF the possible methods. You'll be surprised on how much programming experience some of the people here got (cough: Bugz, I know you are hiding somewhere). Just as that rabit of yours doesn't look THAT evil |
Author: | bugzpodder [ Mon Jun 28, 2004 9:59 pm ] |
Post subject: | |
thegoose wrote: If you read probablity books, even if the odds are miniscule, if we try it 1,000,000 (or more, since the cost of checking is linear), the odds compound to be in favour of getting at least 1 right solution.
i think thats the stupidest thing i've ever heard... tell your friend to put the program here so we can see how shitty this method is. |
Author: | Tony [ Mon Jun 28, 2004 10:15 pm ] |
Post subject: | |
I'd have to agree with bugz there... cuz the statement holds true only if those miniscule odds are atleast 1 : number_of_random_tries but we don't live in a perfect world, and random remains random. You can flip the coin twice, and not get heads ether time, though according to probability you should have gotten that side half the time. point is that your program still have a 1/1,000,000 chance of getting the right solution at any one point |
Author: | Cervantes [ Tue Jun 29, 2004 8:33 am ] |
Post subject: | |
thegoose wrote: I take it that we are not looking for a program which lets the user play the Rubix cube, but one where the user inputs the initial configuration and the program gives the solution (or outputs it's not solvable). either program would be good. both programs in one would be best |
Author: | the_short1 [ Tue Jun 29, 2004 3:29 pm ] |
Post subject: | |
ok... DAM!... i koi know someone who made an ONLINE rubicks cube SOLVER! u enter in all the colors of each square... and it will show u STEP by step how to solve it... i tried it... and it acually WORKED! ... its so amzing... ill try to get in touch with him to get him to help u.... its so dam amazing! |
Author: | zylum [ Tue Jun 29, 2004 9:04 pm ] |
Post subject: | |
its really not that hard... as hacker dan said, there are certain sets that will complete the cube no matter what the setting (unless it's not a proper rubiks cube ie taken apart and put back together wrong such that there is no solution) |
Author: | the_short1 [ Tue Jun 29, 2004 10:48 pm ] |
Post subject: | |
yea.. but it wa really cook cuz it al depended on what u enter for each square.. and untilizing that to solve... ill try to get link. |
Author: | rizzix [ Fri Jul 02, 2004 1:58 pm ] | ||
Post subject: | |||
aah i knew i had seen it somewhere... and i found it. it was in tutorial demo from apple on opengl/cocoa.. it has the rubics cube solving algorithm ^_^. i've posted the algorithm only.. it requres a couple of ther files to render the cube etc.. also knowledge of obj-c is required.
|
Author: | rizzix [ Fri Jul 02, 2004 2:05 pm ] | ||
Post subject: | |||
pretty straightforward if u ask me and here's what the perfromSequence method would look like:
|
Author: | TheZsterBunny [ Thu Aug 04, 2005 1:09 am ] |
Post subject: | |
http://www.wrongway.org/?rubiksource found this, if anyone still wanted it |