Your turn!

Your turn!#

Execute the following cell to reveal the first challenge. We’ll start

slowly, without obstacles. It’s up to you to complete the program in the cell below

to guide the ant to the exit.

Hint: refer back to the getting started sheet to

have an example and consult the documentation.

from laby.global_fr import *
Laby(niveau="1a")
debut()
avance()
droite()
### BEGIN SOLUTION
avance()
avance()
avance()
gauche()
avance()
### END SOLUTION
ouvre()

The cell below will display nothing if you have won.

assert est_gagnant()

Congratulations! You have written your first program.

Definition: Program

A Programme (program) is a sequence of instructions that specifies

step by step the operations to be performed to obtain a result (the

entrées (input (informal)) sortie (output (informal))) from the inputs.

Examples

  • In your program above, the input is the maze in its initial state, and the output is the maze in its final state, and the instructions are debut(),avance(), … up to ouvre().

  • We find this idea of ​​a program in simple everyday examples, for example a cooking recipe: the input would correspond to the ingredients, the instructions to the list of steps to follow, and the output to the finished dish.