Created
June 19, 2018 11:40
-
-
Save christiannagel/ed77b29899aee2b392a5ad25151755f1 to your computer and use it in GitHub Desktop.
Sample Main method for pattern matching
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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