escalier_qui_descend.py

Created by laurent-cortot

Created on January 20, 2020

518 Bytes

réaliser le dessin d’une coupe d’un escalier plein qui descend


from kandinsky import *
import time

x = int(input("x (0) ?"))
y = int(input("y (0) ?"))
hMarche = int(input("Hauteur marche (10) ? "))
lMarche = int(input("Longueur marche (15) ? "))
# Espace grahique NumWorks : 320 x 240 (-20)
nbMarcheEnHauteur = (220 - y) // hMarche
nbMarcheEnLargeur = (320 - x) // lMarche
nbMarche = min(nbMarcheEnHauteur,nbMarcheEnLargeur)

for i in range(nbMarche):
  fill_rect(x,y+hMarche*i,lMarche*i,hMarche,color(64*(i%2),224*(i%2),208*(i%2)))
  time.sleep(0.001)

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.