public static Cube4 RandomCube4(bool corner = true, bool wing = true, bool xcenter = true) { Tools.SetNPerm(corner ? Tools.rd.Next(40320) : 0, 8, out int[] cp); Tools.SetNTwist(corner ? Tools.rd.Next(2187) : 0, 8, out int[] co); for (int i = 0; i < 8; i++) { cp[i] = cp[i] * 3 + co[i]; } int[] w, xc; if (wing) { w = Wing.Random(); } else { w = new int[24]; for (int i = 0; i < 24; i++) { w[i] = i; } } if (xcenter) { xc = XCenter.Random(); } else { xc = new int[24]; for (int i = 0; i < 24; i++) { xc[i] = i >> 2; } } return(new Cube4(w, cp, xc)); }
public Cube4(int[] c, int[] w, int[] xc) { corner = new Corner(c); wing = new Wing(w); xcenter = new XCenter(xc); }
public Cube4() { corner = new Corner(); wing = new Wing(); xcenter = new XCenter(); }