from kandinsky import * from math import * fill_rect(0,0,320,222,(0,)*3) def choix(i): if i==0:return "AAFECNFQCOFQCPFPCQFPAUFPCRFOCSFOATFNCTFNATFNCSFNCTFMCUFMASFLASHTDCHVDCHUDCHVDCHWDDHXDDHYDDHZDEHZDEIADFIADGIADFHZDEIADGIADFITDFHZDDIADEHYDDHXDCIADDIJDDHXDCHZDEISCSFOATFMASFKARFKARFJAQFJAQHUDCHYDEIADFIUCVFKARHUAQFIAPFIAOFIAPFIAOHVAPHUDCHTASFJCWFIARHFDVIDEGIDEHIDDEIBDIIBDJIBDKIBDIINCXFGAKHMAYHNDBHPAWFVBQGJBRGJBRGJBSGKBSDPJDDHIBDLIBDJJJDJIBDMIXDMBYGSBYGRBXGQBXGPBWGOBWGOBWGNBVGNBVGMBUGMBUGLBTGLBVDNIZDG" if i==1:return "JADGIBDHJCDPJEDQJFDQBQGIBPGIBPDRJGEBHLAZFKCVFLCUFMCTEWCKFHANFHAMFHANHVAOHJEAHWDCHSATHTDCIADGILENIEEOIMCWFIAOFHAMHWDDHZDFIVDSBOGHBNGHBOFPBNDTIWCYIOCNFRCMFRCLFRAVHQDBHOAXFWJCDHIMEPIMDGIDEIIJCTIADBIQGRJADOJBDOBTGKBUDOIBDIJHECHMAJFGCLIMGGBLGGBMDVHRDBHPCZIADDHYACHYDCIRCREZCHFJAQHGDWHSAUFQBRDQJFDRJGDIINCXIVDSJIEDHNAJFGALHWDCHZDBHYABFNBCFLASHDDTIBDFIUFZIUCVILGHIZDVIYDNBWGPIHGQIRDDIIDCHSATHCDRBQDQJEDZHIBA" if i==2:return "FKAZHKEAJFDRIDDSIADAIPGTIYDGIBDKJMDKICEFJKEEHOAXHNAIFGAKHWEAIGDDHWDBHKANFHALHLDBHTDXIFERINCMFRCKILEMIEDWJADGIXDUHEDUBNFPAUGZAUHRAVFSCJFSCIFIASFKAQFIARFJAPHIDZHVAMHWALFHCWIVDFITCUIACYFCCPFCCDFBCQFBCEFTCFFACRFOAUHAATHBDQI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AIHQAWFSBLFTCGFBCPIGDUBMDVHSCWFJARFFAGFQCQIADTJKDJIVFZBPGHBRFQBEGCAYFMAUFLBCHABDFO" if i==8:return "ACHQCTFNBJFGCMIDEIIODOITCTHEDTICDVJNEQIMDLBYGSIGEUIPCPFQAFFICHHYCZHXAHFKAVGVCZIFCEHZDBHYDRIUDEIGEBICDHIVDRIJDXBKFNAUFKAQFICIHOCYHGBAFYIWDJJLEGIMGEBTDPIECOFPBEGEBNFYBVDMIZDKIXDSJHDWHSDAHLALGUAVGWCUHXCWFHCXIEEPIUGAAXFNCSIADCIHEABWGLIIGOIHDQILDKIYDMBWGKJJFUBIEEHPAWFRCNHWDAHTDBHUCYHFBBFZBDFGARFHAEFPAVFSCHHOAJFLBHFMBMGGBUEBHYCSISGQIGDYHVAPFFANHKBAFKCDFBCZIXGIIZDEIRDDIEDIIWESJOFUBJEAJGGDBFFRAXFTAVFJBFGE" if i==9:return "INDMJPERINEQIVFYIUDGJCDOHACWFICJIACXHZECHLDCIFDUIHEKBODSJJEBHLBAFVJIEFHOAWFMATHDAIHREGJFDZIOCMFSCGHXDBEYDCIYDBHHBBFPCRHSAGHXCYIBDRIECNEXCIEZAZGBAYFOCSITDDEWAXHQCXHRCOIODSIUGLJHEIICDGIHELBOGHJAGGIKCUHEBCFOCTEWCZHWCWHKEBBJECHYCYFFAEFEAHFGAKGYDAHUCZHKCKILDDIZELIDDNBVDOHVAMFUAZFZITGABRGIJOEUINDGHODRIIDFJADPHMEDHNCZFEABFNBDGVCNHVCMFQAUHSCPHXCVGWDHIYDTJIEEBSDOIUEOISCQIRDPITDEGUCZHVCUILDOIJGJBWDZIJDMIREB" PTS=250 nb=10 w = int(PTS * 80 / 271) h = PTS // 2 - w def dist(a,b): return int(sqrt((a[0]-b[0])**2+(a[1]-b[1])**2)) def coord(n): if n <= h : return (320, 222 - n / h * 222) if n <= h + w : return (320 - 320 * (n-h) / w, 222) if n <= 2 * h + w: return (0, 222 * (n-h-w) / h) return (320 * (n-2*h-w) / w, 0) def conv(s):return 26*(ord(s[0])-65)+ord(s[1])-65 for k in range(nb): fils=choix(k) a=conv(fils[:2]) (x1,y1) = coord(a) for i in range(len(fils)/2-1): a=conv(fils[2*i+2:2*i+4]) (x2,y2)=coord(a) R = dist((x1,y1),(x2,y2)) for n in range(R): x=int(x1+(x2-x1)*n/R) y=int(y1+(y2-y1)*n/R) (r,g,b) = get_pixel(x,y) set_pixel(x,y,(min(255,r+8),min(255,g+4), 0)) x1,y1=x2,y2