Beispiel #1
0
            public static SandPile OfDimension(int _width, int _height)
            {
                var zerosOfDim = Known.
                                 Where(s => s.Width == _width && s.Height == _height).
                                 ToList();

                if (zerosOfDim.Count() == 1)
                {
                    return(zerosOfDim[0]);
                }
                if (zerosOfDim.Count() == 0)
                {
                    return(null);
                }
                throw new Exception($"More than one zero match dimensions {_width}, {_height}");
            }