CLASSES
when making a game of tic tac toe, is the whole game a CLASS, and the player and board objects?
or is the board a class, and player another class.
Thats a rather vague question.... But I guess it would depend on how complex you wanted a game of "tic tac toe" to be code wise.
I''d normally break something like this into support classes first and go from there (EG: A drawing class for the peices and board then the peices themselfs, and so on)
-Nate
I''d normally break something like this into support classes first and go from there (EG: A drawing class for the peices and board then the peices themselfs, and so on)
-Nate
Usually the class is the definition, and an object is a variable (of type yourclass).
You should think of data when making OO designs, define what variables (members) and data you need, and combine them into a class with some methods to handle that data.
You can make the board a class, and the game a class with the board as one of its members.
You should think of data when making OO designs, define what variables (members) and data you need, and combine them into a class with some methods to handle that data.
You can make the board a class, and the game a class with the board as one of its members.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement