Exemple #1
0
        public static byte[,] AsCopyWithUpdate(this byte[,] squares, int x, int y, byte val)
        {
            var tmp = squares.AsCopy();

            tmp[x, y] = val;
            return(tmp);
        }
Exemple #2
0
        public static byte[,] Untransform(this byte[,] squares, Direction direction)
        {
            switch (direction)
            {
            case Direction.Down: return(squares.Invert().Transpose());

            case Direction.Up: return(squares.Flip().Transpose());

            case Direction.Left: return(squares.AsCopy());

            case Direction.Right: return(squares.Invert());
            }
            throw new Exception("Oops");
        }