old_contents: import outsmart as osmt
  
  osmt.STATE.lab[6, 8] = 2
  osmt.STATE.lab[0, 0] = -1
  
  
  def step_3():
      """Sucessful training"""
      osmt.script(s_text="""Uh-oh, something went wrong...""")
  
  
  def step_2():
      """Frist training"""
      osmt.create_train_button()
      osmt.script(s_text="""Good Job !
  You can train Bob with a state-of-the-art
  Reinforcement Learning algorithm.
  This will allow you to train him like you would a dog or a rat.""",
                  o_text="Train bob by clicking on the train button.",
                  objective_function=lambda s: s.log_text[0][1] == 'Error !',
                  next_step=step_3)
  
  osmt.script(s_text="""This is your lab.
  The blue robot is a test robot.
  His name is Bob.
  You can control its position.""",
              o_text="Click on the green patch to move the robot there.",
              objective_function=lambda s: s.lab[6, 8] == -2,
              next_step=step_2)
  
  osmt.pyglet.app.run()
  
new_contents: import outsmart as osmt
  
  osmt.STATE.lab[6, 8] = 2
  osmt.STATE.lab[0, 0] = -1
  
  
  def step_4():
      """Sucessful training"""
      osmt.script(s_text="Good Job !")
  
  
  def step_3():
      """Rocks spawning"""
      def success(state):
          bob_on_patch = state.lab[6, 8] == -2
          rock_nearby = state.lab[7, 8] == 4
          rock_nearby = rock_nearby or state.lab[5, 8] == 4
          rock_nearby = rock_nearby or state.lab[6, 9] == 4
          rock_nearby = rock_nearby or state.lab[6, 7] == 4
          return bob_on_patch and rock_nearby
      osmt.script(s_text="""Uh-oh, something went wrong :
  In this lab setting, there is no reward
  that could let Bob know how it's doing.
  Let's change that.""",
                  o_text="""Spawn some rocks somewhere right next to Bob by right-clicking
  multiple times on the appropriate tile.""",
                  objective_function=success,
                  next_step=step_4)
  
  
  def step_2():
      """Frist training"""
      osmt.create_train_button()
      osmt.script(s_text="""Good Job !
  You can train Bob with a state-of-the-art
  Reinforcement Learning algorithm.
  This will allow you to train him like you would a dog or a rat.""",
                  o_text="Train bob by clicking on the train button.",
                  objective_function=lambda s: s.log_text[0][1] == 'Error !',
                  next_step=step_3)
  
  osmt.script(s_text="""This is your lab.
  The blue robot is a test robot.
  His name is Bob.
  You can control its position.""",
              o_text="Click on the green patch to move the robot there.",
              objective_function=lambda s: s.lab[6, 8] == -2,
              next_step=step_2)
  
  osmt.pyglet.app.run()
  
subject: Create step 3 of tutorial