Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- w = 8
- l = 5
- s = 2
- board = np.arange(w*l)
- board = board.reshape(l,w)
- start = board[s,0]
- currentpoint = start
- print(board)
- print()
- def block_a(currentpoint):
- currentpoint = np.argwhere(board == currentpoint) + [0, 3]
- return currentpoint
- currentpoint = np.hstack(block_a(currentpoint))
- print(currentpoint)
- print(board[currentpoint])
- Expected : 19
- Actual :
- [[16 17 18 19 20 21 22 23]
- [24 25 26 27 28 29 30 31]]
Add Comment
Please, Sign In to add comment