-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathColor.java
More file actions
56 lines (37 loc) · 904 Bytes
/
Color.java
File metadata and controls
56 lines (37 loc) · 904 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package Rubiks1D;
public class Color{
/**
* Notes
* @param C
*/
public static void left(Cube[] C) {
int[] colored = {51, 48, 45, 24, 21, 18, 6, 3, 0};
Cube temper;
for (int i = 0; i < colored.length/4; i++) {
int count = i;
temper = C[count];
while(count < 7){
int spot = colored[count];
System.out.println(spot);
int next = spot + Math.abs(spot - (colored[count+3]));
System.out.println(next);
C[spot] = C[next];
count +=3;
}
C[colored.length] = temper;
}
}
public void face (Cube [] C){
int[] colored = {6, 7, 8, 27, 30, 33, 47, 46, 45, 17, 14, 11};
Cube temper;
for(int spot: colored){//rotate){
temper = C[spot];
int position = 0;
for(int i = 0; i < colored.length/4; i ++){
C[spot] = C[spot + (spot - (colored[i] + 4))];
position = spot - (colored[i] + 4);
}
C[spot + position] = temper;
}
}
}