0

I am having trouble writing the checkWin() function for my tictactoe game. Can someone explain to me how I can check for a win in a variable board? The win condition is if you complete a row or a column.

joel314
  • 1,060
  • 1
  • 8
  • 22
  • 2
    please post a [MCVE](http://stackoverflow.com/help/mcve) so we can understand what you've tried and what code you have. – Dando18 May 22 '16 at 12:19

1 Answers1

0

Try splitting it up into a bunch of smaller methods:

    checkWinVertical()
    checkWinHorizontal()
    checkWinDiagonal()

which should be easier to handle. I can't really help much more without a code fragment that you've tried- does this help?

RobotKarel314
  • 417
  • 3
  • 14