private void InitURtoDF_MoveTable() { if (!this.LoadMoveTableSuccessful(Path.Combine(this.TablePath, "ur_to_df_move.file"), N_MOVE, N_URtoDF, out URtoDF_Move)) { CoordCube a = new CoordCube(); for (short i = 0; i < N_URtoDF; i++) { for (int j = 0; j < N_MOVE; j++) { a.URtoDF = i; a.Multiply(moves[j]); URtoDF_Move[i, j] = (short)a.URtoDF; } } SaveMoveTable(Path.Combine(this.TablePath, "ur_to_df_move.file"), URtoDF_Move); } }
private void InitFlipMoveTable() { if (!this.LoadMoveTableSuccessful(Path.Combine(this.TablePath, "flip_move.file"), N_MOVE, N_FLIP, out flipMove)) { CoordCube a = new CoordCube(); for (short i = 0; i < N_FLIP; i++) { for (int j = 0; j < N_MOVE; j++) { a.Flip = i; a.Multiply(moves[j]); flipMove[i, j] = a.Flip; } } SaveMoveTable(Path.Combine(this.TablePath, "flip_move.file"), twistMove); } }
private void InitFRtoBR_MoveTable() { if (!this.LoadMoveTableSuccessful(Path.Combine(this.TablePath, "fr_to_br_move.file"), N_MOVE, N_FRtoBR, out FRtoBR_Move)) { CoordCube a = new CoordCube(); for (short i = 0; i < N_FRtoBR; i++) { for (int j = 0; j < N_MOVE; j++) { a.FRtoBR = i; a.Multiply(moves[j]); FRtoBR_Move[i, j] = a.FRtoBR; } } SaveMoveTable(Path.Combine(this.TablePath, "fr_to_br_move.file"), FRtoBR_Move); } }
private void InitTwistMoveTable() { if (!this.LoadMoveTableSuccessful(Path.Combine(this.TablePath, "twist_move.file"), N_MOVE, N_TWIST, out twistMove)) { CoordCube a = new CoordCube(); for (short i = 0; i < N_TWIST; i++) { for (int j = 0; j < N_MOVE; j++) { a.Twist = i; a.Multiply(moves[j]); twistMove[i, j] = a.Twist; } } SaveMoveTable(Path.Combine(this.TablePath, "twist_move.file"), twistMove); } }
private void InitFRtoBR_MoveTable() { if (!this.LoadMoveTableSuccessful(Path.Combine(this.TablePath,"fr_to_br_move.file"), N_MOVE, N_FRtoBR, out FRtoBR_Move)) { CoordCube a = new CoordCube(); for (short i = 0; i < N_FRtoBR; i++) { for (int j = 0; j < N_MOVE; j++) { a.FRtoBR = i; a.Multiply(moves[j]); FRtoBR_Move[i, j] = a.FRtoBR; } } SaveMoveTable(Path.Combine(this.TablePath,"fr_to_br_move.file"), FRtoBR_Move); } }
private void InitFlipMoveTable() { if (!this.LoadMoveTableSuccessful(Path.Combine(this.TablePath,"flip_move.file"), N_MOVE, N_FLIP, out flipMove)) { CoordCube a = new CoordCube(); for (short i = 0; i < N_FLIP; i++) { for (int j = 0; j < N_MOVE; j++) { a.Flip = i; a.Multiply(moves[j]); flipMove[i, j] = a.Flip; } } SaveMoveTable(Path.Combine(this.TablePath,"flip_move.file"), twistMove); } }
private void InitTwistMoveTable() { if (!this.LoadMoveTableSuccessful(Path.Combine(this.TablePath,"twist_move.file"), N_MOVE, N_TWIST, out twistMove)) { CoordCube a = new CoordCube(); for (short i = 0; i < N_TWIST; i++) { for (int j = 0; j < N_MOVE; j++) { a.Twist = i; a.Multiply(moves[j]); twistMove[i, j] = a.Twist; } } SaveMoveTable(Path.Combine(this.TablePath,"twist_move.file"), twistMove); } }
private void InitURtoDF_MoveTable() { if (!this.LoadMoveTableSuccessful(Path.Combine(this.TablePath,"ur_to_df_move.file"), N_MOVE, N_URtoDF, out URtoDF_Move)) { CoordCube a = new CoordCube(); for (short i = 0; i < N_URtoDF; i++) { for (int j = 0; j < N_MOVE; j++) { a.URtoDF = i; a.Multiply(moves[j]); URtoDF_Move[i, j] = (short)a.URtoDF; } } SaveMoveTable(Path.Combine(this.TablePath,"ur_to_df_move.file"), URtoDF_Move); } }
private void InitMoves() { moves[0] = new CoordCube(CoordCube.FromInversions(new byte[N_CORNER] { 0, 1, 1, 1, 0, 0, 0, 0 }), CoordCube.FromInversions(new byte[N_EDGE] { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 }), new byte[N_CORNER] { 0, 0, 0, 0, 0, 0, 0, 0 }, new byte[N_EDGE] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }); moves[3] = new CoordCube(CoordCube.FromInversions(new byte[N_CORNER] { 0, 1, 1, 3, 0, 1, 1, 4 }), CoordCube.FromInversions(new byte[N_EDGE] { 0, 1, 1, 1, 0, 2, 2, 2, 5, 1, 1, 11 }), new byte[N_CORNER] { 2, 0, 0, 1, 1, 0, 0, 2 }, new byte[N_EDGE] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }); moves[6] = new CoordCube(CoordCube.FromInversions(new byte[N_CORNER] { 0, 0, 1, 1, 4, 1, 0, 0 }), CoordCube.FromInversions(new byte[N_EDGE] { 0, 0, 1, 1, 1, 1, 2, 2, 7, 4, 0, 0 }), new byte[N_CORNER] { 1, 2, 0, 0, 2, 1, 0, 0 }, new byte[N_EDGE] { 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0 }); moves[9] = new CoordCube(CoordCube.FromInversions(new byte[N_CORNER] { 0, 0, 0, 0, 0, 0, 0, 3 }), CoordCube.FromInversions(new byte[N_EDGE] { 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0 }), new byte[N_CORNER] { 0, 0, 0, 0, 0, 0, 0, 0 }, new byte[N_EDGE] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }); moves[12] = new CoordCube(CoordCube.FromInversions(new byte[N_CORNER] { 0, 0, 0, 1, 1, 4, 1, 0 }), CoordCube.FromInversions(new byte[N_EDGE] { 0, 0, 0, 1, 1, 1, 1, 2, 2, 7, 4, 0 }), new byte[N_CORNER] { 0, 1, 2, 0, 0, 2, 1, 0 }, new byte[N_EDGE] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }); moves[15] = new CoordCube(CoordCube.FromInversions(new byte[N_CORNER] { 0, 0, 0, 0, 1, 1, 4, 1 }), CoordCube.FromInversions(new byte[N_EDGE] { 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 7, 4 }), new byte[N_CORNER] { 0, 0, 1, 2, 0, 0, 2, 1 }, new byte[N_EDGE] { 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1 }); for (int i = 0; i < N_MOVE; i += 3) { CoordCube move = moves[i].DeepClone(); for (int j = 1; j < 3; j++) { move.Multiply(moves[i]); moves[i + j] = move.DeepClone(); } } }
private void InitUBtoDF_MoveTable() { if (LoadMoveTableSuccessful( Path.Combine(this.TablePath, "ub_to_df_move.file"), N_MOVE, N_UBtoDF, out this.UBtoDF_Move)) { return; } var a = new CoordCube(); for (short i = 0; i < N_UBtoDF; i++) { for (var j = 0; j < N_MOVE; j++) { a.UBtoDF = i; a.Multiply(this.moves[j]); this.UBtoDF_Move[i, j] = a.UBtoDF; } } SaveMoveTable(Path.Combine(this.TablePath, "ub_to_df_move.file"), this.UBtoDF_Move); }
private void InitFlipMoveTable() { if (LoadMoveTableSuccessful( Path.Combine(this.TablePath, "flip_move.file"), N_MOVE, N_FLIP, out this.flipMove)) { return; } var a = new CoordCube(); for (short i = 0; i < N_FLIP; i++) { for (var j = 0; j < N_MOVE; j++) { a.Flip = i; a.Multiply(this.moves[j]); this.flipMove[i, j] = a.Flip; } } SaveMoveTable(Path.Combine(this.TablePath, "flip_move.file"), this.twistMove); }