Another zigzag#
You have to navigate this zigzagging maze, but the number of rows and columns varies!
Attention
This exercise is marked with a ♣ and is therefore of a more advanced level; do not hesitate to skip it if it seems difficult to you in order to not waste too much time, and to come back to it later.
from laby.global_fr import *
from random import randint
n = randint(0,3)
m = randint(2, 20)
bloc_porte = "o " + "o " * m + "o\n"
bloc_porte+= "o " + ". " * m + "x\n"
bloc_porte+= "o . " + "o " * m + "\n"
bloc1 = "o " + ". " * m + "o\n"
bloc1+= "o " * m + ". o\n"
bloc2 = "o " + ". " * m + "o\n"
bloc2+= "o . " + "o " * m + "\n"
bloc_fourmi = "o " + "→ " + ". " * (m-1) + "o\n"
bloc_fourmi+= "o " + "o " * m + "o\n"
carte = bloc_porte + bloc1 + (bloc2 + bloc1) *n + bloc_fourmi
Laby(carte = carte)
debut()