Exemplo n.º 1
0
 def welcome(self):
     ''' Sets up the game: user names, play against computer, etc. '''
     print Ghost._WELCOME_MESSAGE        
     self._names[0] = raw_input('Player 1, choose your name: ').strip()
     self._play_computer = \
         self.yes_or_no('Play against a computer opponent? ')
     if self._play_computer:
         self._computer = SimpleGhostPlayer()
         self._names[1] = self._computer.get_name()
     else:
         self._names[1] = raw_input('Player 2, choose your name: ').strip()
     self._max_name_length = max(len(name) for name in self._names)