Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rubik cube challenge...
#1
Here's another idea for a challenge I had which should get the brain stirring without asking the impossible.

The challenge is to write a program which takes as input a rubik's cube, and a list of moves, and the program must then perform the list of moves on the inputted cube, and then return whether the cube is solved or not.
This is distinctly DIFFERENT from a program which actually solves the cube (which might seem at first impossible, although if you complete this challenge you'll find you're more than half-way there).

The input looks like this:

Code:
111
   111
   111
555222333444
222333444555
222333444555
   666
   666
   666
top left
end

and the output would be

Code:
solved

if "top left" had been "top right" then the output would be
"unsolved"

So as you can see, the cube is inputted as an unfolded map, with each color represented by a number 1-6 (although if you really want to make it versatile, make the program take any 6 unique characters as input). The faces go in this order:

Code:
top
left  front  right  back
      bottom

The possible moves are:
Code:
top left
top right
bottom left
bottom right
left up
left down
right up
right down
front clockwise
front counterclockwise
rear clockwise
rear counterclockwise
middle left
middle right
middle up
middle down
middle clockwise
middle counterclockwise
end

obviously, "end" means no more input.

(if you're wondering, "rear clockwise" means clockwise when looking at it from the front, not from the rear).

And the definition of "solved" means:
a solid color on each face, but it doesn't matter which color is on which face.
(so you don't need to worry about things like center rotations and other parity problems)

Again, the program only needs to output whether the ending position is solved or not (and it must do so accurately), nothing more, nothing less.

And for the usual disclaimer, I'm not trying to get others to do my homework (yes, Nemesis, I have already done this one as well). It's just a good way to get the mental juices flowing.

You may post your code in reply to this topic, or email me. I'll probably set up a page on my site for this challenge and post winners.
You may write the program in any language you desire, so long as it can take input from the console as I specified, and prints output to the console (dos screen/linux shell).


Happy coding

-- Eric / neuro
ignatures suck
Reply
#2
Hey guess what!

I was already working on a 3D Rubik cube solver! That's right Rattra! The secret is out!

It's not what you are looking for neuro but I'm going to put what I have so far on up here.

What I have so far:
--3D Rubik engine done
--User Friendly Input done
--Check if input is a valid rubik when user says solve
--Ends program (haven't finished) when user says solve + rubik is a valid

EDIT:
Rubik
i]"But...it was so beautifully done"[/i]
Reply
#3
I'm in...
/post]
Reply
#4
Well not too bad for a program that doesn't do anything yet... you should show the source code and perhaps get some insight into your cube structure.

In case any of you are at all interested in what I've done... this is what became of my program (the algorithm was originally coded in Qbasic believe it or not and later ported to C++, and then totally revised when I started working on a 4x4x4 solver as well)

so yeah, mitth'raw'nuruodo, you should share your code...

peace
ignatures suck
Reply
#5
I would rather not online, only to those people that I can trust with it since its not copywritten. Sad

And no it does do stuff now. It has a checking routine that works and checks to see if the cube is valid (checks to see if the sides can be in the position they're inputed in). If you don't like that then BA! Big Grin

I hope to finish it soon. But the hard part is done, the 3D stuff.
i]"But...it was so beautifully done"[/i]
Reply
#6
well then you should send me the source and I can verify that it does what you say and perhaps give you some insight as to your structures and methods.

otherwise if you just want to show it off, it would probably be best posted in a different forum.

You can email me at the email link on my profile....

one programmer to another
Peace
- Eric
ignatures suck
Reply
#7
Smile Secret out? oh well.. hmm..

Cool Cube, Mitth, but umm, the user set up colors is a little much don't ya think,.. make it auto and random.. :wink:
Kevin (x.t.r.GRAPHICS)

[Image: 11895-r.png]
Reply
#8
Why? The point of the program when I finish it is it to be a Rubik's cube SOLVER....

I don't think a random cube would be much help to those poor souls who can't solve their Rubik.....BTW I CAN solve them...if I couldn't then why would I be making a program that could? Or is How a better question then why?

But in the mean time I don't want to crowd this Challenge with my program so if you want to follow up on this either make a new topic or PM me Rattra.
i]"But...it was so beautifully done"[/i]
Reply
#9
Hey neuro...welcome. I'm a Rubik’s aficionado. I can consistently solve a cube in 3-5 minutes using about 70 moves. I solve the cube about once a week to maintain the skill. Is your algorithm more efficient than ~ 70 moves? if not, let me know, and I'll point you towards my method. I'm not really able to work on the problem right now, but am interested in solving your problem, and would like to be in communication with you as you work on a solution. I can solve the cube and I code in QB and C++, if you want feedback on ideas you are considering. I'm not very available right now except on weekends.

Ciao, and good luck.

Joe
Reply
#10
Hey my solver will be about that efficient but you should be able to solve a rubik faster than that with only 70 moves. Trust me with that amount of moves you could do it in 15 sec. But you gotta practice.

Here's a link.
Speed Rubix Solving Technique
i]"But...it was so beautifully done"[/i]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)