Simple2012

print maze

May 31st, 2013
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. void Maze::Print_maze(std::string file = "no!ne") const{
  2.     if (file != "no!ne")
  3.         std::ofstream outfile(file);
  4.     for (int i = 0; i < Map.size(); i++)
  5.     {
  6.         for (int j = 0; j < Map[i].size(); j++)
  7.         {
  8.             if (file == "no!ne")
  9.                 std::cout << Map[i][j];
  10.             else
  11.                 outfile << Map[i][j];
  12.         }
  13.         if (file == "no!ne")
  14.             std::cout << std::endl;
  15.         else
  16.             outfile << std::endl;
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment