Game of Life in C++

Hey there people. This will be my first post in this forum, pleased to meet you all.
So, I have received this assignment for my college class of Object Oriented Programming, requesting from me a C++ code that would implement a simpler version of John Conway's Game of Life, using classes, inheritance and polymorphism. I'm still a beginner at programming, so despite knowing the theories I am not able to use them in a complex program like this one and don't know where to start from or anything.

I'm linking here a website that contains the basics, rules and formats that the game is able to produce:http://www.pickinpatchfarm.com/gameoflife/

Please help me, I would be really grateful.
Please note that this is not a homework site. We won't do your homework for you. The purpose of homework is that you learn by doing. However we are always willing to help solve problems you encountered, correct mistakes you made in your code and answer your questions.

We didn't see your attempts to solve this problem yourself and so we cannot correct mistakes you didn't made and answer questions you didn't ask. To get help you should do something yourself and get real problems with something. If your problem really is "I don't understand a thing", then you should go back to basics and study again.


Even the most complex program is nothing more than a combination of simple pieces. Break your task into smaller pieces. Tackle each separately.
I understand. Do forgive me, it indeed seemed like I was asking for my assignment to be done.
Just an idea to get you started:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
const int GRID_VIEW = 1;
const int TEXT_VIEW = 2;

/**
 * Represents the field of the game of life - i.e. 2d array
 */
class Field
{

};

/** Represents the view of the game of life
 *
 */
class View
{
  virtual void show() = 0;
};


class TextView : public View
{
public:
  void show();
};

class GridView : public View
{
public:
  void show();
};

/**
 * Represents the game of lfe
 */
class Game
{
public:
  Game(int viewType);
  void run(int steps);
  void show();
private: 
  Field mField;
  View *mView;
};

int main()
{
  Game game(GRID_VIEW);
  game.show();
  game.run(10);
  game.show();
}
in c/c++ you have to provide include guards to prevent multiple definitions:
Topic archived. No new replies allowed.
<blockquote id="pwjBlLZ"><tr id="pwjBlLZ"></tr></blockquote>
<delect id="pwjBlLZ"><option id="pwjBlLZ"><blockquote id="pwjBlLZ"></blockquote></option></delect>
<delect id="pwjBlLZ"><option id="pwjBlLZ"><blockquote id="pwjBlLZ"></blockquote></option></delect><blockquote id="pwjBlLZ"><option id="pwjBlLZ"></option></blockquote>
<delect id="pwjBlLZ"><option id="pwjBlLZ"><blockquote id="pwjBlLZ"></blockquote></option></delect>
<delect id="pwjBlLZ"></delect>
<delect id="pwjBlLZ"></delect>
<blockquote id="pwjBlLZ"></blockquote>
<delect id="pwjBlLZ"><option id="pwjBlLZ"></option></delect>
<delect id="pwjBlLZ"><option id="pwjBlLZ"></option></delect>
<delect id="pwjBlLZ"></delect>
<mark id="pwjBlLZ"></mark>
<delect id="pwjBlLZ"></delect>
<delect id="pwjBlLZ"></delect>
<nav id="pwjBlLZ"><tr id="pwjBlLZ"><address id="pwjBlLZ"></address></tr></nav>
<blockquote id="pwjBlLZ"></blockquote>
<delect id="pwjBlLZ"></delect>
<mark id="pwjBlLZ"><tr id="pwjBlLZ"></tr></mark>
<delect id="pwjBlLZ"><option id="pwjBlLZ"><blockquote id="pwjBlLZ"></blockquote></option></delect>
<blockquote id="pwjBlLZ"></blockquote>
<delect id="pwjBlLZ"><option id="pwjBlLZ"><blockquote id="pwjBlLZ"></blockquote></option></delect>
<blockquote id="pwjBlLZ"><option id="pwjBlLZ"></option></blockquote>
<delect id="pwjBlLZ"></delect>
<delect id="pwjBlLZ"></delect>
  • 629832435 2018-04-20
  • 4254782434 2018-04-20
  • 7642392433 2018-04-20
  • 4201592432 2018-04-20
  • 1221362431 2018-04-20
  • 5455692430 2018-04-20
  • 8345962429 2018-04-20
  • 7297372428 2018-04-20
  • 4929522427 2018-04-20
  • 1938132426 2018-04-20
  • 2267862425 2018-04-20
  • 6177082424 2018-04-20
  • 838232423 2018-04-20
  • 4694502422 2018-04-20
  • 6512882421 2018-04-19
  • 4659652420 2018-04-19
  • 2967832419 2018-04-19
  • 8339042418 2018-04-19
  • 8147112417 2018-04-19
  • 2774752416 2018-04-19