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 http://itecdigital.weebly.com/. 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
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 - www.ideasfactory.me/about/"rel="author"