Message Boards Message Boards


A virtual Rubik's Snake

Posted 1 year ago
2 Replies
12 Total Likes

Rubik's Snake

Rubik's Snake is a lesser-known toy (compared to the more famous cube) invented by Ernő Rubik.

I had already written code for rendering a snake in various configurations years ago, but only recently started exploring how to make it interactive, as a toy ought to be. There has been previous Mathematica-related work on the snake (e.g. this one); the difference in my implementation is that you can use dials (done via Experimental`AngularSlider[]) to rotate the segments, customize the number of segments (up to the 24 segments of the classical snake), and change the alternating colors of the segments as a bonus.

Rubik's snake GUI in action

The code is a bit long, so instead of pasting the code here, I've attached a CDF file containing the Rubik's Snake GUI to this post.

To give some of the known patterns as examples, here is the "cobra" configuration:


Here is the "ball" configuration (guess the sequence for making this!):


More configurations to try can be found at websites dedicated to Rubik's Snake, like this one.


Have fun!

2 Replies
Posted 1 year ago

I also make a version a few years before from the view point of robot kinematics. Your different solution of GUI and GraphicsComplex is good for speed. One playful idea of Rubik's snake. Control the joints to transform for one sort of status to another. E.g. bar to ball. As all joints status are changing, constantly. It will look like a real snake.

Rubik's Snake Puzzle

enter image description here

enter image description here - Congratulations! This post is now a Staff Pick as distinguished on your profile! Thank you, keep it coming!

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

Group Abstract Group Abstract