diff --git a/.idea/misc.xml b/.idea/misc.xml index 03f397c..31e1ebc 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/src/Main.kt b/src/Main.kt index a7a5e00..47a86f3 100644 --- a/src/Main.kt +++ b/src/Main.kt @@ -1,3 +1,24 @@ fun main() { - println("Hello World!") -} \ No newline at end of file + + greetSeaCreatures() + println(findPearl(6)) + println(divideTreasure(1000.0, 5.0)) + println(calculateDepth(1500, 800)) + println(diveMessage("deep sea")) + +} + +val greetSeaCreatures = {println("Hello, Deep Sea Adventurer!")} + +val findPearl = {number: Int -> number * number } + +val divideTreasure = {totalTreasure: Double, numberExplorers: Double -> totalTreasure/numberExplorers} + +val calculateDepth: (Int, Int) -> Int = {x, y -> x-y} + +fun String.loud(): String{ + return this.uppercase() + "!" +} +val diveMessage: (String) -> String = { message -> message.loud() } + +