drapeau.py

Created by mkalkavan

Created on July 22, 2020

748 Bytes


from math import *
from kandinsky import *
def rect(x,y,L,r,v,b):
  c=color(r,v,b)
  for i in range(L):
    for j in range(2*L):
      set_pixel(x+i,y+j,c)
def rect2(x,y,L,r,v,b):
  c=color(r,v,b)
  for i in range(3*L):
    for j in range(2*L//3):
      set_pixel(x+i,y+j,c)
def drapeau_F(x,y,L):
  rect(x,y,L,255,0,0)
  x+=L
  rect(x,y,L,255,255,255)
  x+=L
  rect(x,y,L,0,0,255)
  c=color(0,0,0)
  x-=2*L
  y+=2*L
  for i in range(4*L):
    for j in range(-1,1):
      set_pixel(x+j,y+i,c)
def drapeau_A(x,y,L):
  rect2(x,y,L,0,0,0)
  y+=2*L//3
  rect2(x,y,L,255,0,0)
  y+=2*L//3
  rect2(x,y,L,255,204,0)
  c=color(0,0,0)
  y+=2*L//3
  for i in range(4*L):
    for j in range(-1,1):
      set_pixel(x+j,y+i,c)
      
    
  
      

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.