Advertisement
marrruuuuuuuu

Untitled

Jan 14th, 2021
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. void generateMap(size_t w, size_t h, ofstream& sv_file) {
  2. sv_file << h << " " << w << endl;
  3.  
  4. for (size_t r = 0; r < h; r++) {
  5. for (size_t c = 0; c < w; c++) {
  6. int type = random(10);
  7.  
  8. if (type == 2) sv_file << "b";
  9. else if (type == 6) sv_file << "#";
  10. else if (type == 8) sv_file << "a";
  11. else sv_file << " ";
  12. }
  13. sv_file << endl;
  14. }
  15.  
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement