DecisionRules Rubik’s cube public release with guidance mode
Unravel the mystery of the world's top-selling puzzle using DecisionRules! As mentioned in our earlier blog post about the iconic Rubik's cube, we have introduced software functioning within the Unity platform that has been specifically designed to decipher the Rubik's cube. This is made possible by utilizing the renowned "CFOP" solution method, thanks to DecisionRules. And now, it's readily accessible to all!
For those who are unfamiliar, allow us to provide a brief background. The Rubik's Cube, initially named the "Magic Cube", was the brainchild of a professor of architecture, Erno Rubik, in 1974. However, this cube was far more than just a plaything. Its intent was to promote an understanding of relationships within 3-dimensional spaces. Despite this, in today's world, it's primarily regarded as a toy rather than an educational tool.
If you're keen to delve deeper into the rich history of the Rubik's Cube or explore the basic techniques our software employs to crack its code, don't miss out on our previous blog post!
The Journey from Showcase to Tutoring
When we first showcased our Rubik's cube solving software, it served as an awe-inspiring demonstration of the versatility and complexity that DecisionRules could handle. Now, we have evolved beyond merely being a tool; DecisionRules has become a personal tutor for those keen on mastering the Rubik's cube. Our advanced algorithms and user-friendly interface make it a unique learning platform.
REST API calling
You probably recognise the image below
It’s borrowed from our latest post about RC. Why are we bringing it now? That’s because we have made a significant improvement in our REST API calling. As you probably already know, when you want to solve Rubik’s cube in our software in Unity, it calls (executes) DecisionRules through REST API call using UnityWebRequest. In this call, you need to specify in what state your Rubik’s cube is and DecisionRules will send you an algorithm tailored specifically for your cube. Each algorithm will bring you a little closer to the solved state, just like in “CFOP”. But what if you stop in the middle of an algorithm? To tackle this, we have introduced 'algorithm stashing'. For a clearer picture, check out the UML diagram below.
New Guide Mode
The latest release comes equipped with a newly-integrated Guide Mode that offers users an interactive experience with DecisionRules, thanks to its integration with Unity. Guide Mode is not just a feature; it's an interactive teaching companion. It takes you by the hand, providing step-by-step instructions and visual aids, demystifying the intricate algorithms required to solve the cube. It bridges the gap between theory and practice, turning even complete novices into proficient cube solvers.
Custom State Definition for a Personalized Experience
Another innovation is the Custom State Definition feature, which gives users the power to define the specific configuration of their Rubik's cube. Whether it's a standard scramble or a custom permutation, DecisionRules' robust algorithm can recognize and analyze it. Defining a cube's current state is no longer a tedious task but an easy and efficient process. It takes only about two minutes, adding a personal touch to the cube-solving experience and making it more engaging and rewarding.
So, how do you define your cube in practice?
Choose your color and paint it, just like a painter would! This method is very user-friendly, intuitive, and fast. Additionally, you don’t need a camera to scan your cube. For those who are fans of programming, I'll show you how this works in this code:
This method is responsible for choosing which face is closest to your tap.
This one is responsible for returning the closest face to you, so you can paint it.
It’s not all about painting
Defining your cube is essential, but what happens if you make a mistake? No worries, we’ve got you covered. Our custom definition mode checks for a valid permutation using four rules:
- Checks to see if all colors have been assigned.
- Checks for colors that can't be adjacent.
- Checks to see if the cube doesn't contain any twisted corners.
- Checks for any duplicate corners/edges.
Thanks to these rules, your imported cube can always be solved.
How long does it take to solve your own imported cube?
In the worst-case scenario, it takes around 40 algorithms. However, you'd be quite unlucky if it has taken that long. Most solutions require approximately half of that number. It could be fewer, but we decided that making simpler moves is more important than confusing users with more complex solutions.
Let's see how to use our solver in practice!
Now that you understand how our software works, it's time to dive in and try it out for yourself. When you first launch our application, you should be greeted with this interface:
As you can see, you have the option to either define your own cube or jump straight into solving. Let's explore the cube definition feature first.
1. Define the Cube
Regardless of the permutation, DecisionRules has got you covered. Simply take your cube and replicate its configuration on the virtual one.
2. Start solving
If you've finished setting up your cube, or if you prefer to dive straight in, it's time to do some solving!
Accessibility and Compatibility: Learning without Boundaries
Perhaps one of the most exciting aspects of this new release is the software's universal accessibility. Built on WebGL, DecisionRules' Rubik's cube software is device-agnostic, ready to run on virtually any device with a web browser and internet connection. Whether you're at home on a desktop, on the go with a tablet, or using a mobile phone during your commute, you can learn and practice solving the Rubik's cube. It's an anywhere, anytime learning solution.
Join Us in the Cube-Solving Adventure
For those intrigued and eager to embark on this exciting journey, DecisionRules and all of its innovative features are readily available online in our sample applications. Delve into the intriguing world of Rubik's cube algorithms, logic, and techniques. Explore, learn, and challenge yourself in a way that transcends mere gaming. It's an educational experience designed to stimulate and inspire minds of all ages and abilities.
Interested in tracing back our journey? You can revisit our previous post about Rubik’s Cube to see how far we've come.
A special thanks to Erik Lehocký for his invaluable support and guidance during this project.
With DecisionRules, solving a Rubik's cube is no longer a perplexing puzzle but an engaging hobby, a mental exercise, and a platform for growth. Try it out and join us in the fascinating world of cube solving.
Happy solving!