Dance Steps for Robots

Both dances and programs are a series of steps that must be followed exactly and in the right order. If you want to program a robot to dance then those dance steps become exactly a program. You must write the steps in a programming language so the robot can follow them.

dancingRobot400dpiBallet, tap, modern, ballroom, hip hop, line dancing, gymnastic dance, hand clapping games the list is endless of routines we might learn. Each routine is an algorithm, or set of instructions that a person might follow. Instead of a person following the steps a robot might be the performer, in which case we need to implement the algorithm as a program.

One of the most important things in programming is being able to say which instructions are to be followed when. This is called ‘flow of control’. The simplest form is knowing how to write an instruction to do one step after another. This is called ‘sequencing’. Our dance programming language uses jigsaw-like pieces that fit together one after another to show the order to do dance steps.

If you don’t do the steps in exactly the right order you will get the dance wrong!

When writing programs (and dance steps) you also need to be able to say some instructions must be repeated a given number of times. We’ve used a REPEAT jigsaw block. You need to say how many times you want instructions to be repeated. You must also say which instructions are to be repeated. Our jigsaw piece has a hole in it. The pieces in the hole are the ones to repeat the given number of times.

If you don’t do the steps in exactly the right order you will get the dance wrong!

 If you repeat the wrong steps, or do them the wrong number of times, then you will get the dance wrong!

Dance Programs:

Here are some simple dance programs for a robot. Can you pretend to be the robot and follow them yourself?

Gangnam Style Dance

Shadows’ Walk

ROBOT-READING-iStock_000012448512LargeMore robot stuff

abitofcs4fn2coverRead Issue 2 of A Bit of Cs4fn