Advertisement
Guest User

CubeRotations.h

a guest
Sep 18th, 2020
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 6.22 KB | None | 0 0
  1.  
  2. class Cube
  3. {
  4. public:
  5.     friend void WriteToFile(Cube &MyCube, bool makeRandomPositions);
  6.     friend void GetFromFile(Cube &MyCube, int numberOfCube);
  7.     friend void FirstStepSolve(Cube &MyCube, std::vector<char> &TempMatrix);
  8.     friend void SecondStepSolve(Cube &MyCube, std::vector<char> &TempMatrix);
  9.     friend void ThirdStepSolve(Cube &MyCube, std::vector<char> &TempMatrix);
  10.     friend void FourthStepSolve(Cube &MyCube, std::vector<char> &TempMatrix);
  11.     friend void FifthStepSolve(Cube &MyCube, std::vector<char> &TempMatrix);
  12.     friend void SixthStepSolve(Cube &MyCube, std::vector<char> &TempMatrix);
  13.     friend void SeventhStepSolve(Cube &MyCube, std::vector<char> &TempMatrix);
  14.  
  15.    
  16.     friend bool isSolvedForFirst(Cube &MyCube, std::vector<char> &TempMatrix);
  17.     friend bool isSolvedForSecond(Cube &MyCube, std::vector<char> &TempMatrix);
  18.     friend bool isSolvedForThird(Cube &MyCube, std::vector<char> &TempMatrix);
  19.     friend bool isSolvedForFourth(Cube &MyCube, std::vector<char> &TempMatrix);
  20.     friend bool isSolvedForFifth(Cube &MyCube, std::vector<char> &TempMatrix);
  21.     friend bool isSolvedForSixth(Cube &MyCube, std::vector<char> &TempMatrix);
  22.     friend bool isSolvedForSeventh(Cube &MyCube, std::vector<char> &TempMatrix);
  23.  
  24.     class Front;
  25.     class Back;
  26.     class Up;
  27.     class Down;
  28.     class Left;
  29.     class Right;
  30.  
  31.     class Front : public Matrix
  32.  
  33.     {
  34.         friend Up;
  35.         friend Down;
  36.         friend Left;
  37.         friend Right;
  38.         friend Back;
  39.  
  40.     public:
  41.         Front() : Matrix(){};
  42.  
  43.         void SetPosition(std::vector<char> *Cells){};
  44.         Front &operator=(const Front &other){};
  45.  
  46.         void getFrontSide(){};
  47.         std::vector<char> *getVector(){};
  48.  
  49.         ~Front(){};
  50.  
  51.     protected:
  52.         std::vector<char> FrontPosition_;
  53.  
  54.     }; // white -> Yellow
  55.  
  56.     class Back : public Matrix
  57.  
  58.     {
  59.     public:
  60.         Back() : Matrix(){};
  61.         void SetPosition(std::vector<char> *Cells){};
  62.         Back &operator=(const Back &other){};
  63.         void getBackSide(){};
  64.         std::vector<char> *getVector(){};
  65.  
  66.         ~Back(){};
  67.  
  68.     private:
  69.         std::vector<char> BackPosition_;
  70.     }; // Yellow -> White
  71.  
  72.     class Up : public Matrix
  73.     {
  74.     public:
  75.         Up() : Matrix(){};
  76.         void SetPosition(std::vector<char> *Cells){};
  77.  
  78.         Up &operator=(const Up &other){};
  79.         void getUpSide() const{};
  80.         std::vector<char> *getVector(){};
  81.         ~Up(){};
  82.  
  83.     private:
  84.         std::vector<char> UpPosition_;
  85.     }; // Blue -> Green
  86.  
  87.     class Down : public Matrix
  88.     {
  89.     public:
  90.         Down() : Matrix(){};
  91.         void SetPosition(std::vector<char> *Cells){};
  92.         Down &operator=(const Down &other){};
  93.         void getDownSide(){};
  94.         std::vector<char> *getVector(){};
  95.         ~Down(){};
  96.  
  97.     private:
  98.         std::vector<char> DownPosition_;
  99.     }; // Orange -> Red
  100.  
  101.     class Left : public Matrix
  102.     {
  103.     public:
  104.         Left() : Matrix(){};
  105.  
  106.         void SetPosition(std::vector<char> *Cells){};
  107.         Left &operator=(const Left &other){};
  108.         void getLeftSide(){};
  109.         std::vector<char> *getVector(){};
  110.  
  111.         ~Left(){};
  112.  
  113.     private:
  114.         std::vector<char> LeftPosition_;
  115.     }; // Green -> Blue
  116.  
  117.     class Right : public Matrix
  118.     {
  119.     public:
  120.         Right() : Matrix(){};
  121.  
  122.         void SetPosition(std::vector<char> *Cells){};
  123.         Right &operator=(const Right &other){};
  124.         void getRightSide(){};
  125.         std::vector<char> *getVector(){};
  126.  
  127.         ~Right(){};
  128.  
  129.     private:
  130.         std::vector<char> RightPosition_;
  131.     }; // Red -> Orange
  132.  
  133.     Cube &operator=(const Cube &other){};
  134.     void setPosition(const std::string Position, std::vector<char> &OneSidePosition){};
  135.     void ChangeOrientation(std::string To, int NumOfTurns){};
  136.  
  137.     void R(Cube &MyCube, std::vector<char> &TempMatrix){};
  138.     void R_(Cube &MyCube, std::vector<char> &TempMatrix){};
  139.     void U(Cube &MyCube, std::vector<char> &TempMatrix){};
  140.     void U_(Cube &MyCube, std::vector<char> &TempMatrix){};
  141.     void L(Cube &MyCube, std::vector<char> &TempMatrix){};
  142.     void L_(Cube &MyCube, std::vector<char> &TempMatrix){};
  143.     void F(Cube &MyCube, std::vector<char> &TempMatrix){};
  144.     void F_(Cube &MyCube, std::vector<char> &TempMatrix){};
  145.     void D(Cube &MyCube, std::vector<char> &TempMatrix){};
  146.     void D_(Cube &MyCube, std::vector<char> &TempMatrix){};
  147.     void B(Cube &MyCube, std::vector<char> &TempMatrix){};
  148.     void B_(Cube &MyCube, std::vector<char> &TempMatrix){};
  149.     void RightSideAlgorithm(Cube &MyCube, int NumOfTurns){};
  150.     void LeftSideAlgorithm(Cube &MyCube, int NumOfTurns){};
  151.  
  152.     Cube(){};
  153.  
  154.     ~Cube(){};
  155.     void getCube(){};
  156.  
  157. protected:
  158.     Front FrontSide;
  159.     Back BackSide;
  160.     Up UpSide;
  161.     Left LeftSide;
  162.     Down DownSide;
  163.     Right RightSide; // Objects imagine sides of Cube.
  164. };
  165. int cur;
  166. template <class T1, class T2>
  167. void exp(std::vector<T1> vv, std::vector<T2> vv1)
  168. {
  169.     class SomePractice
  170.     {
  171.     private:
  172.         std::vector<int> firstCaseOfObj_;
  173.         int size_;
  174.  
  175.     public:
  176.         SomePractice(std::vector<int> firstCaseOfObj, int size){};
  177.         ~SomePractice(){};
  178.     };
  179. }
  180. void init(Cube &MyCube, int size = 3){};
  181. bool isSolvedForSeventh(Cube &MyCube,std::vector<char> &TempMatrix){};
  182. bool isSolvedForFirst(Cube &MyCube, std::vector<char> &TempMatrix){};
  183. bool isSolvedForSecond(Cube &MyCube, std::vector<char> &TempMatrix){};
  184. bool isSolvedForThird(Cube &MyCube, std::vector<char> &TempMatrix){};
  185. bool isSolvedForFourth(Cube &MyCube, std::vector<char> &TempMatrix){};
  186. bool isSolvedForFifth(Cube &MyCube, std::vector<char> &TempMatrix){};
  187. bool isSolvedForSixth(Cube &MyCube, std::vector<char> &TempMatrix){};
  188. void FirstStepSolve(Cube &MyCube, std::vector<char> &TempMatrix){};
  189. void SecondStepSolve(Cube &MyCube, std::vector<char> &TempMatrix){};
  190. void ThirdStepSolve(Cube &MyCube, std::vector<char> &TempMatrix){};
  191. void FourthStepSolve(Cube &MyCube, std::vector<char> &TempMatrix){};
  192. void FifthStepSolve(Cube &MyCube, std::vector<char> &TempMatrix){};
  193. void SixthStepSolve(Cube &MyCube, std::vector<char> &TempMatrix){};
  194. void SeventhStepSolve(Cube &MyCube, std::vector<char> &TempMatrix){};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement