Welcome to Coding Corner-this is a regular column about computing and coding in the classroom. Written by Dan Aldred (@Dan_Aldred) who is well worth a follow on Twitter and also has a great new website that has some brilliant ‘How to’ programming guides Dan’s article is about using programming to solve the Rubiks cube!

Before the last half term break I brought my Rubric’s Cube into school. I left it on my desk and instantly several students wanted to play with it. Interestingly, they all knew what one was and knew what the objective of the Cube was.

However, they did not know how to solve it

The next day one student had been out and bought one, at that time the German exchanged students had also arrived and to the amazement of the class, one of them solved the Cube. Other students began to show the student how to complete it. The students discovered the key to this was the use of algorithms.


An algorithm is defined as, a procedure or formula for solving a problem.

There are approximately 10 algorithms required to solve the puzzle, depending on the starting position. It took the student about two weeks to learn and memorise them. He has now purchased the Nano cube, a 2 x 2 sized Rubik’s cube!

Last week I attempted to learn how to solve a Rubik’s Cube, and I was surprised at how similar the processing of remembering and understanding the algorithms is to the process of remembering and understanding code.

The first algorithm is simple and easy to use,this is the same when you begin programming, (Table 1) you remember the simple code very easily. The more advance algorithms around step 5 take time to master, around 2 to 3 days, I still have to refer back sometimes to check the correct orientation. This is like the more challenging code. However, after a while, what you find is that you began to understand what the algorithm is doing. This enabled me to check my moves and predict a mistake or correct an error. This sounds such a minor thing, but it is empowering being able to look at the cube and understand that if you twist a side that way then the cube will be incorrect and so forth.

Once you have learnt the algorithms they allow you to make sense of the Cube and understand it.The impressive element is that after a while they dissolve into the background and you just see the Cube, its ability and the solution. The student described as it like riding a bike, you never forget it. Very few individuals could look at the cube and understand it. This is similar to a program, no one looks at the screen and sees the code, you see the final product, a game, an interface. Very few individuals can look at a program and understand how it works, this is the illusion that a good programs creates. Unless of course you understand the language.

The cubes are also great for group learning, now several student have purchased cubes and with no teacher input, learnt how to solve them

Table 1: Rubik’s Cube / Coding Comparison


Programming language


Program code

Advanced algorithm

Program functions

Ability to recognise errors

Functional error free program

Embedded second nature understanding of the algorithm

Freedom to program what you want

Completed cube

Completed program

If you are interested in solving the Cube these videos are helpful,

Part one is here

Part two is here

And if you really want scary try this?

Now try writing a computer program to solve the Cube for you!

It took me about two weeks to Master the Cube, now I am looking at single handed solving!


Dan Aldred is a teacher of Computing and Head of IT. He is also a member of the school extended leadership team and teacher learning group.  He’s interested in how technology and software move learning forward.

Written by Julian S Wood -"rel="author"
About me
UK Primary School Future Learning Technologist.I am into Experience and Fun Based Learning.I use web tools to stimulate writing. I've been Playing and Learning since 1970. Have some fabulous ideas now & again.. Check out my profile!
Click Here to View All Nominated Educators
My LinkedIn Profile

To see my LinkedIn profile, click here:

Julian S Wood
Email subscription to blog
Privacy Policy
Privacy Policy -

Privacy Policy for

If you require any more information or have any questions about our privacy policy, please feel free to contact us by email at

At, the privacy of our visitors is of extreme importance to us. This privacy policy document outlines the types of personal information is received and collected by and how it is used.

Log Files
Like many other Web sites, makes use of log files. The information inside the log files includes internet protocol ( IP ) addresses, type of browser, Internet Service Provider ( ISP ), date/time stamp, referring/exit pages, and number of clicks to analyze trends, administer the site, track users movement around the site, and gather demographic information. IP addresses, and other such information are not linked to any information that is personally identifiable.

Cookies and Web Beacons does not use cookies.

DoubleClick DART Cookie

.:: Google, as a third party vendor, uses cookies to serve ads on
.:: Google's use of the DART cookie enables it to serve ads to your users based on their visit to and other sites on the Internet.
.:: Users may opt out of the use of the DART cookie by visiting the Google ad and content network privacy policy at the following URL -

Some of our advertising partners may use cookies and web beacons on our site. Our advertising partners include
Google Adsense

These third-party ad servers or ad networks use technology to the advertisements and links that appear on send directly to your browsers. They automatically receive your IP address when this occurs. Other technologies ( such as cookies, JavaScript, or Web Beacons ) may also be used by the third-party ad networks to measure the effectiveness of their advertisements and / or to personalize the advertising content that you see. has no access to or control over these cookies that are used by third-party advertisers.

You should consult the respective privacy policies of these third-party ad servers for more detailed information on their practices as well as for instructions about how to opt-out of certain practices.'s privacy policy does not apply to, and we cannot control the activities of, such other advertisers or web sites.

If you wish to disable cookies, you may do so through your individual browser options. More detailed information about cookie management with specific web browsers can be found at the browsers' respective websites.