Exemplo n.º 1
0
  def __init__(self, test_mode=False):
    print('''
    Welcome to the guessing game!

    To start the game, please enter any integer n to establish the upper limit of the range of numbers I will guess from.
    After I make a guess please reply with one of the following options:
      'h' for too high
      'l' for too low
      'c' for a correct guess
    ''')
    self.test_mode = test_mode
    if self.test_mode:
      self.n = 100
    else:
      self.n = UI.ask_integer("Please enter a number n:")
    self.max_guesses = math.floor(math.log(self.n,2)) + 1
    self.game_count = 0
    self.total_guess_count = 0
    if self.test_mode:
      self.test_number =0
    self.start_new_game()
Exemplo n.º 2
0
 def runWizard(self):
   print('Ports.runWizard()')
   #myself = Ports()
   self.print_map()
   return UI.ask_integer('What port would you like to assign to this domain?')