Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Laborka.cpp : Defines the entry point for the console application.
- //
- #include <iostream>
- using namespace std;
- #define liczba_graczy 4
- int main()
- {
- int X;
- char litera;
- int wartosc,koniec;
- cin >> X;
- int G[liczba_graczy];
- int Poprzedni_ruch[liczba_graczy];
- bool Start[liczba_graczy];
- for (int i = 0; i < liczba_graczy; i++) {
- G[i] = 0;
- Start[i] = false;
- Poprzedni_ruch[i] = 0;
- }
- koniec = 1;
- while (koniec != 0) {
- for (int h = 0; h < liczba_graczy; h++) {
- cout << "*" << h << "*" << endl;
- litera = NULL;
- cin >> litera;
- if (litera == 'M') {
- cin >> wartosc;
- if (wartosc < 1 || wartosc >6)
- {
- cout << "Twoja wartosc jest za duza albo za mała.Podaj jeszcze raz wartosc oczek od 1-6";
- cin >> wartosc;
- }
- if (Start[h] == false) {
- if (Poprzedni_ruch[h] == 1 && wartosc == 6) {
- Start[h] = true;
- }
- }
- else {
- if(G[h]+wartosc <= X)
- G[h] += wartosc;
- }
- }
- else
- {
- for (int i = 0; i < liczba_graczy; i++) {
- cout << "G" << i + 1 << " punty: " << G[i] << endl;
- }
- h--;
- }
- if (G[h] >= X)
- koniec = 0;
- }
- }
- cout << "END OF GAME";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement