Guest User

Untitled

a guest
Feb 16th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. import numpy as np
  2. w = 8
  3. l = 5
  4. s = 2
  5. board = np.arange(w*l)
  6. board = board.reshape(l,w)
  7. start = board[s,0]
  8. currentpoint = start
  9. print(board)
  10. print()
  11.  
  12. def block_a(currentpoint):
  13. currentpoint = np.argwhere(board == currentpoint) + [0, 3]
  14. return currentpoint
  15.  
  16. currentpoint = np.hstack(block_a(currentpoint))
  17. print(currentpoint)
  18. print(board[currentpoint])
  19.  
  20.  
  21. Expected : 19
  22.  
  23. Actual :
  24.  
  25. [[16 17 18 19 20 21 22 23]
  26.  
  27. [24 25 26 27 28 29 30 31]]
Add Comment
Please, Sign In to add comment