How to learn to program in a simple and funny way. Learn2program

Our first program



Once we have seen the basic instruction set, we are going to solve the first exercise.

This exercise will consist of entering the minefield and exiting through the exit taking the least number of steps.

The rover at the beginning is always looking towards the minefield.

 

To solve the exercise, the rover will advance to the end of the minefield. Later on, it will turn left to look for the exit and after twelve steps it only has to turn right and move forward leaving the minefield.

In this exercise we have used sequential and iterative instructions.

As you can see in the previous image, the exercises increase in complexity. In the Exercise 4, the black circles mean that there is an obstacle in the minefield. The rover will not be able to pass through the squares where the obstacle is. It can only go through the squares that do not have the black circle.

Here is a perfect exercise for the student to put iterative instructions into practice:

As can be seen from the minefield above, there are several mines that the rover will have to disable. In the next lesson we will explain to you what is the instruction that you will have to use in order to deactivate mines in the minefield.

The Demeter Project