Skip to content

Instantly share code, notes, and snippets.

@Galacs
Created January 26, 2022 17:17
Show Gist options
  • Save Galacs/da243ae3eb099ea2e2929b86c41d3d53 to your computer and use it in GitHub Desktop.
Save Galacs/da243ae3eb099ea2e2929b86c41d3d53 to your computer and use it in GitHub Desktop.
drapeau
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment