Advertisement
Guest User

Untitled

a guest
Aug 29th, 2015
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <time.h>
  4.  
  5. using namespace std;
  6.  
  7. string mapa[15];
  8.  
  9. void wypelnij(string* mapa, unsigned szerokosc, unsigned wysokosc)
  10. {
  11. for(unsigned y=0; y<wysokosc; ++y)
  12. {
  13. for(unsigned x=0; x<szerokosc; ++x)
  14. {
  15. char znak = rand()% 3+33;
  16. mapa[y] += znak;
  17. }
  18. }
  19. }
  20.  
  21. void narysuj(string* mapa, unsigned wysokosc)
  22. {
  23. for(unsigned i=0; i<wysokosc; ++i)
  24. cout << mapa[i] << endl;
  25. }
  26.  
  27. int main()
  28. {
  29. srand(time(NULL));
  30. wypelnij(mapa, 15, 15);
  31. narysuj(mapa, 15);
  32. system("pause");
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement