Tic-tac-toe game written in Java