Skip to content

Instantly share code, notes, and snippets.

@jasongorman
Created August 18, 2019 08:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasongorman/b854d3e9ef13d5fe19b3b12739100ab3 to your computer and use it in GitHub Desktop.
Save jasongorman/b854d3e9ef13d5fe19b3b12739100ab3 to your computer and use it in GitHub Desktop.
fun quote(width: Double, length: Double, pricePerSqrMtr: Double, roundUp: Boolean): Double {
return carpetPrice(pricePerSqrMtr, roundUp, roomArea(width, length)())
}
fun roomArea(width: Double, length: Double): ()->Double {
fun area(): Double {
return width * length
}
return ::area
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment