Rubiks cube

This is a discussion on Rubiks cube within the C++ Programming forums, part of the General Programming Boards category; Wasn't sure where to put this, since it really isn't a game, so I put it here. I just finished ...

  1. #1
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728

    Rubiks cube

    Wasn't sure where to put this, since it really isn't a game, so I put it here.

    I just finished a console based rubiks cube program and need some testing and feedback. Please let me know if you find any bugs or if you see a way to improve (besides updating from console to graphics ) Thanks!

    Hopefully from here I can write a program that SOLVES the cube...
    Attached Files Attached Files

  2. #2
    RoD
    RoD is offline
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    Good job for the most part, i haven't rlly looked at the actual code yet, but as far as use of the program its done fairly well. I would space the cursor down one more line, and perhaps use l,r,u,d or lft,rgt,up,dwn instead of rl, rr, rd, ru, etc.

    Generally well done, however.

  3. #3
    Registered User
    Join Date
    Jan 2002
    Posts
    552
    There seems to be a problem, when I "mixed" the cube it ended up having an edge cell with two reds colors (You know how there are cells with 3 colors (corners), cells with 2 colors (edges), and cells with one color (centers)... well its impossible to have an edge with two of the same color (unless you take off the stickers then place them back on).

    Remember, when you move the "colors" on one side of the cube, your also moving the colors on the adjacent face. Perhaps you might want to have a cell object that the side class will use instead of storing individual colors.
    C Code. C Code Run. Run Code Run... Please!

    "Love is like a blackhole, you fall into it... then you get ripped apart"

  4. #4
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728
    Ack, you are absolutely right! I completely forgot about needing to "twist" the adjacent untouched side when turning one of the outside columns/rows.

    Hmmmm... need to think of the best way to fix that without changing the code TOO much... otherwise your cell object might be the best bet...

    And RoD, you're right about not needing the letter r to rotate, I'll get rid of that when I fix the above problem.

  5. #5
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    when rotating a row or column don't all four faces rotate, not just the one, or the one and the adjacent faces? It's been so long since I played this game I forget how many different colored faces there are (6, a different color for each face of the cube, or some other number.)

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, 06:40 PM
  3. Rubiks cube
    By elad in forum Game Programming
    Replies: 16
    Last Post: 09-27-2008, 10:05 AM
  4. Rubik's Cube
    By sean in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 02-24-2004, 10:25 PM
  5. My rubiks cube program
    By PJYelton in forum C++ Programming
    Replies: 7
    Last Post: 01-20-2003, 09:40 AM

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