|
|
back to boardWhat is wrong with this algorithm? How can I know Test 11? I've got WA#11. Here is my algorithm: For each row, column and two diagonals count number of 'X' and 'O'. - If in any case number of 'X' is 2 and # of 'O' is zero, then crosses win (coz it's crosses turn). - If # of 'X' is 1 and # of 'O' is 0, then increase counter for X wins (if it's larger than 1 Crosses win). - If # of 'O' is 2 and # of 'X' is 0, then increase counter for O wins (if it's larger than 1 Ouths win).
Then I'll check if counter for X wins is larger than 1, print crosses win - else if counter for O wins is larger than 1, print Ouths win - else Draw |
|
|