Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- positive_count = self.get_neighbours_count_with_positive_value(i, j)
- value = -1
- if self.board[i][j] == 0:
- if positive_count == 3:
- value = 1
- elif self.board[i][j] > 0:
- if positive_count == 2 or positive_count == 3:
- value = self.board[i][j] + 1
- elif positive_count == 1 or positive_count == 4 or positive_count == 5:
- value = 0
- elif positive_count == 0 or positive_count == 6 or positive_count == 8:
- value = self.board[i][j] - 1
- if value > self.max_val:
- value = self.max_val
- if value < 0:
- value = 0
- return value
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement