My apologies to those of you who are more advanced Visual C++ .NET
programmers, but I am working on a project for an MBA course that is
condensed into an eight-week schedule, and I need help getting a
program up and running with proper files and documentation to be handed
in for a grade (on Microsoft Visual Studio .NET 2003).
I am being graded on how well I incorporate advanced C++ features such
as inheritance, polymorphic programming, exception-handling, components
of the Standard Library, etc. as well as whether the program runs and
compiles correctly and is properly documented. Being relatively new to
both C++ and Visual Studio .NET, I am not sure what my header files,
source files, and resource files will look like. I have followed the
basic examples in the online tutorials that Microsoft offers, but I
want to make sure I'm getting the details right for a program more
complex than a "Hello World" program.
What I am trying to develop is a very simplified simulation of Conway's
biological game of life. Keep in mind that this is for an MBA course
and not for an advanced science course. The rules of the game I'd like
to incorporate into the program are, for a cluster of cells:
1. Any cell with fewer than two neighbors dies.
2. Any cell with more than three neighbors dies.
3. Any cell with two or three neighbors lives.
I am thinking that I would like the program to be a variation on a card
shuffling and dealing simulation--an array of data structures--that
appears on p. 1062 of Harvey Deitel's textbook, C++: How to Program
(Fifth Edition) (unless anyone can think of a better model). Instead of
using the class "DeckofCards" as my array of data structures, I will
use the class "ClusterOfCells". My objects will be the individual
cells.
I would like to use polymorphic programming in the sense that each
cell's identity will change (it will be a dead cell or live cell) based
on the inputs or functions that act on it. I am debating whether some
basic selection/repetition statements are the best way the develop the
basic logic of the game, or if there is some way to incorporate virtual
functions with dynamic binding into the program, so that each cell is
exhibiting the behavior of surviving or dying based on conditions in
the cell's environment. Regardless of whether my functions are virtual
or static, I will need them to act on a cell so that they communicate
to a cell how many neighbors it has and then cause the cell to live or
die based on the number of neighbors.
Finally, I would like to incorporate the "remove" and "replace"
algorithms from the Standard Library so that a dead cell is removed
from the cluster of cells and is replaced by a live cell. And again, I
need to incorporate exception handling, document everything properly,
and make sure everything compiles and runs correctly.
Any help would be greatly appeciated, as I am under a tight deadline!