def automaton(iterations=100, select_door="random"):
  """
  Plays the game with its own Monty_Hall.  Turns off the music so
  the games proceeds apace.
  
  default iterations is 100
  
  door selection is random unless specified by the named variable select_door
  """
  import random
  "create a function that either returns a random door or a specified door"
  if (select_door == "random"):
    select_a_door = lambda : random.randrange(1,4)
  else:
    select_a_door = lambda : select_door
    
  monty = Monty_Hall(music_duration=0)
  for i in range(1,iterations):
    select_door = select_a_door()
    monty.choose_door(select_door)
    monty.switch()
    monty.start_game()
    monty.choose_door(select_door)
    monty.stay()
    monty.start_game()
  
  "finish up with the scores"
  monty.tell_me_the_score()

  Plays the game with its own Monty_Hall.  Turns off the music so
  the games proceeds apace.
  
  default iterations is 100
  
  door selection is random unless specified by the named variable select_door
  
recipes/Python/577374_monty_hall_problem/recipe-577374.py