^c@sIddlTdZdddYZdZedkrEendS( i(t*cCsX|dkrdSt|d||||||||t|d||||dS(Nii(thanoi(tntatbtctreport((s0/usr/lib64/python2.7/Demo/tkinter/guido/hanoi.pyRs  tTkhanoicBs&eZddZdZdZRS(cCs||_t|_}t||_}|j|j|d|j|d}}|r|j|d|dd|dd|_nd}|d}|d} | |d|d d} } | || |} } g|_ |j | | | | d d }|j j || | | | } } |j | | | | d d }|j j || | | | } } |j | | | | d d }|j j ||jj |d }| dd}d|}gggg|_ i|_| |d| |d} } | || |} } ||dtd |d }xt|d dD]}|j | | | | d d}||j|<|j d j || || |} } | |d| |d} } |jj |jjdqFWdS(Ntwidththeightitbitmapt foregroundtbluei iitfilltblackiiitredi(RtTkttktCanvastcanvastpacktgetintt create_bitmapR tpegstcreate_rectangletappendtupdatetpegstatetpiecestmaxtrangetafter(tselfRR RRRR tpegwidtht pegheighttpegdisttx1ty1tx2ty2tpt pieceheightt maxpiecewidtht minpiecewidthtdxti((s0/usr/lib64/python2.7/Demo/tkinter/guido/hanoi.pyt__init__sP  '         cCsxt|jddd|jt|jddd|jt|jddd|jt|jddd|jt|jddd|jt|jddd|jqWdS(Niii(RRR(R ((s0/usr/lib64/python2.7/Demo/tkinter/guido/hanoi.pytrunNscCs|j|d|kr tn|j|d=|j|}|j}|j|j|\}}}} xO|j|\} } } } | |krPn|j|dd|jjqiW|j|j|\}}}}||d}x|j|\} } } } | | d}||kr$Pn||krF|j|ddn|j|dd|jjqW| | }||t |j|d}xO|j|\} } } } | |krPn|j|dd|jjqW|j|j |dS(Niiii( Rt RuntimeErrorRRtbboxRtmoveRRtlenR(R R-RRR(Rtax1tay1tax2tay2R$R%R&R'tbx1tby1tbx2tby2t newcentertcenterR)t newbottom((s0/usr/lib64/python2.7/Demo/tkinter/guido/hanoi.pyRXs@   " "    N(t__name__t __module__tNoneR.R/R(((s0/usr/lib64/python2.7/Demo/tkinter/guido/hanoi.pyRs 1 cCsddl}ddl}|jdr>|j|jd}nd}|jdr|jd}|ddkr{|d}qd|}nd}t||}|jdS(Niiiiit@(tsyststringtargvtatoiRARR/(RCRDRR th((s0/usr/lib64/python2.7/Demo/tkinter/guido/hanoi.pytmains     t__main__N((tTkinterRRRHR?(((s0/usr/lib64/python2.7/Demo/tkinter/guido/hanoi.pyt s  e