Thread: Rubiks cube

  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595

    Rubiks cube

    I'm celebrating the completion of my first OpenGL project, a fully functional Rubik's cube (keyboard control only so far). Thanks to everyone here who helped, whether you know you helped or not. Reading other posts to the board has been very helpful. Thanks again everybody.

  2. #2
    Well to thank the board more why don't you post the source to it so that you can help others?

  3. #3
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    Congratulations.
    Do you have the binary somewhere online? I'l bet some love to
    see it!

  4. #4
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    I don't know how to post to a website directly. It's about 1400 lines long so I didn't think I should post the entire thing, but here's the code. I might go back later and try to trim some code, but for now prefer the (semi) clarity of the current form. Hope it works for you:

    NOTE:
    To find the file previously posted here go to my post later in this thread. Sorry about posting it all here before. Will use file attachments now that I know about them.


    I think that should do it anyway. This just sets up a cube and is the first step in a (dream) program to solve an arbitrary cube using an existing algorhithm found online.

    The cube/cubes/disks is/are always in the same orientation relative to the screen; that is the T face/disk is always on top after every twist, the F face/disk is always in front after every twist, etc..

    The major cube has 27 minor cubes. All cubes have six sides, top, bottom, front, right, back, and left. There are nine disks, three for each of the three axis, and are gruoped by the axis on which they rotate. They are: Y axis THB, X axis LVR, Z axis FCK. Caps alone is twist the indicated disk clockwise 90 degree, Cap with suffix m is twist the indicated disk counterclockwise, Cap with suffix 2 is twist the indicated disk 180 degrees (counterclockwise), and Cap with prefix w is whole cube rotation as indicated by given suffix. Clockwise and and counterclockwise are determined by looking at the THB disks from the top face, LVR from the right face, and FCK from the front face of the cube. All twists are controlled by the keyboard only, no mouse activation (yet).
    Last edited by elad; 02-02-2003 at 06:31 PM.

  5. #5
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    Wee, you know that you can attach files when posting here, don't you?
    Please post the exe, I'd really like to try it.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  6. #6
    Registered User
    Join Date
    Dec 2001
    Posts
    479
    this must be the longest code ever posted!

  7. #7
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    In fact I didn't know about the file attachment capability (guess I never paid attention to the area below the input screen). I'll try it and edit away most of the prior post if successful. Thanks.

    Well, file seems downloadable for any that want to make the effort. Have fun. I'll see if I can load the executable file later.
    Last edited by elad; 02-02-2003 at 06:38 PM.

  8. #8
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    Unable to post the .exe to the board by attaching it to the message according to the error message I get when attempting to do so. Sorry.

  9. #9
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728
    Can you zip it?

  10. #10
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    Again, something I've never tried. Never really had anything I wanted to "share with the world" before, so no need previously. I'll try lookig into it.

  11. #11
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    If it works, the attached file is a zipped version of the .exe for the cube.

  12. #12
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    You need this to run the program

  13. #13
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    very cool, you should consider a "save" feature so people can attempt to finish one over time. but definatly well done!! i like it

  14. #14
    Registered User
    Join Date
    Sep 2008
    Location
    Toronto, Canada
    Posts
    1,834
    Hmmmmm. No more interest in Rubik's Cube?

  15. #15
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    You really shouldn't "wake" old threads. It's in the rules. And "old" usually means more than a few days. This thread isn't just a corpse, there's little left of the coffin, and the body is all but gone, and nearly only the bones remaining.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 2d Cubik program in C
    By joot43 in forum C Programming
    Replies: 4
    Last Post: 05-25-2009, 07:17 AM
  2. Simple 2D rubiks cube algorithm.
    By jeanmarc in forum Game Programming
    Replies: 19
    Last Post: 11-11-2008, 07:40 PM
  3. Rubik's Cube
    By sean in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 02-24-2004, 11:25 PM
  4. My rubiks cube program
    By PJYelton in forum C++ Programming
    Replies: 7
    Last Post: 01-20-2003, 10:40 AM
  5. Rubiks cube
    By PJYelton in forum C++ Programming
    Replies: 4
    Last Post: 12-24-2002, 11:30 PM