Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def minesweeper1(g):
- h,w = map(range, map(len, [g,g[0]]))
- p = -1,0,1
- b=1
- for i in h:
- for j in w:
- c=0
- for y in p:
- for x in p:
- if i+y in h and j+x in w:
- if g[i+y][j+x]==9:
- c += 1
- if c != g[i][j] < 9:
- b=0
- return b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement