For tic-tac-toe there are only a finite number of winning positions. One way is to have an array of winning positions and check current board against those. Another way is to have multiple if-statements. In either case you need to decide what is a winning board.