Tic-Tac-Toe back-end