Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <time.h>
- using namespace std;
- int X;
- int G1 = 0; int rzutG1_1; int rzutG1_2;
- int G2 = 0; int rzutG2_1; int rzutG2_2;
- int G3 = 0; int rzutG3_1; int rzutG3_2;
- int G4 = 0; int rzutG4_1; int rzutG4_2;
- int rzut;
- int main()
- {
- srand(time(NULL));
- rzut = rand() % 6 + 1;
- cout << "Wprowadz wielkosc planszy" << endl;
- cin >> X;
- cout << X << endl;
- while ((G1 <= X) || (G2 <= X) || (G3 <= X) || (G4 <= X))
- {
- rzutG1_1 = rzut;
- rzutG2_1 = rzut;
- rzutG3_1 = rzut;
- rzutG4_1 = rzut;
- cout << "M " << rzutG1_1 << endl;
- cout << "M " << rzutG2_1 << endl;
- cout << "M " << rzutG3_1 << endl;
- cout << "M " << rzutG4_1 << endl;
- cout << "P " << endl;
- cout << G1 << ' ' << G2 << ' ' << G3 << ' ' << G4 << endl;
- if ((rzutG1_1 == 1) || (rzutG2_1 == 1) || (rzutG3_1 == 1) || (rzutG4_1 == 1))
- {
- rzutG1_2 = rzut;
- rzutG2_2 = rzut;
- rzutG3_2 = rzut;
- rzutG4_2 = rzut;
- cout << "M " << rzutG1_2 << endl;
- cout << "M " << rzutG2_2 << endl;
- cout << "M " << rzutG3_2 << endl;
- cout << "M " << rzutG4_2 << endl;
- cout << "P " << endl;
- cout << G1 << ' ' << G2 << ' ' << G3 << ' ' << G4 << endl;
- }
- }
- cout << "END OF GAME" << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement