public static byte[,] AsCopyWithUpdate(this byte[,] squares, int x, int y, byte val) { var tmp = squares.AsCopy(); tmp[x, y] = val; return(tmp); }
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"); }