fleches.py

Created by cent20

Created on April 09, 2022

673 Bytes


from kandinsky import *
couleur_gris = (196, 196, 196)
# sens 0 = G, 1 = H, 3 = D, 2 = B (comme les codes touches)

def fleches(x, y, sens):
    # (x,y) coordonnées du coin supérieur gauche du rectangle 6x12 ou 12x6 contenant la flèche
    for i in range(6):
        if sens == 0: 
            fill_rect(x+i, y+6-i, 1, 2 + 2*i, couleur_gris)
        if sens == 1:
            fill_rect(x+i, y+6-i, 1, 2 + 2*i, couleur_gris)
        if sens == 2:
            fill_rect(x+i, y+6-i, 1, 2 + 2*i, couleur_gris)
        else:
            fill_rect(x+i, y+i, 1, 12 - 2*i, couleur_gris)

fleches(20, 20, 0)
fleches(40, 40, 1)
fleches(60, 60, 2)
fleches(80, 80, 3)

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.