How do I organize a program with at least a GUI, an AI, and a driver file? I need to design a checkers program. I really just need to know how to organize it so its OOP(meaning what extends what, and how do I pass the updated board if the human player clicks it to the AI, and whatnot)
You might try searching for the MVC (Model, View, Controller) pattern. The View would be the GUI itself, the model would be the data concerning the board grid and piece values and positions, and the controller would co-ordinate activities, getting moves from player or AI, applying them to the model, and optionally refreshing the view from the model (this could be automatic if the view is listening to or observing changes in the model).
There can be MVC patterns at various levels, from application level down to individual GUI components - for example, Swing uses MVC for GUI components.
All truths are easy to understand once they are discovered; the point is to discover them...
G. Galilie
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
Bookmarks