Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mat =[list(input()) for _ in range(8)]
- for i in range(8):
- for j in range(8):
- if mat[i][j] == 'R' or mat[i][j] == 'B':
- x0 = i
- y0 = j
- for x in range(8):
- for y in range(8):
- if abs(x - x0) == abs(y - y0) and mat[i][j] == 'B' and mat[x][y] != 'R' and mat[x][y] != 'B' and mat[x][y] != '.':
- mat[x][y] = '.'
- if (x == x0 or y == y0) and mat[i][j] == 'R' and mat[x][y] != 'R' and mat[x][y] != 'B' and mat[x][y] != '.':
- mat[x][y] = '.'
- k = 0
- for i in range(8):
- for j in range(8):
- # print(mat[i][j], end=' ')
- if mat[i][j] == '*':
- k += 1
- # print()
- print(k)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement