kingsday.py

Created by numworks-nl

Created on April 26, 2021

4.46 KB

Een speciaal python script voor de verjaardag van onze koning! Voer het script uit en zie direct het rood-wit-blauw trots wapperen op jouw apparaat.


from kandinsky import *
from time import *

white=color(255,255,255)

def draw_iron():
  rects = [
  (38,25,6,195,(194,194,194)),
  (44,25,2,195,(206,206,206)),
  (46,25,4,195,(155,155,155)),
  (46,24,4,1,(155,155,155)),
  (45,22,3,1,(155,155,155)),
  (45,23,4,1,(155,155,155)),
  (43,23,2,1,(229,229,229)),
  (44,24,2,1,(229,229,229)),
  (40,22,5,1,(194,194,194)),
  (38,24,6,1,(194,194,194)),
  (39,23,4,1,(194,194,194)),
  ]
  for r in rects:
    fill_rect(*r)

def draw_flag():
  rects = [
  (50,145,239,30,(36,42,117)),
  (50,51,239,30,(165,0,0)),
  ]
  for r in rects:
      fill_rect(*r)

def erase():
  rects = [
  (50,23,245,28,(255,255,255)),
  (50,175,245,28,(255,255,255)),
  (50,81,245,64,(255,255,255)),
  ]
  for r in rects:
      fill_rect(*r)

def draw_flag1():
  rects = [
  (50,145,239,30,(36,42,117)),
  (142,175,147,3,(36,42,117)),
  (156,178,133,2,(36,42,117)),
  (171,180,118,2,(36,42,117)),
  (181,182,105,2,(36,42,117)),
  (193,184,87,2,(36,42,117)),
  (204,186,67,1,(36,42,117)),
  (212,187,45,1,(36,42,117)),
  (219,188,30,1,(36,42,117)),
  (226,189,16,1,(36,42,117)),
  (50,175,21,3,(36,42,117)),
  (50,178,16,2,(36,42,117)),
  (50,180,11,1,(36,42,117)),
  (71,175,6,1,(36,42,117)),
  (135,175,7,1,(36,42,117)),
  (50,137,150,3,(36,42,117)),
  (50,140,163,3,(36,42,117)),
  (50,143,175,2,(36,42,117)),
  (50,133,129,2,(36,42,117)),
  (50,131,118,2,(36,42,117)),
  (50,135,140,2,(36,42,117)),
  (53,129,105,2,(36,42,117)),
  (59,127,87,2,(36,42,117)),
  (68,126,67,1,(36,42,117)),
  (82,125,45,1,(36,42,117)),
  (90,124,30,1,(36,42,117)),
  (97,123,16,1,(36,42,117)),
  (268,142,21,3,(36,42,117)),
  (273,140,16,2,(36,42,117)),
  (278,139,11,1,(36,42,117)),
  (263,144,5,1,(36,42,117)),
  (50,51,239,30,(165,0,0)),
  (142,81,147,3,(165,0,0)),
  (156,84,133,2,(165,0,0)),
  (171,86,118,2,(165,0,0)),
  (181,88,105,2,(165,0,0)),
  (193,90,87,2,(165,0,0)),
  (204,92,67,1,(165,0,0)),
  (212,93,45,1,(165,0,0)),
  (219,94,30,1,(165,0,0)),
  (226,95,16,1,(165,0,0)),
  (50,81,21,3,(165,0,0)),
  (50,84,16,2,(165,0,0)),
  (50,86,11,1,(165,0,0)),
  (71,81,6,1,(165,0,0)),
  (135,81,7,1,(165,0,0)),
  (50,43,150,3,(165,0,0)),
  (50,46,163,3,(165,0,0)),
  (50,49,175,2,(165,0,0)),
  (50,39,129,2,(165,0,0)),
  (50,37,118,2,(165,0,0)),
  (50,41,140,2,(165,0,0)),
  (53,35,105,2,(165,0,0)),
  (59,33,87,2,(165,0,0)),
  (68,32,67,1,(165,0,0)),
  (82,31,45,1,(165,0,0)),
  (90,30,30,1,(165,0,0)),
  (97,29,16,1,(165,0,0)),
  (268,48,21,3,(165,0,0)),
  (273,46,16,2,(165,0,0)),
  (278,45,11,1,(165,0,0)),
  (263,50,5,1,(165,0,0)),
  ]
  for r in rects:
    fill_rect(*r)

def draw_flag2():
  rects = [
  (50,145,239,30,(36,42,117)),
  (50,175,147,3,(36,42,117)),
  (50,178,133,2,(36,42,117)),
  (50,180,118,2,(36,42,117)),
  (53,182,105,2,(36,42,117)),
  (59,184,87,2,(36,42,117)),
  (68,186,67,1,(36,42,117)),
  (82,187,45,1,(36,42,117)),
  (90,188,30,1,(36,42,117)),
  (97,189,16,1,(36,42,117)),
  (268,175,21,3,(36,42,117)),
  (273,178,16,2,(36,42,117)),
  (278,180,11,1,(36,42,117)),
  (262,175,6,1,(36,42,117)),
  (197,175,7,1,(36,42,117)),
  (139,137,150,3,(36,42,117)),
  (126,140,163,3,(36,42,117)),
  (114,143,175,2,(36,42,117)),
  (160,133,129,2,(36,42,117)),
  (171,131,118,2,(36,42,117)),
  (149,135,140,2,(36,42,117)),
  (181,129,105,2,(36,42,117)),
  (193,127,87,2,(36,42,117)),
  (204,126,67,1,(36,42,117)),
  (212,125,45,1,(36,42,117)),
  (219,124,30,1,(36,42,117)),
  (226,123,16,1,(36,42,117)),
  (50,142,21,3,(36,42,117)),
  (50,140,16,2,(36,42,117)),
  (50,139,11,1,(36,42,117)),
  (71,144,5,1,(36,42,117)),
  (50,51,239,30,(165,0,0)),
  (50,81,147,3,(165,0,0)),
  (50,84,133,2,(165,0,0)),
  (50,86,118,2,(165,0,0)),
  (53,88,105,2,(165,0,0)),
  (59,90,87,2,(165,0,0)),
  (68,92,67,1,(165,0,0)),
  (82,93,45,1,(165,0,0)),
  (90,94,30,1,(165,0,0)),
  (97,95,16,1,(165,0,0)),
  (268,81,21,3,(165,0,0)),
  (273,84,16,2,(165,0,0)),
  (278,86,11,1,(165,0,0)),
  (262,81,6,1,(165,0,0)),
  (197,81,7,1,(165,0,0)),
  (139,43,150,3,(165,0,0)),
  (126,46,163,3,(165,0,0)),
  (114,49,175,2,(165,0,0)),
  (160,39,129,2,(165,0,0)),
  (171,37,118,2,(165,0,0)),
  (149,41,140,2,(165,0,0)),
  (181,35,105,2,(165,0,0)),
  (193,33,87,2,(165,0,0)),
  (204,32,67,1,(165,0,0)),
  (212,31,45,1,(165,0,0)),
  (219,30,30,1,(165,0,0)),
  (226,29,16,1,(165,0,0)),
  (50,48,21,3,(165,0,0)),
  (50,46,16,2,(165,0,0)),
  (50,45,11,1,(165,0,0)),
  (71,50,5,1,(165,0,0)),
  ]
  for r in rects:
    fill_rect(*r)
t=0.7
def draw():
  draw_flag1()
  sleep(t)
  erase()
  draw_flag2()
  sleep(t)
  erase()
  draw_flag1

draw_iron()
while (True):
  draw()

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.