public void Turn_Left5_W() { Compass compass = new Compass('N'); compass.Turn('L'); compass.Turn('L'); compass.Turn('L'); compass.Turn('L'); compass.Turn('L'); Assert.AreEqual(compass.GetDirection(), 'W'); }
public void TurnRight_FromSouth() { ICompass c = new Compass(Orientation.South); c.Turn(TurnDirection.Right); Assert.AreEqual(Orientation.West, c.Direction); }
public void TurnLeft_FromSouth() { ICompass c = new Compass(Orientation.South); c.Turn(TurnDirection.Left); Assert.AreEqual(Orientation.East, c.Direction); }
public void TurnRight_FromWest() { ICompass c = new Compass(Orientation.West); c.Turn(TurnDirection.Right); Assert.AreEqual(Orientation.North, c.Direction); }
public void TurnLeft_FromEast() { ICompass c = new Compass(Orientation.East); c.Turn(TurnDirection.Left); Assert.AreEqual(Orientation.North, c.Direction); }
public void Turn_Right_N() { Compass compass = new Compass('W'); compass.Turn('R'); Assert.AreEqual(compass.GetDirection(), 'N'); }
public void TurnRight_InitWithNorth_E() { Compass compass = new Compass('N'); compass.Turn('R'); Assert.AreEqual(compass.GetDirection(), 'E'); }
public Day1Solution() { var input = Week1_ParseInput(); Console.WriteLine("Starting at square 1... : " + Compass.CurrentPlacement.Item1[0] + "N, " + Compass.CurrentPlacement.Item1[1] + "E, " + "currently facing " + Compass.CurrentPlacement.Item2); foreach (var val in input) { Console.WriteLine("Input from file: " + val); AdventCompass.Turn(val); Console.WriteLine(Compass.CurrentPlacement.Item1[0] + "N, " + Compass.CurrentPlacement.Item1[1] + "E, " + "currently facing " + Compass.CurrentPlacement.Item2); } Console.WriteLine("Distance to Easter Bunny HQ: " + (Compass.CurrentPlacement.Item1[0] + Compass.CurrentPlacement.Item1[1]) + " blocks"); #if DEBUG Console.WriteLine("Debugger waiting..."); Console.ReadLine(); #endif }