2
This commit is contained in:
parent
986073e9ae
commit
704b657326
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -144,7 +144,7 @@ int main()
|
||||
tab[i][j].kolor = "zolty";
|
||||
tab[i][j].kwiat = "dzwoneczki";
|
||||
tab[i][j].lisc = "sredni";
|
||||
tab[i][j].wod_check = 1;
|
||||
tab[i][j].wod_check = 2;
|
||||
tab[i][j].naw_check = 6;
|
||||
}
|
||||
else
|
||||
|
@ -16,7 +16,7 @@ using namespace std;
|
||||
|
||||
extern bool gra = true;
|
||||
char mapa[25][25];
|
||||
int pozycjaX = 1, pozycjaY = 1, ilosc_roslin = 0, ilosc_plonow = 0, ilosc_trupow = 0, paliwo = 0, konrolka = 0, h;
|
||||
int pozycjaX = 1, pozycjaY = 1, ilosc_roslin = 0, ilosc_plonow = 0, ilosc_trupow = 0, paliwo = 0, konrolka = 0, h , pog;
|
||||
clock_t start, stop;
|
||||
double czas;
|
||||
|
||||
@ -2414,7 +2414,7 @@ void updateMapa()
|
||||
czas = (stop - start) / (double)CLOCKS_PER_SEC;
|
||||
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 0x00F);
|
||||
cout << (int)czas << '\n' << ilosc_roslin << " roslin" << '\n' << ilosc_trupow << " martwych roslin" << '\n' << ilosc_plonow << " planow" << '\n' << paliwo << " zuzyte paliwo ";
|
||||
cout << glowna._droga << ' ' << h << ' ' << scierzka[0].waga << ' ' << scierzka[1].waga << ' ' << scierzka[2].waga << ' ' << scierzka[3].waga << ' ' << scierzka[4].waga << ' ' << scierzka[5].waga << ' ' << scierzka[6].waga << ' ' << scierzka[7].waga << ' ' << scierzka[8].waga << ' ' << scierzka[9].waga << ' ' << scierzka[10].waga << ' ' << scierzka[11].waga << ' ' << scierzka[12].waga << ' ' << scierzka[13].waga << ' ' << scierzka[14].waga << ' ' << scierzka[15].waga << ' ' << sciezka_temp.numer << ' ' << sciezka_temp.waga;
|
||||
cout << pog;
|
||||
}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ -2432,8 +2432,14 @@ void Odswiez(void* data)
|
||||
|
||||
void Chodz(void* data)
|
||||
{
|
||||
int x;
|
||||
do
|
||||
{
|
||||
x = rand() % 10;
|
||||
if (x < 3)
|
||||
{
|
||||
pogoda();
|
||||
}
|
||||
idz();
|
||||
} while (gra != FALSE);
|
||||
_endthread();
|
||||
@ -2613,4 +2619,61 @@ void dzialanie(char klikniecie)
|
||||
}
|
||||
|
||||
|
||||
void pogoda()
|
||||
{
|
||||
int i ,j;
|
||||
pog = rand() % 3;
|
||||
|
||||
for (i = 2; i <= 23; i++)
|
||||
{
|
||||
for (j = 2; j < 23; j++)
|
||||
{
|
||||
if (i != 2 && i != 4 && i != 7 && i != 10 && i != 13 && i != 16 && i != 19 && i != 22 && j != 12)
|
||||
{
|
||||
if (tab[i][j].rodzaj == 1)
|
||||
{
|
||||
tab[i][j].wod_check = 3;
|
||||
tab[i][j].naw_check = 4;
|
||||
}
|
||||
else if (tab[i][j].rodzaj == 2)
|
||||
{
|
||||
tab[i][j].wod_check = 5;
|
||||
tab[i][j].naw_check = 2;
|
||||
}
|
||||
else if (tab[i][j].rodzaj == 3)
|
||||
{
|
||||
tab[i][j].wod_check = 2;
|
||||
tab[i][j].naw_check = 6;
|
||||
}
|
||||
else
|
||||
{
|
||||
tab[i][j].wod_check = 10;
|
||||
tab[i][j].naw_check = 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 2; i <= 23; i++)
|
||||
{
|
||||
for (j = 2; j < 23; j++)
|
||||
{
|
||||
if (i != 2 && i != 4 && i != 7 && i != 10 && i != 13 && i != 16 && i != 19 && i != 22 && j != 12)
|
||||
{
|
||||
if (pog == 1) //zbyt słonecznie
|
||||
{
|
||||
tab[i][j].wod_check = tab[i][j].wod_check + 3;
|
||||
tab[i][j].naw_check--;
|
||||
}
|
||||
|
||||
else if (pog == 2) //burza
|
||||
{
|
||||
tab[i][j].wod_check--;
|
||||
tab[i][j].naw_check = tab[i][j].naw_check +3;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -54,7 +54,7 @@ struct roslina
|
||||
}roslina;
|
||||
|
||||
extern char mapa[25][25];
|
||||
extern int pozycjaX, pozycjaY, ilosc_roslin, ilosc_plonow, ilosc_trupow, paliwo, konrolka, h;
|
||||
extern int pozycjaX, pozycjaY, ilosc_roslin, ilosc_plonow, ilosc_trupow, paliwo, konrolka, h, pog;
|
||||
extern clock_t start, stop;
|
||||
extern double czas;
|
||||
|
||||
@ -78,6 +78,7 @@ void Odswiez(void* data);
|
||||
void Chodz(void* data);
|
||||
void ShowConsoleCursor(bool showFlag);
|
||||
void dzialanie(char klikniecie);
|
||||
void pogoda();
|
||||
|
||||
#endif _PCH_H
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user