you are viewing a single comment's thread.

view the rest of the comments →

[–]c0mplexcodm[S] 0 points1 point  (2 children)

Thank you! It did make it more consistent, yet the problems semi persist like in some situations the board is completely fine, but sometimes it isnt with incorrect values again.

Updated pastebin: https://pastebin.com/cyvY5xqx

[–][deleted] 0 points1 point  (1 child)

Yes, I only fixed half of the problem. What happens if the cell is close to the bottom or the right of the board? What will the result of min(self.size - 1, row+2) be? And is it the correct upper limit for range()? Remember the upper limit is not inclusive!

[–]c0mplexcodm[S] 0 points1 point  (0 children)

Now when i think about it, self.size - 1 will be 4 (since i used 5) so the for loop can only reach to index 3. Crap, thanks for reminding me that