Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. h = 0
  2. position = state[0]
  3. visits = state[1:5]
  4. for corner, visited in zip(corners,visits):
  5. if not visited:
  6. h += abs(position[0] - corner[0]) + abs(position[1] - corner[1])
  7.  
  8. return h
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement