Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- #include <string>
- #include <cstdlib>
- using namespace std;
- int pola[10][10]]; //pola liczone od 0-9 !
- string start;
- using byte = unsigned char;
- int main()
- {
- cout << "Gra w statki dla Pani Moniki :D"<<endl;
- Sleep (1200);
- cout << "Zasady: "<<endl;
- Sleep (1200);
- cout << "1. Strzela tylko Gracz. "<<endl;
- Sleep (1200);
- cout << "2. Gra toczy sie dopolki nie zatopisz wszystkich statkow przeciwnika. "<<endl;
- Sleep (1200);
- cout << "3. Prosze nie wchodzic w kod Gry! :D "<<endl<<endl<<endl;
- Sleep (3000);
- cout << "Wpisz "Start" aby zaczac: ";
- cin >> start <<endl<<endl<<endl;
- unsigned strzaly = 0;
- byte statki = 9; //ilosc statkow
- byte pola[10][10];
- // 0 - puste pole
- // 1 - pole ze statkiem
- // 2 - pole trafione przez uzytkownika
- for (byte i=0; i<statki; ++i)
- {
- byte x,y;
- do
- {
- x=rand()%10;
- y=rand()%10;
- }
- while(pola[x][y] == 1);
- pola[x][y] = 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement