Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main()
- {
- int domek=1, miesz=2, pod=3, wy, zl=1000, d=0, m=0;
- cout << "Witaj w mini grze !" << endl;
- cout << "Masz za zadanie rozwinac swoja wioske." << endl;
- do
- {
- cout << "Zloto : " << zl << " domki : " << d << " mieszkancy : " << m << endl;
- cout << "1 = wybuduj domek" << endl;
- cout << "2 = kup mieszkancow" << endl;
- cout << "3 = zbierz podatek" << endl;
- cout << "4 = wyjscie" << endl;
- cout << endl;
- cout << "twoj wybor : ";
- cin >> wy;
- switch(wy)
- {
- case 1:
- if(zl>=100)
- {
- zl=zl-100;
- d++;
- }
- else
- {
- cout << "nie masz pieniedzy!" << endl;
- if(m>0)
- {
- cout << "pobierz podatek jezeli chcesz grac dalej!" << endl;
- cout << "szansa : ";
- cin >> wy;
- if(wy!=3)
- {
- cout << "nie pobrales podatku!" << endl;
- cout << "jestes bankrutem!" << endl;
- exit(0);
- }
- }
- }
- break;
- case 2:
- if(zl<150 && m<1)
- {
- cout << "nie masz mieszkancow od ktorych pobralbys podatek!" << endl;
- exit(0);
- }
- if(d<1)
- {
- cout << "mieszkancy nie maja gdzie mieszkac, wybuduj im dom!" << endl;
- system("pause");
- }
- else
- {
- if(zl>=150)
- {
- zl=zl-150;
- m++;
- }
- else
- {
- cout << "nie masz pieniedzy!" << endl;
- if(m>0)
- {
- cout << "pobierz podatek jezeli chcesz grac dalej!" << endl;
- cout << "szansa : ";
- cin >> wy;
- if(wy!=3)
- {
- cout << "nie pobrales podatku!" << endl;
- cout << "jestes bankrutem!" << endl;
- exit(0);
- }
- }
- }
- }
- break;
- case 3:
- zl=zl+m*10;
- break;
- case 4:
- exit(0);
- break;
- default:
- cout << "podales nie poprawna opcje!" << endl;
- break;
- }
- cout << endl;
- system("cls");
- }while(wy=4);
- system("pause");
- return 0;
- }
Add Comment
Please, Sign In to add comment