I made a thing.
GitHub repository: https://github.com/robo-technical-group/rubiks-cube.git
I thought it might be fun to build a Rubik’s Cube simulator in MakeCode Arcade. The controls and interface are basic, but they get the job done.
Up and Down select a move. The current move is printed at the top of the screen. Right applies the move to the cube; Left applies the inverse move. Press A to see a list of your moves. Press B to shuffle or scramble the cube. If you make a mess of your cube, just reset the game.
The core functionality is in cube.ts
. I’ve only built the standard 3x3x3 cube, although I’ve built-in the capability of handling Junior or Mini (2x2x2) and Rubik’s Revenge (4x4x4). For the standard cube, I’ve only built the simple moves. I’ll add the other moves a bit later. (These are now done as of version 0.2.0.) I also have added the capability for simple animations, but I have not drawn them yet. My drafting tools are in storage, and my isometric drawing skills are pretty rusty!
As a kid, I was terrible at the Rubik’s Cube. A couple of years ago, though, I thought I’d pick one up again and actually learn how to solve it. There are a ton of great resources, but an excellent starting point is the Rubik’s Cube official education site, You Can Do the Cube. I’ve been working with my nieces and nephews, all of whom are under the age of ten, with the Rubik’s Cube Mini. It took some practice, but they’re able to solve the junior cube. I’m super proud of them!
This one was a lot of fun. More soon!
TODO
(Roughly in order)
- [X] Add rotation moves (v. 0.2.0)
- [X] Add middle slice moves (v.0.2.0)
- [X] Add shuffle (v. 0.2.0)
- [ ] Add solver (simple solver from You Can Do the Cube)
- [ ] Add test animation
- [ ] Finish animations
- [ ] Add junior cube
- [ ] Add advanced cube