Esempio n. 1
0
        public void SantaStartsAtPositionZero()
        {
            var santa  = new Santa();
            var result = santa.Position;

            Assert.That(result, Is.EqualTo("0, 0"));
        }
Esempio n. 2
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);
        }
Esempio n. 3
0
        public string SantaMovesByOneSpace(char input)
        {
            var santa = new Santa();

            santa.Move(input);
            return(santa.Position);
        }
Esempio n. 4
0
        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);
        }