Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. def minesweeper1(g):
  2. h,w = map(range, map(len, [g,g[0]]))
  3. p = -1,0,1
  4. b=1
  5. for i in h:
  6. for j in w:
  7. c=0
  8. for y in p:
  9. for x in p:
  10. if i+y in h and j+x in w:
  11. if g[i+y][j+x]==9:
  12. c += 1
  13. if c != g[i][j] < 9:
  14. b=0
  15. return b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement