Tic-tac-toe is a pen-and-paper game for two players, O and X, who take turns to mark the spaces in a 3×3 grid. The player who succeeds in placing three of their own marks in a horizontal, vertical or diagonal row wins the game. [wikipedia].
Design is going to be a subjective process; as such, there is no right solution, only acceptable solutions. The following process shows you a way to apply design to problems, given your knowledge of Java and object-oriented Design.
Read the problem description and identify Subjects, verbs, and objects. For example, in the sentence:
The Child throws the ball.
The Subject is "Child", the verb is "throws", and the object of the verb is ball. By going to the problem description, you will identify potential classes, instance variables, and methods. You should pay special attention to "has" relationships.
Tic-tac-toe is a pen-and-paper game for two players, O and X, who take turns to mark the spaces in a 3×3 grid. The player who succeeds in placing three of their own marks in a horizontal, vertical or diagonal row wins the game.
From this start, we identify the following points:
Note that the description leaves out some key points
We will work in class to divide this problem description into the relevant classes, attributes, methods.
Make sure you are familiar with the Tic Tac Toe problem game and its description.