Na wstępnie chciałbym przeprosić za słabą czytelność kodu, następnym razem zrobię to lepiej...
Możę najpierw na szybko opiszę program.
W programie bawimy się w ,,hazardziste"...
Dajemy w opcjach ile chce się posiadać pieniędzy, jaka ma być najwyższa pula od przeciwników.Gdy już to zrobimy przechodzimy do gry.Gdy wygramy do naszych pięniędzy dodaje się pula, i jest wszystko ok,lecz gdy przegramy nic się nie dzieje mam ,,pieniedzy" tyle ile miałem na początku...
Proszę o pomoc :)
P.S dopiero zaczynam się w to bawić więc proszę bez zbędnych komentarzy...
------------------------------------------------------------
#include <iostream>
#include <stdio.h>
#include <cstdlib>
#include <conio.h>
#include <string>
#include <ctime>
#include <cstdlib>
#include <windows.h>
#include <algorithm>
using namespace std;
string wygrywy[2];
int s;
char wybor;
int w,l;
int money;
int uz,mn;
int mw,ml;
int main()
{
{
cout<<endl;
cout<<"------------------------------"<<endl;
cout<<"------------------------------"<<endl;
cout << "Weclome in SKYNOMET bY ShrAUP"<<endl;
cout<<"------------------------------"<<endl;
cout<<"------------------------------"<<endl;
cout<<"--------------"<<endl;
cout<<"-MENU-"<<endl;
cout<<"2.OPCJE"<<endl;
cout<<"3.EXIT "<<endl;
cout<<"------------------------------"<<endl;
cout<<"PULA NIE MOZE PRZEGKACZAC 1 MILIARDA"<<endl;
cout<<"------------------------------"<<endl;
wybor=getch();
cout<<endl;
switch(wybor)
{
cout<<endl;
startt:
cout<<"-----------------------------------------------------------"<<endl;
cout<<"-----------------------------------------------------------"<<endl;
cout<<"-------------Weclome in SKYNOMET bY ShrAUP-----------------"<<endl;
cout<<"-----------------------------------------------------------"<<endl;
cout<<"JEZELI OBSTAWISZ SUME JAKIEJ NIE POSIADASZ,PRZEJDZIESZ DO NASTEPNEJ KOLEJKI"<<endl;
cout<<"--------------"<<endl;
cout<<"-MENU-"<<endl;
cout<<"1.START"<<endl;
cout<<"3.EXIT "<<endl;
cout<<"-----------------------------------------------------------"<<endl;
cout<<"-----------------------------------------------------------"<<endl;
wybor=getch();
cout<<endl;
case '1':
{
system("cls");
start:
{
srand( time( NULL ) );
int liczba = std::rand()%uz+1;
std::cout << "W puli jest " << liczba << std::endl;
cout<<"Posiadasz $"<<mn<<endl;
cout<<"Ile chcesz Obstawic? :";
cin>>s;
if ((s>1) && (s<=mn))
{
for(int i=5;i>=0;i--)
{ Sleep(1000);
cout<<i<<endl;
}
system("cls");
srand (time(0));
s = rand() % 2 ;
if(s==0)
{
wygrywy[s]="PRZEGRYWASZ..";
mn=mn-s;
}
if(s==1)
{
wygrywy[s]="WYGRYWASZ..";
mn=mn+liczba;
}
cout << wygrywy[s]<< endl;
Sleep(2000);
system("cls");
}
goto start;
}
case '2':
{system("cls");
cout<<"Wybierz najwieksza pule od przeciwnikow: ";
cin>>uz;
cout<<"Wybierz ile chcesz posiadac pieniedzy: ";
cin>>mn;
{system("cls");
goto startt;
}
}
case '3':
exit(0);
break;
}
}
}
}