Zain Toor wrote:I made a 5 x 5 tic tac toe but I can't seem to figure out how to make the bottom right - top left diagonal work. I've figured everything else out but that bit is giving me trouble, here is the code
The second line is for the bottom right-top left diagonal.
Ignoring the second line, which seems incomplete... I guess there must be three different values possible at each location, right? One value for "this space is empty", one for "this space has an X", and one for "this space has an O". Maybe those values are 0, 1, 2, or maybe 1, 2, 3, or maybe ' ', 'X', 'O'.
Anyway, when you write check[0][0]==check[1][1], that verifies that position (0,0) has the same thing as position (1, 1). And the rest of the line verifies that (2,2), (3,3) and (4,4) also have the same thing. So either you have 5 X marks, or 5 O marks... or 5 empty spaces. How can you add something to
test whether one of those positions is empty or not?