code: def drunk_value(grid):
      "Return the expected value to the player if both players play at random."
      if is_won(grid): return -1
      succs = successors(grid)
      return -average(map(drunk_value, succs)) if succs else f drunk_value(grid):
      "Return the expected value to the player if both players play at random."
      if is_won(grid): return -1
      succs = successors(grid)
      return -average(map(drunk_value, succs)) if succs else 0
docs: Return the expected value to the player if both players play at random.