SHARE
TWEET

Untitled

a guest Jun 17th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top