Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sample Main method for pattern matching
static void Main()
{
var r1 = new Rectangle(position: (200, 200), size: (200, 200));
var e1 = new Ellipse(position: (80, 1400), size: (80, 140));
var shapes = new Shape[]
{
r1,
e1,
new Circle((40, 60), 90),
new CombinedShape(r1, e1)
};
foreach (var shape in shapes)
{
Console.WriteLine(M1(shape));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.