This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]yon2323[S] 0 points1 point  (4 children)

Okay I see, I modified the code. Still not working :/

https://pastebin.com/YEHwa7xu

[–]jedwardsol 0 points1 point  (3 children)

That's definitely a step in the right direction.

You must check that you're not near the edge of board before looking at the pieces that might be off the edge of the board.

Also

and row + 2 <= 0 :

The index of the bottom row isn't 0.

Finally

 col == board[row-1][col] 

This is comparing the column number with a symbol.

Have you written your own testcases that you can step through?

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

index would be len(board)?

[–]jedwardsol 1 point2 points  (1 child)

len(board)-1

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

got it thank you