Detect winning game in nought and crosses

Posted by Dennis on Stack Overflow See other posts from Stack Overflow or by Dennis
Published on 2010-04-19T19:32:17Z Indexed on 2010/04/19 19:33 UTC
Read the original article Hit count: 275

Filed under:

I need to know the best way to detect a winning move in a game of noughts and crosses. Source code doesn't matter, I just need a example or something I can start with.

The only thing I can come up with is to use loops and test every direction for every move a player makes, to search for e.g five in a row. Is there a faster and more efficient way?

© Stack Overflow or respective owner

Related posts about algorithms