Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- enum class Pole
- {
- puste, poszukiwacz, mur, wrog, skarb
- };
- const short N = 30;
- Pole plansza[N][N];
- void wypelnij_plansze()
- {
- for(short i = 0; i < N; ++i)
- for(short j = 0; j < N; ++j)
- {
- if(i == 0 || j == 0 || i == N - 1 || j == N - 1)
- plansza[i][j] = Pole::mur;
- else
- plansza[i][j] = Pole::puste;
- }
- // dopisać
- }
- void wypisz_plansze()
- {
- for(short i = 0; i < N; ++i)
- {
- for(short j = 0; j < N; ++j)
- switch(plansza[i][j])
- {
- case Pole::puste:
- cout << ' ';
- break;
- case Pole::mur:
- cout << '#';
- break;
- case Pole::poszukiwacz:
- cout << '@';
- break;
- case Pole::skarb:
- cout << '$';
- break;
- case Pole::wrog:
- cout << '!';
- }
- cout << endl;
- }
- }
- int main()
- {
- wypelnij_plansze();
- wypisz_plansze();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement