Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- #include <cstdlib>
- #include <string>
- #include <ctime>
- #include <stdio.h>
- #include <conio.h>
- using namespace std;
- int main()
- {
- srand( time( NULL ) );
- HANDLE kolor;
- kolor = GetStdHandle( STD_OUTPUT_HANDLE );
- string imie;
- string nazwisko;
- int oC=1;
- int oR=1;
- int oW=1;
- int oH=1;
- int fundusze;
- int cebula;
- int dzien=1;
- int gielda = 1;
- int wynik;
- int wybor;
- int logowanie;
- int a;
- int user;
- do
- {
- system ("CLS");
- cout <<"1. Nowy uzytkownik \n";
- cout <<"2. Bylem tu juz. \n";
- cin >> user;
- system ("CLS");
- if(user==1)
- {
- cout << "Podaj Imie \n";
- cin >> imie;
- Sleep(300);
- cout << "Podaj Nazwisko \n";
- cin >> nazwisko ;
- Sleep(300);
- cout << "Wybierz kolor napisow (od 1-15) ";
- cin >> a;
- logowanie=0;
- fundusze=500;
- cebula=0;
- }
- if(user==2)
- {
- cout << "Witamy Pownownie"<< imie<<nazwisko;
- Sleep(500);
- logowanie=0;
- }
- if(user>2)
- {
- cout << "Wystapil blad, wysylamy do pana grupe naszych najlepszych malp. \n Prosze nie wylaczac komputera i siedziec spokojnie na swoim miejscu";
- -getch();
- logowanie=1;
- }
- }
- while(logowanie==1);
- int ujemnik((rand() % 40) +1);
- int polska = ((rand() % 150 ) + 50);
- int polska_s = ((rand() % 200 ) +30);
- polska_s=polska-ujemnik;
- int rosja = rand();
- int rosja_s = rand();
- rosja>rosja_s;
- int niemcy= rand();
- int niemcy_s = rand();
- int ameryka = rand();
- int ameryka_s = rand();
- do
- {
- system ("CLS");
- SetConsoleTextAttribute(kolor, a);
- cout << "Zalogowano \n";
- cout << "\n Inwestor " << imie;
- cout << " " << nazwisko << "\n";
- SetConsoleTextAttribute( kolor, 14);
- cout << " dostepne fundusze : "<< fundusze <<"\n" ;
- SetConsoleTextAttribute( kolor, 14);
- cout << " ilosc ton cebuli : "<<cebula<<"\n";
- cout << " Dzien : "<<dzien<<"\n";
- SetConsoleTextAttribute( kolor, a);
- cout << " Wyswietlam gielde cebul: \n";
- SetConsoleTextAttribute( kolor, a);
- cout << "1. Cebulandia \n";
- SetConsoleTextAttribute( kolor, a );
- cout << "2. Mateczka Rosja \n";
- SetConsoleTextAttribute( kolor, a);
- cout << "3. Stolica Wermacht'u \n";
- SetConsoleTextAttribute(kolor, a );
- cout << "4. Hamburgerandia \n";
- SetConsoleTextAttribute(kolor, a);
- cout <<"5. Nastepny dzien (zmiana cen) \n";
- SetConsoleTextAttribute(kolor, a);
- cout <<"6. Wyjscie \n";
- SetConsoleTextAttribute(kolor, 15 );
- cout << "Wybierz swoja gielde (wpisz numer) ";
- cin >> wybor ;
- if(wybor==1)
- {
- system("CLS");
- int poland;
- int zakup;
- int tal; //zgoda na zakup
- SetConsoleTextAttribute(kolor, a);
- cout <<" Cebulandia \n";
- cout<<"1. KUPNO: 1 tona cebuli / "<< polska <<" zloty \n2. SPRZEDAZ: 1 tona cebuli / "<<polska_s<<" zloty \n3. Wyjscie z gieldy 'Cebulandia'\n";
- cin>> tal;
- if(tal==1)
- {
- cout << "1.Kup kilka cebul \n";
- cout << "2.Kup maksymalna mozliwa ilosc \n";
- cout << "Wybierz ";
- cin >> zakup ;
- if(zakup==1)
- {
- cout << "Ile cebul chce pan kupic? \n";
- cin >> poland ;
- poland=polska*poland ;
- if(fundusze>=poland)
- {
- cout << "Kosztowalo : "<< poland <<"\n";
- fundusze=fundusze-poland;
- cout <<"Pozostalo "<< fundusze ;
- oC=0;
- _getch();
- cebula=cebula+poland/polska;
- }
- else //(fundusze<poland)
- {
- cout<<"Nie masz tyle pieniedzy, biedaku \n";
- cout<<"Wracam do gieldy";
- _getch();
- }
- }
- if(zakup==2)
- {
- int cebk;
- int kp = 1;
- cebk=fundusze/polska;
- cout<<"Mozesz kupic "<< cebk <<" Cebul \n";
- cout<<"Kupic? (1.tak | 2.nie) ";
- cin>>kp;
- if(kp==1)
- {
- cebula=cebula+cebk;
- cout<<"Kosztowało "<< cebk*polska <<"\n""Kupil pan "<<cebk<<"\n""Kupiono ma pan teraz "<< cebula;
- fundusze=fundusze-cebk*polska;
- oC=0;
- _getch();
- }
- if(kp==2)
- {
- cout<<"Nie to nie";
- oC=0;
- _getch();
- }
- if(kp>=3)
- {
- system("CLS");
- cout<<"Nie ma takiej opcji, przyrko mi";
- _getch();
- oC=0;
- }
- }
- if(tal>=3)
- {
- system("CLS");
- cout<<"Nie ma takiej opcji, przyrko mi";
- _getch();
- oC=0;
- }
- }
- }
- if(wybor==5 )
- {
- system("CLS");
- int ujemnik((rand() % 40) +1);
- int polska = ((rand() % 150 ) + 50);
- int polska_s = ((rand() % 200 ) +50);
- int rosja = rand();
- int rosja_s = rand();
- rosja>rosja_s;
- int niemcy= rand();
- int niemcy_s = rand();
- int ameryka = rand();
- int ameryka_s = rand();
- dzien=dzien+1;
- cout<<"Minela noc. Jest dzien "<<dzien;
- Sleep(700);
- }
- if(wybor==6)
- {
- cout<<"Dziekuje";
- gielda==0;
- Sleep(400);
- }
- if(wybor>=7)
- {
- cout<<"Nie ma takej opcji";
- _getch();
- }
- system("CLS");
- }
- while(gielda==1);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment