# Rubik's Cube Simulator

**URL:** https://forum.makecode.com/t/rubiks-cube-simulator/3205
**Category:** Arcade
**Tags:** game, featured-game
**Created:** [August 23, 2020, 6:12pm UTC](https://forum.makecode.com/t/rubiks-cube-simulator/3205 "2020-08-23T18:12:48Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![AlexK](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/alexk/32/33339_2.png) [@AlexK](https://forum.makecode.com/u/AlexK)
#### Post date: [August 23, 2020, 6:12pm UTC](https://forum.makecode.com/t/rubiks-cube-simulator/3205/1 "2020-08-23T18:12:48Z")

</div>

I made a thing. 🙂

> **[Rubik's Cube](https://arcade.makecode.com/67321-67015-32958-55594)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

GitHub repository: [https://github.com/robo-technical-group/rubiks-cube.git](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](https://www.youcandothecube.com). 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

* * *

[See all of my MakeCode Arcade games and extensions here!](https://sites.google.com/site/akulcsarsite/makecode/makecode-arcade)

---

<div class="post-metadata">

### Author: ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)
#### Post date: [August 23, 2020, 11:20pm UTC](https://forum.makecode.com/t/rubiks-cube-simulator/3205/2 "2020-08-23T23:20:41Z")

</div>

Wow. I love Rubik’s cubes literally!!

---

<div class="post-metadata">

### Author: ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)
#### Post date: [August 23, 2020, 11:23pm UTC](https://forum.makecode.com/t/rubiks-cube-simulator/3205/3 "2020-08-23T23:23:02Z")

</div>

I tried making a scrambler but it didn’t work. All I had was numbers instead of the notations

---

<div class="post-metadata">

### Author: ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)
#### Post date: [August 23, 2020, 11:27pm UTC](https://forum.makecode.com/t/rubiks-cube-simulator/3205/4 "2020-08-23T23:27:19Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/8/8b233a2f6fd46f12b6dd9234270a0f88441dd35b.jpeg) ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/a/a857e884656a78a93144d09385c3a1bda96b528c.jpeg)

Went from here to here. I actually know how to solve a bunch of rubiks cubes

---

<div class="post-metadata">

### Author: ![GameGod](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gamegod/32/2756_2.png) [@GameGod](https://forum.makecode.com/u/GameGod)
#### Post date: [August 24, 2020, 2:11am UTC](https://forum.makecode.com/t/rubiks-cube-simulator/3205/5 "2020-08-24T02:11:50Z")

</div>

[![](https://media.tenor.com/images/f74b55fcb7ae6b146e508d325562f84a/tenor.gif) ](https://media.tenor.com/images/f74b55fcb7ae6b146e508d325562f84a/tenor.gif)  
WOW

---

<div class="post-metadata">

### Author: ![LcAtonal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/lcatonal/32/16800_2.png) [@LcAtonal](https://forum.makecode.com/u/LcAtonal)
#### Post date: [August 24, 2020, 6:25am UTC](https://forum.makecode.com/t/rubiks-cube-simulator/3205/6 "2020-08-24T06:25:24Z")

</div>

Omg 😲

---

<div class="post-metadata">

### Author: ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)
#### Post date: [August 24, 2020, 11:16am UTC](https://forum.makecode.com/t/rubiks-cube-simulator/3205/7 "2020-08-24T11:16:52Z")

</div>

Oops wrong photo @AlexK. I gotta get the other one on my phone

---

<div class="post-metadata">

### Author: ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)
#### Post date: [August 24, 2020, 11:26am UTC](https://forum.makecode.com/t/rubiks-cube-simulator/3205/8 "2020-08-24T11:26:18Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/0/03f64e4e1a6d796e1883da69390239a16ddf4924.jpeg)  
All my rubiks cubes!!

---

<div class="post-metadata">

### Author: ![LcAtonal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/lcatonal/32/16800_2.png) [@LcAtonal](https://forum.makecode.com/u/LcAtonal)
#### Post date: [August 24, 2020, 11:35am UTC](https://forum.makecode.com/t/rubiks-cube-simulator/3205/9 "2020-08-24T11:35:41Z")

</div>

Is that cross even a rubix cube?

---

<div class="post-metadata">

### Author: ![AlexK](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/alexk/32/33339_2.png) [@AlexK](https://forum.makecode.com/u/AlexK)
#### Post date: [August 24, 2020, 3:39pm UTC](https://forum.makecode.com/t/rubiks-cube-simulator/3205/10 "2020-08-24T15:39:10Z")

</div>

Sure is! Great puzzle; you can morph it into a whole bunch of shapes. In the U.S., it’s known as the Rubik’s Twist. In other countries, it also was called the Rubik’s Snake.

---

<div class="post-metadata">

### Author: ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)
#### Post date: [August 24, 2020, 5:08pm UTC](https://forum.makecode.com/t/rubiks-cube-simulator/3205/11 "2020-08-24T17:08:31Z")

</div>

they are all fun to play with!!  
Does anyone play with these twisty puzzles?  
I found one of my speedcubes somewhere and I have been trying to find it for about two years?!

---

<div class="post-metadata">

### Author: ![LcAtonal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/lcatonal/32/16800_2.png) [@LcAtonal](https://forum.makecode.com/u/LcAtonal)
#### Post date: [August 24, 2020, 10:48pm UTC](https://forum.makecode.com/t/rubiks-cube-simulator/3205/12 "2020-08-24T22:48:09Z")

</div>

I have two of those!

---

<div class="post-metadata">

### Author: ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)
#### Post date: [August 24, 2020, 11:17pm UTC](https://forum.makecode.com/t/rubiks-cube-simulator/3205/13 "2020-08-24T23:17:05Z")

</div>

Which ones?

---

<div class="post-metadata">

### Author: ![LcAtonal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/lcatonal/32/16800_2.png) [@LcAtonal](https://forum.makecode.com/u/LcAtonal)
#### Post date: [August 25, 2020, 6:42am UTC](https://forum.makecode.com/t/rubiks-cube-simulator/3205/14 "2020-08-25T06:42:52Z")

</div>

The rubix twist/snake

---

<div class="post-metadata">

### Author: ![Agent\_14](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/agent_14/32/17567_2.png) [@Agent\_14](https://forum.makecode.com/u/Agent_14)
#### Post date: [March 8, 2021, 5:24pm UTC](https://forum.makecode.com/t/rubiks-cube-simulator/3205/15 "2021-03-08T17:24:06Z")

</div>

I can only solve the 3x3 (mirror, regular, and image) 2x2 (Regular and Mirror) 4x4 (regular) and I also have the snake.

---

<div class="post-metadata">

### Author: ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)
#### Post date: [March 12, 2021, 4:12pm UTC](https://forum.makecode.com/t/rubiks-cube-simulator/3205/16 "2021-03-12T16:12:30Z")

</div>

I can solve, square-1, 4x4, 5x5, 3x3 and all the mirrors and snake. Plus megaminx

---

<div class="post-metadata">

### Author: ![SoftTalker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/softtalker/32/10776_2.png) [@SoftTalker](https://forum.makecode.com/u/SoftTalker)
#### Post date: [December 27, 2021, 7:20pm UTC](https://forum.makecode.com/t/rubiks-cube-simulator/3205/17 "2021-12-27T19:20:14Z")

</div>

you restarted the rubik’s ube bcz i can see the time 7:26-7:26

---

<div class="post-metadata">

### Author: ![Primal\_Nexus](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/primal_nexus/32/3540_2.png) [@Primal\_Nexus](https://forum.makecode.com/u/Primal_Nexus)
#### Post date: [December 28, 2021, 6:11am UTC](https://forum.makecode.com/t/rubiks-cube-simulator/3205/18 "2021-12-28T06:11:55Z")

</div>

Oh wow, I didn’t even know this thread existed! I can solve 3x3 (I have a GAN) and 2x2.

PB for 3x3: 26.00 (I know I’m surprised it’s exact too)  
PB for 2x2: In the Shadow Realm XD

Go here and import my username (exactly how it is) and then you’ll be able to see my times: [https://ruwix.com/online-rubiks-stopwatch-timer/](https://ruwix.com/online-rubiks-stopwatch-timer/)

---

<div class="post-metadata">

### Author: ![SoftTalker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/softtalker/32/10776_2.png) [@SoftTalker](https://forum.makecode.com/u/SoftTalker)
#### Post date: [December 28, 2021, 7:33pm UTC](https://forum.makecode.com/t/rubiks-cube-simulator/3205/19 "2021-12-28T19:33:16Z")

</div>

it is not possible bcz you need a lot of time to master btw my Pb (Personal Best) is14.90 for3x3 and my Pb  
2x2 is 3.24  
4x4 is1.27.59  
Kilominx is 18.36(a kilominx is technicality a 2x2  
Megaminx)  
and these are my cubes  
Uploading: image.jpg…

---

<div class="post-metadata">

### Author: ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)
#### Post date: [January 3, 2022, 3:55am UTC](https://forum.makecode.com/t/rubiks-cube-simulator/3205/20 "2022-01-03T03:55:17Z")

</div>

Finally. Someone figured it out. Btw I do know how to solve one

[Next page](https://forum.makecode.com/t/rubiks-cube-simulator/3205.md?page=2)
