public void SantaStartsAtPositionZero() { var santa = new Santa(); var result = santa.Position; Assert.That(result, Is.EqualTo("0, 0")); }
private static int PartTwo(string input) { var list = new HashSet <string>(); var santa = new Santa(); var roboSanta = new Santa(); list.Add(santa.Position); list.Add(roboSanta.Position); for (var i = 0; i < input.Length; i++) { if (i % 2 == 0) { santa.Move(input[i]); list.Add(santa.Position); } if (i % 2 != 0) { roboSanta.Move(input[i]); list.Add(roboSanta.Position); } } return(list.Count); }
public string SantaMovesByOneSpace(char input) { var santa = new Santa(); santa.Move(input); return(santa.Position); }
private static int PartOne(string input) { var list = new HashSet <string>(); var santa = new Santa(); list.Add(santa.Position); foreach (var instruction in input) { santa.Move(instruction); list.Add(santa.Position); } return(list.Count); }