Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. #include <algorithm>
  2. #include <iostream>
  3. #include <vector>
  4.  
  5.  
  6. using namespace std;
  7.  
  8. struct position
  9. {
  10. int x;
  11. int y;
  12. };
  13.  
  14. class Box
  15. {
  16. public:
  17. position currentPosition;
  18.  
  19. };
  20.  
  21.  
  22. int main(int argc, const char * argv[])
  23. {
  24.  
  25. Box box1 = Box();
  26. Box box2 = Box();
  27. Box box3 = Box();
  28. Box box4 = Box();
  29. Box box5 = Box();
  30. Box box6 = Box();
  31. Box box7 = Box();
  32. Box box8 = Box();
  33. Box box9 = Box();
  34.  
  35.  
  36. // vector<vector<Box>> boxes2dVector;
  37. //
  38. vector<vector<Box>> boxes2dVector =
  39. {
  40. {box1, box2,box3},
  41. {box4, box5,box6},
  42. {box7, box8,box9}
  43.  
  44. };
  45.  
  46.  
  47. return 0;
  48. }
  49.  
  50. position getPositionOfBox (Box box)
  51. {
  52. position resultPositon;
  53.  
  54. /*
  55. This is what I need...some code that finds the position in the of a Box object in side a 2d array
  56. */
  57.  
  58.  
  59. return resultPositon;
  60. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement