-
Introduction
In this section you will learn about the strategy we have followed to teach our students programming in a simple and fun way. Learning to code can be a motivating activity.
-
The DEMETER I language
In this section you will learn about the basic structures of our programming language. We call this set of instructions DEMETER I.
-
The DEMETER II language
In this section you will learn about the evolution of the initial DEMETER I instruction set. We will call the full language DEMETER II. In addition to having new instructions, the minefields have new elements that increase the difficulty.
Variables
In a programming language the variables to store information are basic. DEMETER II has the following syntax for the use of variables:
- VAR = VALUE
- VAR++
- VAR – –
Where VAR can be any value that the programmer uses. It can be STEPS, MINES, or whatever name the programmer chooses.
Alternatively we have the PRINT instruction to show the value of a variable on the rover’s remote control. This statement has the following syntax:
- PRINT VAR
Below is an example of how these instructions work:
- STEPS = 0
- STEPS ++
- STEPS ++
- PRINT STEPS
With these types of instructions we can solve problems like the exercise 15:
The solution to this exercise is the following:
PASOS=0
FOR 10
A
PASOS++
END
DEACT
A
PASOS++
TL
FOR 12
A
PASOS++
END
TR
A
PASOS++
PRINT PASOS