U e5d@s`ddlTGdddeZGdddeZddZdd Zd d Zed kr\eZ e e e d S))*c@seZdZddZdS)DisccCsPtj|ddd||d|dd||ddd|d|dS) NZsquareF)shapeZvisibleg?g@r)Turtle__init__ZpuZ shapesizeZ fillcolorst)selfnr 0/usr/lib64/python3.8/turtledemo/minimal_hanoi.pyrs z Disc.__init__N)__name__ __module__ __qualname__rr r r r rsrc@s$eZdZddZddZddZdS)TowercCs ||_dS)N)x)r rr r r r szTower.__init__cCs0||j|ddt|||dS)Nij")Zsetxrsetylenappendr dr r r push#s z Tower.pushcCst|}|d|S)N)listpoprrr r r r's  z Tower.popN)rrrrrrr r r r rsrcCs>|dkr:t|d|||||t|d|||dS)Nrr)hanoirr)r Zfrom_Zwith_Zto_r r r r,srcCsJtddtz tdttttddddWntk rDYnXdS)Nspacezpress STOP button to exitcenterZCourierZboldZalignZfont)onkeyclearrt1t2t3writeZ Terminatorr r r r play2s  r*cCsptttddtdatdatdatdddD]}tt |q:t ddd d t t d t d S) Nriirzpress spacebar to start gamer r!r#rZ EVENTLOOP)ZhtZpenupZgotorr&r'r(rangerrr)r$r*Zlisten)ir r r main<s  r/__main__N) Zturtlerrrrrr*r/rmsgprintZmainloopr r r r s