public Colors this[CubieFace face] { get { return(this.GetF(face)); } }
public static void Check(this CubieFace face) { face.Cubie.CheckNonZero(); face.Face.CheckUnit(); face.Cubie.CheckParallel(face.Face); }
public static Arrow ReOrient(this CubieFace face, Arrow direction) { face.Check(direction); if (face.Cubie.Dot(direction) > 0) { return(face.Face.Negate()); } return(direction); }
public static CubieFace Neighbour(this CubieFace face, Arrow direction) { face.Check(direction); if (face.Cubie.Dot(direction) > 0) { return(new CubieFace(face.Cubie, direction)); } var cubie = face.Cubie.Add(direction); return(new CubieFace(cubie, face.Face)); }
public static CubieFace Follow(this CubieFace face, Arrow direction, params uint[] turns) { foreach (var turn in turns) { var neighbour = face.Neighbour(direction); var next = face.ReOrient(direction); var turned = neighbour.ReOrient(next, turn); face = neighbour; direction = turned; } return(face); }
public static CubieFace FollowDirections(CubieFace result, Arrow direction) { foreach (var _ in Enumerable.Repeat <object>(null, 12)) { var next = result.Neighbour(direction); Console.WriteLine(string.Format("{0} : {1} -> {2} = {3} : {4}", result.Cubie, result.Face, direction, next.Cubie, next.Face)); direction = result.ReOrient(direction); result = next; } Console.ReadLine(); return(result); }
public static void Check(this CubieFace face, Arrow direction) { direction.CheckUnit(); face.Face.CheckPerpendicular(direction); }
public static CubieFace Loop(this CubieFace face, Arrow direction) { return(face.Follow(direction, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)); }
public static Arrow ReOrient(this CubieFace face, Arrow direction, uint turn) { return(face.Face.Rotate().Power(turn).Morph(direction)); }
public static void Main(string[] args) { //foreach (var matrix in Matrices()) //{ // Console.WriteLine(string.Format("{0}", matrix.Determinant())); //} //Console.ReadLine(); foreach (var cubie in Arrows()) { foreach (var face in Basis().Where(_ => cubie.Dot(_) == 1)) { foreach (var direction in Basis().Where(_ => face.Dot(_) == 0)) { CubieFace result = new CubieFace(cubie, face); Console.WriteLine(string.Format("{0} -> {1} = {2}", result, direction, result.Loop(direction))); } } } Console.ReadLine(); foreach (var first in Arrows()) { foreach (var second in Basis()) { var cross = second.Rotate().Morph(first); Console.WriteLine(string.Format("{0} x {1} = {2}", first, second, cross)); if (first.Magnitude() * second.Magnitude() == cross.Magnitude()) { Console.WriteLine(string.Format("{0} * {1} = {2} Ok", first.Magnitude(), second.Magnitude(), cross.Magnitude())); } else { Console.WriteLine(string.Format("{0} * {1} = {2}", first.Magnitude(), second.Magnitude(), cross.Magnitude())); } } } Console.ReadLine(); foreach (var face in Basis()) { foreach (var cubie in Arrows()) { var rotated = face.Rotate().Power(4).Morph(cubie); Console.WriteLine(string.Format("{0} ~> {1} = {2}", cubie, face, rotated)); } } Console.ReadLine(); uint count = 0; foreach (var cubie in Arrows()) { foreach (var face in Basis().Where(_ => cubie.Dot(_) == 1)) { Console.WriteLine(string.Format("{0} : {1}", cubie, face)); count++; } } Console.WriteLine("Faces: " + count); Console.ReadLine(); foreach (var cubie in Arrows()) { foreach (var face in Basis().Where(_ => cubie.Dot(_) == 1)) { foreach (var direction in Basis().Where(_ => face.Dot(_) == 0)) { CubieFace result = new CubieFace(cubie, face); FollowDirections(result, direction); } } } Console.ReadLine(); foreach (var arrow in Arrows()) { Console.Write(arrow); foreach (var direction in Basis().Where(_ => arrow.Dot(_) == 0)) { Console.WriteLine(" -> " + arrow); } Console.WriteLine(arrow); } Console.ReadLine(); }