MSV FM

[email protected]: ~ $
Path : /lib64/python2.7/Demo/turtle/
File Upload :
Current < : //lib64/python2.7/Demo/turtle/tdemo_nim.pyo

�
��^c@s5dZddlZddlZddlZdZdZdZdZedZeedd	edd
Z	dZ
dZdZd�Z
d�Zd�Zdefd��YZdejfd��YZdefd��YZdefd��YZdefd��YZd�Zedkr1e�ej�ndS( s�      turtle-example-suite:

            tdemo_nim.py

Play nim against the computer. The player
who takes the last stick is the winner.

Implements the model-view-controller
design pattern.
i����Ni�i�iiiiiii?i�i�cCstjtt�S(N(trandomtrandintt	MINSTICKSt	MAXSTICKS(((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyt	randomrowscCsy|d|dA|dA}|dkr0t|�SxBtd�D]4}|||A}|||kr=||f}|Sq=WdS(Niiii(t
randommovetrange(tstatetxoredtztstmove((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pytcomputerzug!s
cCsot|�}x6trDtjdd�}|||dkkrPqqWtj|dk||d�}||fS(Niii(tmaxtTrueRR(RtmR	trand((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR+s	 tNimModelcBs5eZd�Zd�Zd�Zd�Zd�ZRS(cCs
||_dS(N(tgame(tselfR((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyt__init__6scCsr|jjtjtjgkr"dSt�t�t�g|_d|_d|_	|jj
j�tj|j_dS(Ni(
RRtNimtCREATEDtOVERRtstickstplayertNonetwinnertviewtsetuptRUNNING(R((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR9s		cCs�|j|}||j|<|jjj||||j�|j�rstj|j_|j|_	|jjj
�nI|jdkr�d|_t|j�\}}|j||�d|_ndS(Nii(
RRRtnotify_moveRt	game_overRRRRtnotify_overRR(Rtrowtcolt	maxspalte((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyRBs

	cCs|jdddgkS(Ni(R(R((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR PscCs+|j||krdS|j||�dS(N(RR(RR"R#((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyRSs(t__name__t
__module__RRRR R(((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR5s
					tStickcBs#eZd�Zd�Zd�ZRS(cCs�tjj|dt�||_||_||_|j||�\}}|jd�|j	t
dtd�|jd�|j
�|j||�|jd�|j�dS(Ntvisibletsquareg$@g4@itwhite(tturtletTurtleRtFalseR"R#Rtcoordstshapet	shapesizetHUNITtWUNITtspeedtputgototcolort
showturtle(RR"R#Rtxty((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyRZs			



cCskt|d�\}}dd|d|t}dd|t}|tdtdtd|tdfS(Niiii(tdivmodR2R1tSCREENWIDTHtSCREENHEIGHT(RR"R#tpackett	remainderR8R9((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR.hscCs9|jjtjkrdS|jjj|j|j�dS(N(RRRRt
controllerRR"R#(RR8R9((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pytmakemovens(R%R&RR.R@(((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR'Ys		tNimViewcBsAeZd�Zdd�Zd�Zd�Zd�Zd�ZRS(cCs�||_|j|_|j|_|jjd�|jjt�|jjd�tjdt�|_	|j	j
�|j	jd�i|_xJt
d�D]<}x3t
t�D]%}t|||�|j||f<q�Wq�W|jd�|jjt�dS(Ni�i�R(iis... a moment please ...(i�i�i�(Rtscreentmodelt	colormodettracerR-tbgcolorR+R,twriterR4R3RRRR'tdisplayR(RRR"R#((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyRus	
	'
cCs�|jjt�|jj�|dk	rt|jjdtdd�|jjd�|jj	|dddd�n|jjdtdd�|jjd�|jj	|dddd�|jjt
�dS(Niii0tredtaligntcentertfonttCourieritbolditblacki(RMiRN(RMiRN(RBRER-RGtclearRR5R<tpencolortwriteR(Rtmsg1tmsg2((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyRH�s
cCs�|jjt�xOtd�D]A}x8t|jj|�D] }|j||fjt�q:WqWxRtd�D]D}x;t|jj|t�D] }|j||fjd�q�WqoW|j	d�|jjt
�dS(NiR*s*Your turn! Click leftmost stick to remove.(RBRER-RRCRR6tSCOLORRRHR(RR"R#((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR�s" "
cCs�|dkrIt}x�t||�D] }|j||fj|�q"Wn�|jd�tjd�|jd�t}xIt|d|dd�D]-}tjd�|j||fj|�q�W|jd�dS(	Nis ... thinking ...         g�?s ... thinking ... aaah ...ii����g�������?s*Your turn! Click leftmost stick to remove.(tHCOLORRRR6RHttimetsleeptCOLOR(RR"R#R$RtfarbeR
((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR�s!


!
cCs8|jjjdkrd}nd}|jd|�dS(NisCongrats. You're the winner!!!s"Sorry, the computer is the winner.s2To play again press space bar. To leave press ESC.(RRCRRH(RRT((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR!�s	cCs)|jjtjkr%|jj�ndS(N(RRRRRBRP(R((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyRP�sN(	R%R&RRRHRRR!RP(((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyRAts	
			t
NimControllercBseZd�Zd�ZRS(cCs�||_|jj|_t|_x'|jj�D]}|j|j�q1W|jjj	|jj
jd�|jjj	|jjjd�|jjj
d�|jjj�dS(NtspacetEscapesPress space bar to start game(RRRR-tBUSYtvaluestonclickR@RBtonkeyRCRRPRHtlisten(RRtstick((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR�s		cCs9|jr
dSt|_|jjj||�t|_dS(N(R^RRRCRR-(RR"R#((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR�s
		(R%R&RR(((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR[�s	RcBs#eZdZdZdZd�ZRS(iiicCsFtj|_||_t|�|_t|�|_t|�|_	dS(N(
RRRRBRRCRARR[R?(RRB((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR�s
	(R%R&RRRR(((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR�scCs9tj�}|jd�|jtt�t|�}dS(Ntstandards
EVENTLOOP!(R+tScreentmodeRR;R<R(t
mainscreentnim((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pytmain�s

t__main__(i?i?i(i�i�i�(i�i�i�(t__doc__R+RRWR;R<RRR1R2RURVRYRRRtobjectRR,R'RAR[RRiR%tmainloop(((s-/usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyt<module>
s0
		
	
$E	
Bethany
Bethany
0%

THE FINEST HOTEL NEAR LAKE KIVU

The Perfect Base For You

Required fields are followed by *





EC1A68011

About Us

Delicious Interior With The Pinch Of Everything

Bethany Investment group is Presbyterian church in Rwanda(EPR) company that manage Hotel and Guest house in Karongi (Bethany Hotel), ISANO branch in GIKONDO(Kigali), Kiyovu branch(Kigali), AMIZERO branch(Nyagatare-East) and Gisenyi Branch(Rubavu).

Accomodation

Get a Comfortable Room
Feel The Comfort

Get a comfortable room and feel our hotel’s comfort. Bethany Hotel features a variety of fully furnished rooms with extra space, Executive rooms, Deluxe rooms with a beautiful lake view and garden space, Deluxe rooms, comfort rooms, family rooms and standard rooms at your service.

Standard Single

Services

We Provide Top Class Facility
Especially For You

Beach BBQ Party

Kick back on the beach& and enjoy our berbecue from our masterchef

Breakfast

Kick back at our hotels& enjoy our breakfast from our masterchef

Conference Hall

Kick back at our hotels& enjoy our conference halls from all bethany branches

Enjoy with your partner

Honeymoon Package

80%

Get In Touch

Don’t Miss Any Update

    +

    Search your Room

    Required fields are followed by *