Hello guys. I have an excercise and I need some help. I am asked to play a game that has a number of players and a number of heaps inserted by the user. Each heap has some coins. The players takes some coins from one heap and if he wants puts some of them in an other. They call it specker game. Dont know if you have heard about it. The excercise has 3 parts which is actually building classes and it is checked by a grader which is made by our teacher. Grader puts a main() and test cases. Here are the parts
1:
1 class Move {
2 public:
3 // Take sc coins from heap sh and put tc coins to heap th.
4 Move(int sh, int sc, int th, int tc);
5
6 int getSource() const;
7 int getSourceCoins() const;
8 int getTarget() const;
9 int getTargetCoins() const;
10
11 friend ostream & operator << (ostream &out, const Move &move);
12 };
1 class State {
2 public:
3 // State with h heaps, where the i-th heap starts with c[i] coins.
4 State(int h, constint c[]);
5 ~State();
6
7 void next(const Move &move) throw(logic_error);
8 bool winning() const;
9
10 int getHeaps() const;
11 int getCoins(int h) constthrow(logic_error);
12
13 friend ostream & operator << (ostream &out, const State &state);
14 };
In the instructions says that addHeap and addPlayer adds coins to the heaps and players one by one. My question is: How can i use some of the functions that i have created from the other parts and print the State, Move etc