3 ^S c@sdZddlTddlmZmZddlmZmZd*Zd ed ed Z d d Z ddZ ddZ ddZ d+ddZddZddZddZddZdded,d fd d!Zefd"d#Zd$d%Zed&kreZed'S)-a xturtle-example-suite: xtx_kites_and_darts.py Constructs two aperiodic penrose-tilings, consisting of kites and darts, by the method of inflation in six steps. Starting points are the patterns "sun" consisting of five kites and "star" consisting of five darts. For more information see: http://en.wikipedia.org/wiki/Penrose_tiling ------------------------------------------- )Z*)cospi)clocksleepg?g@i cCsTt|}tdt|tdt|tdt|tdt|tddS)N$ilfltfdrtlflr*/usr/lib64/python3.6/turtledemo/penrose.pykitercCsTt|}tdt|tdt|tdt|tdt|tddS)Nr r r rrrrdart%rrcCs|dkrFt\}}ttt|dt|d}}}dt|||f<dSt|}tdt||dt|t dt ||dtdt|t t dt ||dtdt|t d t||dtddS) NrrTr rr ii) posintheadingroundtiledictr r inflatedartrr inflatekitedrnZpxZpyhxyrrrrr1s( " rcCs|dkrFt\}}ttt|dt|d}}}dt|||f<dSt|}t||dtdt|t dt ||dtdt|t t dt ||dt|t d dS) NrrFrr ri6i~r ) rrrrrr rr rrrr r!rrrrGs" " rcCst|t|}t|d|d|x\tD]T}|\}}}t||t|t|rhtdtddntdtddtq,WdS) NgY@rblackr?r)rr'r)r'rr) Zclearr Z shapesizerZsetpos setheadingZshapeZcolorZstamp)rr"thZkr#r$r%rrrdrawZs      r*cC(x"tdD]}t||tdq WdSNriH)rangerr rr"irrrsunj r0cCr+r,)r-rr r.rrrstaror1r2cCsTtdttdttdtttdttdttddS)Nridrrr)tracerZ begin_polyrZend_polyZregister_shapeZget_polyrrrrr makeshapests  r4cCs$tttttddS)NZuser)ZresetZhtZpur4Z resizemoderrrrstarts r5ic Cst|tdiat}td|||t}t|||tdt}tddtD}tddtD} td|| || fdS)NrrcSsg|]}t|r|qSrrZ.0r$rrr ztest..cSsg|]}t|s|qSrr7r8rrrr9r:z"%d kites and %d darts = %d pieces.)gotor(rrr3r*ZlenZprint) rr"funstartposr)abZcZnkZndrrrtests  r@cCsPtxDtdD]8}t}td||t}||}|dkrtd|qWdS)Ni,r)r5r-rr@r)r<r/r>r?Ztrrrdemos rBcCsjtdtdddtttdtttdtddtdddtd d ddt dddddS)NZlogog333333?rrr&r6gffffff?rzPlease wait...Zcenter Arial Blackr bold)ZalignZfontiXrAFu)r=ZDonei8)rCr rD)rErF) ZmodeZbgcolorrBr0rr2Zpencolorr;Zwriter@rrrrmains    rGZ__main__Ngw@gP/7?gP/7?)r)rr)Z__doc__ZturtleZmathrrZtimerrr r rrrrr*r0r2r4r5r@rBrGZ__name__ZmsgZmainlooprrrrZs(