Ma playlist consacrée à la NUMWORKS
from turtle import * from random import * from kandinsky import fill_rect BL,JA=(255,)*3,(255,181,49) fill_rect(0,0,320,222,JA) speed(0) svg=['M',3,65,'C',35,80,55,78,66,55,65,90,72,115,52,115,22,107,49,82,88,59,83,69,84,74,89,74,94,74,95,67,94,64,101,64,107,62,111,56,111,66,118,72,123,58,122,79,126,113,107,112,76,101,110,76,121,73,138,65,147,61,147,58,144,51,132,67,149,69,162,67,162,61,166,58,165,65,165,70,170,70,174,69,175,66,176,62,176,69,174,76,180,76,190,77,195,57,195,48,202,65,209,87,197,87,179,83,203,64,216,62,229,60,225,60,226,57,222,50,214,68,224,69,234,69,245,56,246,45,251,59,263,87,247,87,232,87,237,61,275,61,'M',111,148,'C',145,151,166,125,152,118,142,124,147,175,147,181,'M',137,152,'C',160,153,173,150,173,144,166,137,161,157,174,158,184,158,189,148,190,146,'M',192,129,'C',193,140,188,165,198,166,206,165,212,156,213,153,'M',182,137,'C',183,133,197,136,206,137,213,137,215,136,217,134,'M',216,149,'C',221,150,225,145,221,142,215,141,211,158,223,158,236,158,246,139,246,131,250,148,264,175,247,175,230,175,237,149,263,149,287,152,299,164,317,164,'M',165,138,'C',166,137,169,134,170,134,171,136,174,138,174,139] color(BL) def flocon(x,y,size): penup();goto(x,y);pendown();left(90);s=size/10 branches=randint(5,10) for i in range(0,branches): for (a,b,c) in ((10,4,4),(3,3,28),(3,3,4),(0,4,4),(3,3,28),(3,3,4)):forward(a*s);backward(b*s);left(10*c) backward(2*s);right(360/branches) def move(x,y):goto(x-160,110-y) def coord(a,b,c,d,t):return a*(1-t)**3+3*b*t*(1-t)**2+3*c*t*t*(1-t)+d*t**3 def bezier(l): pendown();t=0 for i in range(11):x=coord(l[0],l[2],l[4],l[6],t);y=coord(l[1],l[3],l[5],l[7],t);move(x,y);t+=.1 def texte(c,s): pensize(s);color(c);i=0 while i<len(svg): if svg[i]=='M':l=[svg[i+1],svg[i+2]];penup();move(l[0],l[1]);i+=3 elif svg[i]=='Z'or svg[i]=='C':i+=1 else: for j in range(6):l.append(svg[i+j]) bezier(l);l=[svg[i+4],svg[i+5]];i+=6 for c in range(10): for l in range(7):flocon(-135+30*c,-90+30*l,randint(10,15)) texte(JA,8) texte(BL,3) hideturtle()