Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- class Game
- {
- const string name1 = "Игрок 1", name2 = "Игрок 2";
- int maxPoints = 0, currPoints1 = 0, currPoints2 = 0, scoresForStroke;
- bool p = false; //false = ходит первый игрок, true = ходит второй игрок
- public:
- void Go()
- {
- if (p)
- {
- Info();
- EnterPoints();
- cout << "Yes";
- currPoints2 -= scoresForStroke;
- }
- else
- {
- Info();
- EnterPoints();
- cout << "Yes";
- currPoints1 -= scoresForStroke;
- }
- }
- void Info()
- {
- cout << "\nУ " << name1 << " осталось баллов: " << currPoints1 << " \n";
- cout << "У " << name2 << " осталось баллов: " << currPoints2 << "\n";
- }
- void EnterPoints()
- {
- do
- {
- cout << "Введите количество баллов для хода: \n";
- } while (!(cin >> scoresForStroke));
- }
- };
- int main()
- {
- setlocale(LC_ALL, "Russian");
- Game *g = new Game();
- g->Go();
- system("pause>>void");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement