Message Boards Message Boards

GROUPS:

DeepCube, a Generalized 3D Cube Puzzle

Posted 3 years ago
10062 Views
|
5 Replies
|
18 Total Likes
|

DeepCube is a computer program written in the Wolfram Language that simulates a generalized 3D cube puzzle. Inspired by the popular and time-tested Rubik's Cube, it extends the original 3x3x3 cube concept to cube lengths ranging from 1 through 9. Additionally, DeepCube models the motions and orientations of interior as well as exterior subcubes, each with all six of their faces viewable and appropriately colored. With a cube length of 5, for example, you are challenged to solve the puzzle by aligning simultaneously 125 subcubes. As far as I am aware, the concept of a "deep" version of a cube puzzle has never been mentioned previously.

The program also supplies several tools to help you see inside the cube and to keep track of your moves as you develop useful layer-rotation sequences. You can see many of these capabilities by running the sequences in the "demos" pop-up menu in the "sequences & patterns" panel.

User documentation is contained mainly in Tooltips, which are available for nearly all controls by hovering over them with the mouse. The best way to start using DeepCube is to jump on in and experiment. See also the Programmer's Notes and User's Notes in the attached notebook where almost every function is documented in detail using headings, plain text and comments.

The current version of DeepCube was developed using Wolfram Mathematica 10 Home Edition (version 10.1.0.0, Microsoft Windows, 64-bit). It requires a screen size of at least 1280 by 1024 pixels. The notebook version runs best with Mathematica 10.1. The CDF file runs best with Wolfram CDF Player 10.1.

Hopefully the Wolfram Community will find DeepCube an interesting and challenging puzzle as well as a neat example of what you can do in the Wolfram Language with a single Manipulate function. I submit this notebook to share some of the programming techniques I've learned while developing DeepCube and I look forward to feedback from the Community.

Many features and capabilities of the Wolfram Language facilitated the development of this simulation including:

  • Animation and flexible controls layout with Manipulate

  • 3D graphics

  • Color support

  • Flexible data structures using nested List's

  • Functional programming paradigm

  • Use of a single Mathematica notebook for all phases of software development (code, test, debug, documentation, etc.)

  • Detailed help system

Screen Shots

The following screen shots illustrate some of the features of DeepCube and the layout of its controls.

enter image description here

enter image description here

enter image description here

enter image description here

Attachments:
5 Replies

This is by far the most complete program (from a UI standpoint) I've ever seen in the Wolfram Language. Obviously there's a lot of content, I doubt I understand even the broad flow, but I hope to follow whats going on soon.

Is the deep cube a known or studied puzzle?

A computer scientist I know is always keen to stress that I can't build serious interfaces in Mathematica, and thus will always be a tinkerer before a programmer. Here I finally have ammunition for a retort!

Posted 3 years ago

Hi David ---

Thank you for your reply and interest. I don't believe DeepCube is a known or studied puzzle. DeepCube is a name I gave to this idea I first thought of in the early days of Rubik's Cube popularity. I did a lot of searching on the Internet and have never found any indication of a "deep" version of the cube puzzle. I've seen mechanical cubes up to 7x7x7 and computer simulations of NxNxN cubes where N is as large as 50. But all of these implement color "stickers" that move around on the outside surface of a cube (or sometimes a sphere or a bloated cube).

Posted 3 years ago

Amazing GUI and program. Will study on it :) Thanks for sharing!

Stunning work, thank you for sharing, Lou !

Can I ask how long did it take to develop this project ?

What was most difficult part ?

Posted 3 years ago

Hi Vitaliy --

Thanks for your interest!

As for how long it took me: Somewhere between a couple of hundred cups of coffee and way too long.

More qualitatively: I purchased the Mathematica 8 Home Edition about three years ago to play with as a retirement hobby. I upgraded to MMA 9 and MMA/WL 10.1 as they became available. During that 3-year period, I worked on and off on DeepCube at an average of very roughly 10 hours a week (with huge variations from week to week and month to month). So, if you want a number, (I hate to admit that) maybe 1500 hours would be a reasonable but very rough estimate. But I had a lot to learn and had a lot of fun.

As far as the most difficult part: Well, Mathematica and the Wolfram Language were new to me. So, there was a learning curve that was further compounded by a big "unlearning" curve to undo old habits from decades of writing code in procedural languages. I should add that the Help system and availability of examples on the Wolfram sites were a huge aid in learning the Wolfram Language.

Another thing that probably accounted for the long development time is that I am not very good at knowing when to quit. There's always the temptation to add more features and to make things more elegant and tidy. And I have yielded to that temptation perhaps more than I should have. But that's part of the fun one can have when one is retired.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract