Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <ctime>
- #include <windows.h>
- using namespace std;
- int main()
- {
- int plansza[11][11];
- int zycia=3;
- int kolumna, wiersz;
- int hpUp=0;
- int punkty=0;
- //------------------------------
- //randomizowanie planszy
- //------------------------------
- srand(time(NULL));
- for(int k=1;k<11;k++)
- {
- for(int w=1;w<11;w++)
- {
- plansza[k][w]=rand()%2;
- }
- }
- while(zycia>0)
- {
- //------------------------------
- //debug wyświetlanie planszy
- for(int k=1;k<11;k++)
- {
- for(int w=1;w<11;w++)
- {
- cout<<plansza[k][w];
- cout<<" ";
- }
- cout<<endl;
- }
- //koniec debugu
- //-------------------------------
- cout<<"Zycia: "<<zycia<<endl;
- cout<<"Punkty: "<<punkty<<endl;
- cout<<"Streak do hp upa: "<<hpUp<<endl<<endl;
- cout<<"Podaj kolumne i wiersz (miedzy 1 a 10)(i oddziel enterkami mordeczko): "<<endl;
- cin>>kolumna;cin>>wiersz;cout<<endl;
- if(kolumna>10||kolumna<1||wiersz>10||wiersz<1)
- {
- system("cls");
- cout<<"typie gdzie ty lecisz"<<endl;
- }
- else if(plansza[kolumna][wiersz]==1)
- {
- system("cls");
- punkty++;
- hpUp++;
- plansza[kolumna][wiersz]=2;
- if(hpUp==2){zycia++;hpUp=0;cout<<"Hp Up!"<<endl;}
- cout<<"Hit or miss, I guess they never miss, huh?"<<endl<<endl<<endl<<endl;
- }
- else if(plansza[kolumna][wiersz]==0)
- {
- system("cls");
- hpUp=0;
- zycia--;
- cout<<"jak kulom w puot"<<endl<<endl<<endl<<endl;
- }
- else if(plansza[kolumna][wiersz]==2)
- {
- system("cls");
- cout<<"Ale to juz byloooooooo..."<<endl;
- cout<<"I nie wroci wieceeeeej..."<<endl<<endl<<endl<<endl;
- }
- }
- cout<<"przegrana mordko, wypadasz z teleturnieju"<<endl;
- cin.get();
- cin.get();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement