From b3d30e682209b0733524e7b3cd85666dc81457a0 Mon Sep 17 00:00:00 2001 From: 328p <328p@BTK.MAIN> Date: Wed, 23 Sep 2026 15:54:37 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B0=D1=87=D0=B0=D0=BB=20lesson5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- works/lab-05/lesson5/.gitignore | 32 ++++++++++++++++++++++++++++++++ works/lab-05/lesson5/src/Main.kt | 17 +++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 works/lab-05/lesson5/.gitignore create mode 100644 works/lab-05/lesson5/src/Main.kt diff --git a/works/lab-05/lesson5/.gitignore b/works/lab-05/lesson5/.gitignore new file mode 100644 index 0000000..3ddbf4c --- /dev/null +++ b/works/lab-05/lesson5/.gitignore @@ -0,0 +1,32 @@ +### IntelliJ IDEA ### +out/ +!**/src/main/**/out/ +!**/src/test/**/out/ + +### Kotlin ### +.kotlin + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache +bin/ +!**/src/main/**/bin/ +!**/src/test/**/bin/ + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store \ No newline at end of file diff --git a/works/lab-05/lesson5/src/Main.kt b/works/lab-05/lesson5/src/Main.kt new file mode 100644 index 0000000..557dd6a --- /dev/null +++ b/works/lab-05/lesson5/src/Main.kt @@ -0,0 +1,17 @@ +//TIP To Run code, press or +// click the icon in the gutter. +fun main() { + val hand = mapOf( + "Pikachu" to "Pokemon", + "Potion" to "Trainer", + "Fire Energy" to "Energy", + "Professor's Research" to "Trainer" + ) + + val trainerCards = hand.filter { it.value == "Trainer" } + val upperNames = hand.map { it.value } + println(upperNames.joinToString(separator = ", ")) + + val energyToAttach = readln() + +} \ No newline at end of file