Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: JaminGrey on Nov 7th, 2012  |  syntax: C++  |  size: 0.49 KB  |  views: 29  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Common::Grid<std::string> grid(cRect(-1,-1,3,3), "O");
  2. grid.Resize(cRect(-2,-2,5,5), "X");
  3. grid.Expand(0, 2, 0, 0, ">");
  4. grid.Expand(2, 0, 0, 0, "<");
  5. grid.Expand(0, 1, "-");
  6.  
  7. grid[cPoint(0,0)] = "A";
  8.  
  9. unsigned int column = 0;
  10. for(const auto &element : grid)
  11. {
  12.     std::cout << element;
  13.          
  14.     column++;
  15.     if(column == 9)
  16.     {
  17.         column = 0;
  18.         std::cout << std::endl;
  19.     }
  20. }
  21.  
  22. Outputs:
  23. ---------
  24. <<XXXXX>>
  25. <<XOOOX>>
  26. <<XOAOX>>
  27. <<XOOOX>>
  28. <<XXXXX>>
  29. ---------