Exercise 3: Movements

Movements

Up to this point, what you did wasn't too exciting, was it? That's because we haven't taught you how to give the computer instructions yet, and we've only shown you a board.

In this exercise we will learn one of the instructions we can give the computer: to move the head. For instance, starting from an initial empty board, we can easily write a program that moves the head one position to the north.

Inicial Final
GBB/1.0 size 3 3 head 0 0 GBB/1.0 size 3 3 head 0 1

The program code (meaning the text of the description of the solution we will give the computer) that achieves this is the following:

program {
  Move(North)
}

Don't believe us? Write down the previous code in the editor and press “Submit”.

You must sign in before submitting your solutions

Oops, your solution didn't work

  • Check that your program does not have recursion or an infinite loop
  • Check that you have an internet connection
  • Wait a while and try again

We are processing you solution

Please press F5 if results are not displayed after a few seconds