-
Notifications
You must be signed in to change notification settings - Fork 1
Initializing Cubot
Akshath Raghav edited this page Jul 4, 2021
·
3 revisions
String[] temp = {"RRRRRRRRR", "GGGGGGGGG", "OOOOOOOOO", "BBBBBBBBB", "WWWWWWWWW", "YYYYYYYYY"};
String[] temp2 = {"RRRR", "GWGW", "OOOO", "YBYB", "WBWB", "YGYG"};
Cubot cube1 = new Cubot(temp) ; // makes 3x3 with input
Cubot cube2 = new Cubot(temp2) ; // makes 2x2 with input
Cubot cube3 = new Cubot(true) ; // makes solved 3x3
Cubot cube4 = new Cubot(false) ; // makes solved 2x2
Cubot cube5 = new Cubot(cube4.cubeToArr) ; // essentially copies `cube4` into `cube5`
cube.makeSolved() // converts the held cube ( 2x2 or 3x3 ) to solved state
If you wish to convert the cube held but Cubot into its solved state in-place, then use makeSolved() as shown above
If you wish to copy one Cubot object to another, use cubeToArr()
If you wish to just make a solved Cubot, use either true
or false
in place of the String[] param
- Add a String element to the {temp String[]} with the first letters of each color you see on a face, in row-major order.
- While entering the White and Yellow faces, remember to keep the Green face facing you ( as shown in the pictures below )
- The pictures below are for 3x3, but do the same for 2x2
Read on to see Cubot in action