Ejemplo n.º 1
0
        private static int Second(List <string> input)
        {
            var grid = new Cubes4D(input);

            grid.FlipNumberOfTimes(6);

            return(grid.Actives.Count);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Gets the number of active cubes for the specified initial states.
 /// </summary>
 /// <param name="initialStates">The initial cube states.</param>
 /// <param name="cycles">The number of cycles to perform.</param>
 /// <param name="dimensions">The number of dimensions.</param>
 /// <param name="logger">The optional logger to use.</param>
 /// <returns>
 /// The number of active cubes after the specified number of cycles and a visualization of the final states.
 /// </returns>
 public static (int ActiveCubes, string Visualization) GetActiveCubes(
     IList <string> initialStates,
     int cycles,
     int dimensions,
     ILogger?logger = null)
 {
     return(dimensions switch
     {
         3 => Cubes3D.GetActiveCubes(initialStates, cycles, logger),
         4 => Cubes4D.GetActiveCubes(initialStates, cycles, logger),
         _ => throw new NotSupportedException(),
     });