Ajoutez le code suivant au fichier qr.py
def placer_carre(img, x, y, n, couleur):
for i in range(n):
for j in range(n):
placer_module(img, x + i, y + j, couleur)
def placer_positionnement(img, x, y):
placer_carre(img, x, y, 7, NOIR)
placer_carre(img, x + 1, y + 1, 5, BLANC)
placer_carre(img, x + 2, y + 2, 3, NOIR)
def placer_cadencement(img):
for i in range(5):
couleur = BLANC if i % 2 == 1 else NOIR
placer_module(img, 6, 8 + i, couleur)
placer_module(img, 8 + i, 6, couleur)
def placer_modules_fixes(img):
placer_carre(img, 0, 0, 8, BLANC)
placer_carre(img, 13, 0, 8, BLANC)
placer_carre(img, 0, 13, 8, BLANC)
placer_positionnement(img, 0, 0)
placer_positionnement(img, 14, 0)
placer_positionnement(img, 0, 14)
placer_cadencement(img)
placer_module(img, 8, 13, NOIR)