Rubik Cube

This is a discussion on Rubik Cube within the C++ Programming forums, part of the General Programming Boards category; I am student of computer science. And i have a project to make the rubik cube 2X2X2 solver in C++. ...

  1. #1
    Registered User
    Join Date
    Feb 2010
    Location
    Pakistan
    Posts
    6

    Smile Rubik Cube

    I am student of computer science. And i have a project to make the rubik cube 2X2X2 solver in C++. I have used matrices to solve the cube , and cube is solving the scrambled input correctly but a specific input , which means that our rotations are working correctly. Now i have to code for any input. i have red many ways but i am unable to decide which one is the correct and easy way. so kindly if someone know any easy and correct agorithm to solve a rubik cube for any input , share with me.

  2. #2
    Registered User claudiu's Avatar
    Join Date
    Feb 2010
    Location
    London, United Kingdom
    Posts
    2,094
    Can you give an example of what you are saying?
    1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
    2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
    3. Get rid of conio.h and other antiquated DOS crap headers.
    4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.

  3. #3
    Registered User
    Join Date
    Feb 2010
    Location
    Pakistan
    Posts
    6
    i mean that my code is solving for following input , with given rotations.

    2x2x2 Cube Solution

    this is the particular cube. now we have to make a genral solution so it may solve any 2X2X2 cube.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C Help. square and cube a user inputed number
    By Beedee5889 in forum C Programming
    Replies: 5
    Last Post: 03-11-2010, 01:53 PM
  2. 2d Cubik program in C
    By joot43 in forum C Programming
    Replies: 4
    Last Post: 05-25-2009, 08:17 AM
  3. Cube rotation math problem
    By n3v in forum Game Programming
    Replies: 6
    Last Post: 08-03-2007, 06:41 AM
  4. A cube root program.
    By guest111 in forum C Programming
    Replies: 14
    Last Post: 04-27-2007, 10:37 PM
  5. Rubix Cube Contest
    By The Brain in forum Contests Board
    Replies: 24
    Last Post: 01-15-2005, 05:33 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21