Advertisement
Guest User

klassescapevolcano

a guest
Feb 25th, 2020
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. can_exit([
  2. [0, 1, 1, 1, 1, 1, 1],
  3. [0, 0, 1, 1, 0, 1, 1],
  4. [1, 0, 0, 0, 0, 1, 1],
  5. [1, 1, 1, 1, 0, 0, 1],
  6. [1, 1, 1, 1, 1, 0, 0]
  7. ]) ➞ true
  8.  
  9. can_exit([
  10. [0, 1, 1, 1, 1, 1, 1],
  11. [0, 0, 1, 0, 0, 1, 1],
  12. [1, 0, 0, 0, 0, 1, 1],
  13. [1, 1, 0, 1, 0, 0, 1],
  14. [1, 1, 0, 0, 1, 1, 1]
  15. ]) ➞ false
  16.  
  17. # This maze only has dead ends!
  18.  
  19. can_exit([
  20. [0, 1, 1, 1, 1, 0, 0],
  21. [0, 0, 0, 0, 1, 0, 0],
  22. [1, 1, 1, 0, 0, 0, 0],
  23. [1, 1, 1, 1, 1, 1, 0],
  24. [1, 1, 1, 1, 1, 1, 1]
  25. ]) ➞ false
  26.  
  27. # Exit only one block away, but unreachable!
  28.  
  29. can_exit([
  30. [0, 1, 1, 1, 1, 0, 0],
  31. [0, 0, 0, 0, 1, 0, 0],
  32. [1, 1, 1, 0, 0, 0, 0],
  33. [1, 0, 0, 0, 1, 1, 0],
  34. [1, 1, 1, 1, 1, 1, 0]
  35. ]) ➞ true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement