示例#1
0
 public void AoC_PullLength(int pos, int len)
 {
     if (PuzzlePart.Count > 0)
     {
         PuzzlePart.Clear();
     }
     //int Init = 0;
     //Console.WriteLine();
     //Console.Write($" Sample of Array Length (Len:{len}): ");
     for (Init = 0; Init < len; Init++, pos++)
     {
         if (pos == PuzzleArray.Count)
         {
             pos = 0;
         }
         var newValue = new AoCPuzzleArray(PuzzleArray[pos].Value);
         PuzzlePart.Add(newValue);
         //Console.Write($" [#{Init} / pos:{pos} / VALUE:{PuzzlePart[Init].Value}] ");
     }
     //Console.WriteLine();
 }
示例#2
0
        public void PopulateArray()
        {
            // Set overall puzzle length
            for (Init = 0; Init < 256; Init++)
            //for (Init = 0; Init < 5; Init++)
            {
                var newValue = new AoCPuzzleArray(Init);
                PuzzleArray.Add(newValue);
                //Console.Write($" [{Init} / {PuzzleArray[Init].Value}] ");
            }
            Init = 0;
            // Set puzzle input
            foreach (int rep in new [] { 165, 1, 255, 31, 87, 52, 24, 113, 0, 91, 148, 254, 158, 2, 73, 153 })

            //foreach (int rep in new int[4] {3, 4, 1, 5})
            {
                var newValue = new AoCPuzzleArray(rep);
                PuzzleInput.Add(newValue);
                //Console.Write($" [{rep} / {PuzzleInput[Init].Value}] ");
                Init++;
            }
        }