Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions Lambda/Lambda.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="openjdk-23" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
5 changes: 5 additions & 0 deletions Lambda/calculateDepth.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
val calculateDepth: (Int, Int) -> Int = { location1, location2 -> location1 - location2 }
fun main (){
val result = calculateDepth(1500, 800)
println(result)
}
5 changes: 5 additions & 0 deletions Lambda/divideTreasure.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
val divideTreasure: (Double, Double) -> Double= {treasure, explorers -> treasure / explorers}
fun main(){
val result = divideTreasure(1000.0, 5.0)
println("$result")
}
7 changes: 7 additions & 0 deletions Lambda/extensionFunction.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
fun String.loud(): String {
return this.uppercase() + "!"
}
val diveMessage: (String) -> String = {text -> text.loud()}
fun main(){
println(diveMessage("deep sea"))
}
5 changes: 5 additions & 0 deletions Lambda/findPearl.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
val findPearl: (Int) -> Int = {pearls -> pearls * pearls}
fun main () {
val result = findPearl(6)
println(result)
}
6 changes: 6 additions & 0 deletions Lambda/greatSeaCreatures.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
val greetSeaCreatures: () -> Unit = {
println("Hello, Deep Sea Adventurer!\n")
}
fun main (){
greetSeaCreatures()
}
5 changes: 5 additions & 0 deletions Lambda/src/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
public class Main {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}