Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Encore un zigzag

Il faut parcourir ce labyrinthe en zigzag mais le nombre de lignes et de colonnes varie !

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()