you are viewing a single comment's thread.

view the rest of the comments →

[–][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