I coded this fully-functional Rubik’s Cube simulation in under 48 hours as part of a coding challenge. Rubik’s cubes had become really popular in my school. I had become curious about how to simulate them logically–the main four objectives of this project were: 1) capture input, how can the user rotates the different sides of the cube, 2) group the individual cubelets logically so that they would be regrouped every time the cube was turned, 3) animate the cube correspondingly, 4) model the cube in a game-ready fashion.
The logic was reasonably straightforward, however, having it worked in a polished fashion was the trickiest part. I decided to use a cycle selector that would cycle through the sides to let you turn them with the arrow keys.