AlkantarClanX12
Current Path : /lib64/python2.7/Demo/turtle/ |
Current File : //lib64/python2.7/Demo/turtle/tdemo_nim.pyc |
� ��^c @ s5 d Z d d l Z d d l Z d d l Z d Z d Z d Z d Z e d Z e e d d e d d Z d Z d Z d Z d � Z d � Z d � Z d e f d � � YZ d e j f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ d � Z e d k r1e � e j � n d S( 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� i i i i i i i? i� i� c C s t j t t � S( N( t randomt randintt MINSTICKSt MAXSTICKS( ( ( s- /usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyt randomrow s c C sy | d | d A| d A} | d k r0 t | � SxB t d � D]4 } | | | A} | | | k r= | | f } | Sq= Wd S( Ni i i i ( t randommovet range( t statet xoredt zt st move( ( s- /usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyt computerzug! s c C so t | � } x6 t rD t j d d � } | | | d k k r Pq q Wt j | d k | | d � } | | f S( Ni i i ( t maxt TrueR R ( R t mR t rand( ( s- /usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyR + s t NimModelc B s5 e Z d � Z d � Z d � Z d � Z d � Z RS( c C s | | _ d S( N( t game( t selfR ( ( s- /usr/lib64/python2.7/Demo/turtle/tdemo_nim.pyt __init__6 s c C sr | j j t j t j g k r"