From 083013994d1fd9b26062f6419f6246f1d6a75007 Mon Sep 17 00:00:00 2001 From: anazaz Date: Fri, 4 Sep 2026 11:21:58 +0000 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D1=84=D0=B0=D0=B9=D0=BB=D1=8B=20=D0=B2=20=C2=AB?= =?UTF-8?q?works/lab-02=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- works/lab-02/.gitignore | 32 ++++++++++++++++++++++++++++++++ works/lab-02/Main.kt | 35 +++++++++++++++++++++++++++++++++++ works/lab-02/encodings.xml | 4 ++++ works/lab-02/kotlinc.xml | 10 ++++++++++ works/lab-02/untitled.iml | 15 +++++++++++++++ 5 files changed, 96 insertions(+) create mode 100644 works/lab-02/.gitignore create mode 100644 works/lab-02/Main.kt create mode 100644 works/lab-02/encodings.xml create mode 100644 works/lab-02/kotlinc.xml create mode 100644 works/lab-02/untitled.iml diff --git a/works/lab-02/.gitignore b/works/lab-02/.gitignore new file mode 100644 index 0000000..3ddbf4c --- /dev/null +++ b/works/lab-02/.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-02/Main.kt b/works/lab-02/Main.kt new file mode 100644 index 0000000..823f671 --- /dev/null +++ b/works/lab-02/Main.kt @@ -0,0 +1,35 @@ +//TIP To Run code, press or +// click the icon in the gutter. +fun main() + { + var currentTurnInput: String = readln() + var currentTurn: Int = currentTurnInput.toInt() + var energyInput: String = readln() + var energy: Int = energyInput.toInt() + var multiplierInput: Double = 1.5 + var multiplier: Int = multiplierInput.toInt() + println("=== Инициализация параметров хода ===") + println("Текущий ход: $currentTurn (тип Int)") + println("Доступно энергии: $energy (тип Int)") + println("Множитель урона: $multiplier (тип Double)") + println("=== ХОД № $currentTurn ===") + var cardsPlayed = 0 + println("Игрок выводит Покемона на активную позицию!") + print("Введите базовый урон покемона: ") + val baseDamage = readln().toInt() + println("Применена карта Тренера 'Леди из Центра Покемонов'!") + cardsPlayed += 1 + println() + print("Сколько карт энергии прикрепить к Покемону? ") + val energyAttached = readln().toInt() + cardsPlayed += energyAttached + val finalDamage = baseDamage * multiplier + val turnCheck = currentTurn % 2 + val parityText = if (turnCheck == 0) "Четный" else "Нечетный" + println() + println("ОТЧЕТ О БОЕВОЙ ЭФФЕКТИВНОСТИ") + println("Тип хода (остаток % 2): $turnCheck ($parityText)") + println("Всего сыграно карт за ход: $cardsPlayed") + println("Базовый урон: $baseDamage | Коэффициент: $multiplier") + println("Итоговый урон по противнику: $finalDamage") + } \ No newline at end of file diff --git a/works/lab-02/encodings.xml b/works/lab-02/encodings.xml new file mode 100644 index 0000000..df87cf9 --- /dev/null +++ b/works/lab-02/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/works/lab-02/kotlinc.xml b/works/lab-02/kotlinc.xml new file mode 100644 index 0000000..5d1968d --- /dev/null +++ b/works/lab-02/kotlinc.xml @@ -0,0 +1,10 @@ + + + + + + + \ No newline at end of file diff --git a/works/lab-02/untitled.iml b/works/lab-02/untitled.iml new file mode 100644 index 0000000..9606c28 --- /dev/null +++ b/works/lab-02/untitled.iml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file