Exercise 8: Stones

Stones

Great! You have already understood how to move the board head using the operation Move and the directions (South, West, etc). Let's go a step further: the stones.

In any cell of our board we can drop stones. They have different colors:

  • Red
  • Blue
  • Black
  • And Green

For example, this is a board with a red stone and a black stone:

GBB/1.0 size 2 2 cell 1 0 Rojo 1 cell 1 1 Negro 1 head 1 1

Apart from moving, the head also can drop stones in the current cell. For that, we have the operation Drop, which orders the head to insert a stone of the given color.

program {
  Drop(Red)    
}

Try this program! Write the code in the editor, submit it and you will see what happens when executing it on this board:

GBB/1.0 size 3 3 head 0 0

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