Glenpl

Untitled

Sep 13th, 2014
386
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <windows.h>
  3. #include <cstdlib>
  4. #include <string>
  5. #include <ctime>
  6. #include <stdio.h>
  7. #include <conio.h>
  8.  
  9. using namespace std;
  10.  
  11. int main()
  12. {
  13.     srand( time( NULL ) );
  14.     HANDLE kolor;
  15.     kolor = GetStdHandle( STD_OUTPUT_HANDLE );
  16.     string imie, nazwisko;
  17.     int oC=1, oR=1, oW=1, oH=1;
  18.     int fundusze, cebula;
  19.     int dzien=1, gielda = 1, wynik;
  20.     int wybor, logowanie, a, user;
  21.  
  22.     do
  23.     {
  24.         system ("CLS");
  25.         cout <<"1. Nowy uzytkownik \n";
  26.         cout <<"2. Bylem tu juz. \n";
  27.         cin >> user;
  28.         system ("CLS");
  29.         if(user==1)
  30.         {
  31.             cout << "Podaj Imie \n";
  32.             cin >> imie;
  33.             Sleep(300);
  34.             cout << "Podaj Nazwisko \n";
  35.             cin >> nazwisko ;
  36.             Sleep(300);
  37.             cout << "Wybierz kolor napisow (od 1-15) ";
  38.             cin >> a;
  39.             logowanie=0;
  40.             fundusze=500;
  41.             cebula=0;
  42.         }
  43.  
  44.         if(user==2)
  45.         {
  46.             cout << "Witamy Pownownie"<< imie<<nazwisko;
  47.             Sleep(500);
  48.             logowanie=0;
  49.         }
  50.  
  51.         if(user>2)
  52.         {
  53.             cout << "Wystapil blad, wysylamy do pana grupe naszych najlepszych malp. \n Prosze nie wylaczac komputera i siedziec spokojnie na swoim miejscu";
  54.             -getch();
  55.             logowanie=1;
  56.         }
  57.     }
  58.     while(logowanie==1);
  59.     int ujemnik((rand() % 40) +1);
  60.     int polska = ((rand() % 150 ) + 50);
  61.     int polska_s = ((rand() % 200 ) +30);
  62.     polska_s=polska-ujemnik;
  63.  
  64.     int rosja = rand();
  65.     int rosja_s = rand();
  66.     rosja>rosja_s;
  67.     int niemcy= rand();
  68.     int niemcy_s = rand();
  69.     int ameryka = rand();
  70.     int ameryka_s = rand();
  71.  
  72.     do
  73.     {
  74.         system ("CLS");
  75.         SetConsoleTextAttribute(kolor, a);
  76.  
  77.         cout << "Zalogowano \n";
  78.         cout << "\n Inwestor " << imie;
  79.         cout << " " << nazwisko << "\n";
  80.         SetConsoleTextAttribute( kolor, 14);
  81.         cout << "                                      dostepne fundusze : "<< fundusze <<"\n" ;
  82.         SetConsoleTextAttribute( kolor, 14);
  83.         cout << "                                       ilosc ton cebuli : "<<cebula<<"\n";
  84.         cout << "                                                  Dzien : "<<dzien<<"\n";
  85.         SetConsoleTextAttribute( kolor, a);
  86.         cout << " Wyswietlam gielde cebul: \n";
  87.         SetConsoleTextAttribute( kolor, a);
  88.         cout << "1. Cebulandia \n";
  89.         SetConsoleTextAttribute( kolor, a );
  90.         cout << "2. Mateczka Rosja \n";
  91.         SetConsoleTextAttribute( kolor, a);
  92.         cout << "3. Stolica Wermacht'u \n";
  93.         SetConsoleTextAttribute(kolor, a );
  94.         cout << "4. Hamburgerandia \n";
  95.         SetConsoleTextAttribute(kolor, a);
  96.         cout <<"5. Nastepny dzien (zmiana cen) \n";
  97.         SetConsoleTextAttribute(kolor, a);
  98.         cout <<"6. Wyjscie \n";
  99.         SetConsoleTextAttribute(kolor, 15  );
  100.         cout << "Wybierz swoja gielde (wpisz numer) ";
  101.         cin >> wybor ;
  102.         if(wybor==1)
  103.         {
  104.             system("CLS");
  105.             int poland;
  106.             int zakup;
  107.             int tal; //zgoda na zakup
  108.             SetConsoleTextAttribute(kolor, a);
  109.             cout <<"                  Cebulandia          \n";
  110.             cout<<"1. KUPNO: 1 tona cebuli / "<< polska <<" zloty \n2. SPRZEDAZ: 1 tona cebuli / "<<polska_s<<" zloty \n3. Wyjscie z gieldy 'Cebulandia'\n";
  111.             cin>> tal;
  112.             if(tal==1)
  113.             {
  114.                 cout << "1.Kup kilka cebul \n";
  115.                 cout << "2.Kup maksymalna mozliwa ilosc \n";
  116.                 cout << "Wybierz  ";
  117.                 cin >> zakup ;
  118.  
  119.                 if(zakup==1)
  120.                 {
  121.                     cout << "Ile cebul chce pan kupic? \n";
  122.                     cin >> poland ;
  123.                     poland=polska*poland ;
  124.                     if(fundusze>=poland)
  125.                     {
  126.                         cout << "Kosztowalo : "<< poland <<"\n";
  127.                         fundusze=fundusze-poland;
  128.                         cout <<"Pozostalo "<< fundusze ;
  129.                         oC=0;
  130.                         _getch();
  131.                         cebula=cebula+poland/polska;
  132.  
  133.                     }
  134.                     else //(fundusze<poland)
  135.                     {
  136.                         cout<<"Nie masz tyle pieniedzy, biedaku \n";
  137.                         cout<<"Wracam do gieldy";
  138.                         _getch();
  139.                     }
  140.                 }
  141.                 if(zakup==2)
  142.                 {
  143.                     int cebk;
  144.                     int kp = 1;
  145.                     cebk=fundusze/polska;
  146.                     cout<<"Mozesz kupic "<< cebk <<" Cebul \n";
  147.                     cout<<"Kupic? (1.tak | 2.nie) ";
  148.                     cin>>kp;
  149.  
  150.                     if(kp==1)
  151.                     {
  152.                         cebula=cebula+cebk;
  153.  
  154.                         cout<<"Kosztowało "<< cebk*polska <<"\n""Kupil pan "<<cebk<<"\n""Kupiono ma pan teraz "<< cebula;
  155.                         fundusze=fundusze-cebk*polska;
  156.                         oC=0;
  157.                         _getch();
  158.                     }
  159.                     if(kp==2)
  160.                     {
  161.                         cout<<"Nie to nie";
  162.                         oC=0;
  163.                         _getch();
  164.                     }
  165.                     if(kp>=3)
  166.                     {
  167.                         system("CLS");
  168.                         cout<<"Nie ma takiej opcji, przyrko mi";
  169.                         _getch();
  170.                         oC=0;
  171.                     }
  172.                 }
  173.  
  174.                 if(tal>=3)
  175.                 {
  176.                     system("CLS");
  177.                     cout<<"Nie ma takiej opcji, przyrko mi";
  178.                     _getch();
  179.                     oC=0;
  180.                 }
  181.             }
  182.         }
  183.  
  184.         if(wybor==5 )
  185.         {
  186.             system("CLS");
  187.             int ujemnik((rand() % 40) +1);
  188.             int polska = ((rand() % 150 ) + 50);
  189.             int polska_s = ((rand() % 200 ) +50);
  190.  
  191.  
  192.             int rosja = rand();
  193.             int rosja_s = rand();
  194.             rosja>rosja_s;
  195.  
  196.             int niemcy= rand();
  197.             int niemcy_s = rand();
  198.  
  199.             int ameryka = rand();
  200.             int ameryka_s = rand();
  201.             dzien=dzien+1;
  202.             cout<<"Minela noc. Jest dzien "<<dzien;
  203.             Sleep(700);
  204.  
  205.         }
  206.         if(wybor==6)
  207.         {
  208.             cout<<"Dziekuje";
  209.             gielda==0;
  210.             Sleep(400);
  211.  
  212.         }
  213.         if(wybor>=7)
  214.         {
  215.             cout<<"Nie ma takej opcji";
  216.             _getch();
  217.         }
  218.         system("CLS");
  219.     }
  220.     while(gielda==1);
  221.     return 0;
  222. }
Advertisement
Add Comment
Please, Sign In to add comment