Skip to content

Latest commit

 

History

History
33 lines (27 loc) · 595 Bytes

File metadata and controls

33 lines (27 loc) · 595 Bytes

cube_algorithm_generator

This is a code written in C++ for the generation of the pattern for scrambling a cube

#define randmax 32767

using namespace std;

char pyraminx(int l){ char x; array[]={"F","B","R","L","F*","B*","R*","L*","f","r","l","b","f*","b*","l*","r*"}; for(int i=0;i<l;i++){ int randnum=rand(); int randnum=floor((rand()/(float)randmax)*l); x=array[randnum]; cout<<x; }

}

int main(){ string s;int l; cout<<"Enter the type of cube:"; cin>>s; cout<<"Enter the length"; cin>>l; if(s=="pyraminx"){ pyraminx(l); } else if(s=="3x3x3"){ cube3(l); }

}