Prolog implementation of Tic-Tac-Toe game