Updated generic tic-tac-toe solver