I am a university student (1 year), and I have the task of making a Tic Tac Toe console game using the ACM library. I managed to get it to work with Player Player Player. Another part of this assignment requires it to work as Player VS Computer. Teacher told us not to create AI, but that ALWAYS ALWAYS win or bind each other. How can i implement this? I do not think that this can be implemented using a lot of if and else. Is there a smarter way?
I created one constructor called Board, in which there are all the methods necessary to create, display, update the playing field, to check whether X or O wins (or to bind), and check the line that the user enters (In To play, the user should enter something like (row_space_column ---> example: "3 1")). I also created another file ("TicTacToe.java"), which is the game itself.
So what are your opinions? (I use JAVA) (Sorry for my English, I'm Greek) Thank you!
source
share