Well, think about how you win Tic Tac Toe. You need to get either three crosses or three naughts in a row, so just write a function to check for that? There aren't that many combinations - three horizontal, three vertical and two diagonal, so you could probably just go through and check all of them. If all three in the top row are the same symbol, then the appropriate player has won. If all three in the middle row are the same, then someone's won. And so on. There may be more efficient ways to do it, I'm not sure, but with only eight combinations to check anyway, it doesn't really matter.