![Computers and Technology](/tpl/images/cats/informatica.png)
Computers and Technology, 13.10.2020 15:01, Mariefritz13
Write a C++ class to represent the state of a game of Mancala. It will not be responsible for choosing a move, but it will be responsible for making a choosen move. Your program might be used as fllows.
#include
#include
using namespace std;
int main()
{
Mancala g;
cout << g;
g. move(4);
cout << g;
g. move(3);
cout << g;
g. move(3);
cout << g;
cout << "player: " << g. getPlayer() << "\n";
cout << "score: " << g. getScore(0) << " to " << g. getScore(1) << "\n";
}
First, notice you need a default constructor that sets up the initial board.
Second, you need two "getter" functions to allow public access to some game state. Specifically, getPlayer() and getScore(int player). If the game is over getPlayer() should return -1.
Next, in order to allow cout << g to work, you need to overload operator<< for output streams and your class. Output for the initial game board is shown below. Since this will require access to private data, you must make it a friend function.
This is not the whole problem but I need this portion to make sense in some C++ program format
![answer](/tpl/images/cats/otvet.png)
Answers: 1
Other questions on the subject: Computers and Technology
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 04:30, shadenShaden2037
What is the process in which the software development team compiles information to determine the final product
Answers: 1
![image](/tpl/images/cats/informatica.png)
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 14:30, thelordoftheknowwjo4
In a home that has 120 v service, there is an electric appliance that has a resistance of 12 ohms. how much power will this appliance consume? a. 10 w b. 120 w c 1200 w d. 1440 w
Answers: 1
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 18:30, brendahndz8676
Is a type of bullying that takes place when a person intentionally posts negative information about another person that is not true.
Answers: 2
Do you know the correct answer?
Write a C++ class to represent the state of a game of Mancala. It will not be responsible for choosi...
Questions in other subjects:
![Konu](/tpl/images/cats/mat.png)
Mathematics, 21.08.2019 09:50
![Konu](/tpl/images/cats/mat.png)
Mathematics, 21.08.2019 09:50
![Konu](/tpl/images/cats/istoriya.png)
![Konu](/tpl/images/cats/health.png)
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/istoriya.png)
History, 21.08.2019 10:00
![Konu](/tpl/images/cats/fizika.png)
Physics, 21.08.2019 10:00
![Konu](/tpl/images/cats/biologiya.png)
Biology, 21.08.2019 10:00