Last active
August 8, 2019 19:17
-
-
Save fboeller/cc6fd96f70a421a1d6792141991ac28a to your computer and use it in GitHub Desktop.
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
fun area(shape: Shape): Double = when (shape) { | |
is Rectangle -> shape.x * shape.y | |
is Circle -> PI * shape.radius * shape.radius | |
is Parallelogram -> shape.side * shape.height | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment