Author Topic: Rubik's Cube (Updated)  (Read 20393 times)

0 Members and 1 Guest are viewing this topic.

Offline Qwerkey

  • Forum Resident
  • Posts: 755
    • View Profile
Rubik's Cube (Updated)
« on: December 20, 2018, 10:31:56 am »
This is an updated version of my Rubik's Cube program which first appeared at the now-defunct [abandoned, outdated and now likely malicious qb64 dot net website - don’t go there].

This program is for your personal use only.

You will need the User Manual.

Cube manipulations are performed by Function Key.  Perhaps manipulation by using the mouse would be easier, though when I first created the program I found this too difficult.  Perhaps such a later version might be easier for the user, although once you get used to the F-keys the program is user-friendly enough, I think.


If I may immodestly say, I believe that this program would have some marketability and would have been a good one for QB64.org to sell.  But Rubik's Cube and any graphical representation of it are copyrighted.  I was only allowed to put this program onto QB64 by agreeing that it will only be used for hobbyists. 

You may not distribute any files or executable.  Personal use is courtesy of  Rubik's Brand Ltd.
* Rubik's Cube User Manual.pdf (Filesize: 59.68 KB, Downloads: 397)
screenshot.jpg
* screenshot.jpg (Filesize: 214.61 KB, Dimensions: 1014x836, Views: 497)
« Last Edit: November 25, 2021, 07:36:39 am by Qwerkey »

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Rubik's Cube (Updated)
« Reply #1 on: December 21, 2018, 08:53:38 am »
Interesting comparing your version to what I did back in May (Just Basic). I did all my turns 90 degrees clockwise with the right hand using an axis(x, y, z) + layer (1, 2, 3 top down, front to back or left to right) key presses signal. And I also solved by recording the moves and "reversing" them by turning each 3 more times clockwise which effectively eliminates the last move made. I too had no Rubik's cube to experiment with and ended making one of paper to help visualize results of moves. It was a very challenging programming problem.

My screen layout looked like this (after 3 moves, 1st layer of each axis):

EDIT: hmm... first snapshot didn't look right so I ran program x1, y1, z1 and got this screen shot.
Rubix x1, y1, z1.PNG
* Rubix x1, y1, z1.PNG (Filesize: 28.2 KB, Dimensions: 612x483, Views: 461)
« Last Edit: December 21, 2018, 09:17:11 am by bplus »

Offline Qwerkey

  • Forum Resident
  • Posts: 755
    • View Profile
Re: Rubik's Cube (Updated)
« Reply #2 on: December 21, 2018, 10:20:03 am »
It was a very challenging programming problem.

Yes, I think so too.  In fact I could not quite work out what I had done in 2015 when I originally wrote the program.

Offline madscijr

  • Seasoned Forum Regular
  • Posts: 295
    • View Profile
Re: Rubik's Cube (Updated)
« Reply #3 on: November 23, 2021, 05:05:37 pm »
This may be a dumb question, but where is the code?
Thanks

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Rubik's Cube (Updated)
« Reply #4 on: November 23, 2021, 07:07:54 pm »
This may be a dumb question, but where is the code?
Thanks

There is a link from the manual:
https://www.dropbox.com/s/weos935r9w66fki/Rubik's%20Cube.zip?dl=0

Offline madscijr

  • Seasoned Forum Regular
  • Posts: 295
    • View Profile
Re: Rubik's Cube (Updated)
« Reply #5 on: November 23, 2021, 10:59:38 pm »

Offline madscijr

  • Seasoned Forum Regular
  • Posts: 295
    • View Profile
Re: Rubik's Cube (Updated)
« Reply #6 on: November 24, 2021, 02:41:37 pm »
This is an updated version of my Rubik's Cube program which first appeared at the now-defunct [abandoned, outdated and now likely malicious qb64 dot net website - don’t go there].

This is awesome @Qwerkey - nice job!

Offline Qwerkey

  • Forum Resident
  • Posts: 755
    • View Profile
Re: Rubik's Cube (Updated)
« Reply #7 on: November 25, 2021, 05:24:26 am »
This is awesome - nice job!

@madscijr Thank you.  You are too kind.

Offline madscijr

  • Seasoned Forum Regular
  • Posts: 295
    • View Profile
Re: Rubik's Cube (Updated)
« Reply #8 on: December 21, 2021, 05:06:48 pm »
Hey @Qwerkey , any chance of expanding this to also handle 2x2 or other size cubes?

Offline Qwerkey

  • Forum Resident
  • Posts: 755
    • View Profile
Re: Rubik's Cube (Updated)
« Reply #9 on: December 23, 2021, 09:29:11 am »
@madscijr I regret that I am unlikely to revisit this project.  It was created rather a long time ago (in a previous version of QB64 which I updated so as to feature it here).  But never say never!


Offline madscijr

  • Seasoned Forum Regular
  • Posts: 295
    • View Profile
Re: Rubik's Cube (Updated)
« Reply #10 on: December 23, 2021, 09:59:51 am »
@madscijr I regret that I am unlikely to revisit this project.  It was created rather a long time ago (in a previous version of QB64 which I updated so as to feature it here).  But never say never!

No worries... Your program is just so good!
Another idea I think what would be cool to see some day, would be
first, to be able to use QB64 to write programs for VR headsets like the Oculus,
and second, to be able to move your cube in VR with your hands,
just like the real thing!

Have a happy holiday and thanks again for sharing that amazing code!