Jan 12, 2014 at 1:33pm UTC
You made mistakes with the winning part.
It's 3 == 4 && 4 == 5, 4 == 6 && 6 == 8 etc.
You also made other mistakes.
Last edited on Jan 12, 2014 at 1:41pm UTC
Jan 13, 2014 at 12:12am UTC
I dont doubt that i've made other mistakes. I expected that however I still dont understand what the difference is between what i did:
if ((board[0] == board[1]) && (board[0] == board [2]))
and what your saying:
It's 3 == 4 && 4 == 5, 4 == 6 && 6 == 8 etc.
Both of these ways compare the same thing. If 3 spots are inhabited by the same symbol.
I also don't understand why my way would output "X wins" twice vs your way which is essentially saything the samething in a different way.
Jan 13, 2014 at 12:15am UTC
Try removing spot_valido() on line 145 (The one BEFORE the while).
Same for spot_validx() on line 127.
Last edited on Jan 13, 2014 at 12:16am UTC
Jan 13, 2014 at 12:25am UTC
I tried removing the spot_valido before the while loop and it still outputs "X wins twice". When O wins it only outputs it one time "O wins". "X wins" still says it twice each on a new line.