Aside from the article, I do really like the idea of implementing board game rules as a coding exercise. The only one I’ve ever been confronted with was tic tac toe, and I remember really having fun with the detecting winning moves part.
[1] https://github.com/DylanSp/tic-tac-toe-react/blob/master/src...
2 7 6
9 5 1
4 3 8
Here, if a triplet of one player's cells sums to 15, that player has won.Though the counting seems a bit weird. Two overlapping lines of 5 seems to count as "1 two, 2 five". I also managed to get two overlapping fours to count as "2 two, 2 four". Maybe I just don't understand how it's supposed to work?