From f5be0a889e861758453de56b53f4b5735f4cfb14 Mon Sep 17 00:00:00 2001 From: valya1 Date: Mon, 2 May 2016 23:45:50 +0500 Subject: [PATCH] Update Backgammon.cpp --- Backgammon/Backgammon.cpp | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/Backgammon/Backgammon.cpp b/Backgammon/Backgammon.cpp index 8176297..11827c2 100644 --- a/Backgammon/Backgammon.cpp +++ b/Backgammon/Backgammon.cpp @@ -23,10 +23,10 @@ void init() void show_field() { - int pos = 11; // ��������� � 11 ������ + int pos = 11; // ãåíåðàöèÿ ñ 11 ÿ÷åéêè cout << " 11 10 9 8 7 6 5 4 3 2 1 0" << endl; cout << "---------------------------------------------------------------" << endl; - for (int i = 0; i < 15; i++) // ������ 15 ����� + for (int i = 0; i < 15; i++) // ïåðâûå 15 ñòðîê { pos = 11; cout << "| "; @@ -43,7 +43,7 @@ void show_field() } cout << "|" << endl; } - for (int i = 15; i > 0; i--) // ��������� 15 ����� + for (int i = 15; i > 0; i--) // ïîñëåäíèå 15 ñòðîê { pos = 12; cout << "| "; @@ -61,7 +61,6 @@ void show_field() cout << "|" << endl; } - cout << "---------------------------------------------------------------" << endl; cout << " 12 13 14 15 16 17 18 19 20 21 22 23" << endl; for (int i = 0; i < 3; i++) @@ -73,39 +72,39 @@ void throw_dice() srand(time(0)); dice1 = rand() % 6 + 1; dice2 = rand() % 6 + 1; - cout << " �� ������ ������ ������: " << dice1 << endl; - cout << " �� ������ ������ ������: " << dice2 << endl; + cout << " Íà ïåðâîì êóáèêå âûïàëî: " << dice1 << endl; + cout << " Íà âòîðîì êóáèêå âûïàëî: " << dice2 << endl; } void turn(int player) { vecint dices; int pos, points; - bool flag = 0; // ������� ����, ��� ��� ����� + bool flag = 0; // ïðèçíàê òîãî, ÷òî õîä âåðåí throw_dice(); dices.push_back(dice1); dices.push_back(dice2); - if (dice1 == dice2) // ����� + if (dice1 == dice2) // äóáëü { - cout << "��� ����� �����!!!" << endl << endl;; + cout << "Âàì âûïàë äóáëü!!!" << endl << endl;; dices.push_back(dice1); dices.push_back(dice2); } while (!dices.empty()) { - cout << "������� ����� ������, ������ ������������: "; + cout << "Ââåäèòå íîìåð ÿ÷åéêè, îòêóäà ïåðåñòàâëÿòü: "; cin >> pos; while (chip[pos] != p[player - 1]) { - cout << "������ ������ ������ �������!" << endl; + cout << "Õâàòèò õîäèòü ÷óæèìè ôèøêàìè!" << endl; cin >> pos; } - cout << "���������� �����: "; + cout << "Êîëè÷åñòâî î÷êîâ: "; cin >> points; for (int i = 0; i < dices.size(); i++) if (points == dices[i]) { - dices.erase(dices.begin() + i); // ������� ����� �� ������� ������� + dices.erase(dices.begin() + i); // óäàëÿåì êóáèê èç ìàññèâà êóáèêîâ flag = true; break; } @@ -119,7 +118,7 @@ void turn(int player) show_field(); if (!dices.empty()) - cout << "� ��� �������� ��������� ����: " << endl; + cout << "Ó âàñ îñòàëèñü ñëåäóþùèå õîäû: " << endl; for (int i = 0; i < dices.size(); i++) cout << dices[i] << " "; cout << endl;