This commit is contained in:
Puzanova
2026-09-29 10:00:42 +03:00
parent a9a23b6b58
commit 081988bbc3
6 changed files with 29 additions and 5 deletions
+29 -5
View File
@@ -1,21 +1,45 @@
//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or //TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter. // click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
fun main() { fun main() {
val hand = mapOf( //1часть
val deck: MutableList<String> = mutableListOf()
repeat(3) {
val card = readln()
deck.add(card)
}
val discardedCard = readln()
val wasDiscarded = deck.remove(discardedCard)
println(wasDiscarded)
//2часть
val hand = mapOf(
"Pikachu" to "Pokemon", "Pikachu" to "Pokemon",
"Potion" to "Trainer", "Potion" to "Trainer",
"Fire Energy" to "Energy", "Fire Energy" to "Energy",
"Professor's Research" to "Trainer") "Professor's Research" to "Trainer")
val resources = mutableMapOf("Trainer" to 2, "Energy" to 1) println("=== ФОРМИРОВАНИЕ КОЛОДЫ ===")
var cardnumber = 0
cardnumber++
println("Введите карту №{$cardnumber}:" (deck[0]))
//3 часть
val energyToAttach = readln().toInt()
val resources = mutableMapOf("Trainer" to 2, "Energy" to 1)
resources["Energy"] = resources.getValue("Energy") + energyToAttach resources["Energy"] = resources.getValue("Energy") + energyToAttach
for ((type, count) in resources) for ((type, count) in resources)
{ {
println("Тип: N шт. ") println("Тип: N шт. ")
} }
print("=== ФОРМИРОВАНИЕ КОЛОДЫ ===")
val cardnumber = readln()
print("Введите карту №$cardnumber++:")
println("=== АНАЛИЗ РУКИ ===")
println("=== УЧЕТ РЕСУРСОВ ===")
println("========================================")
println("ИТОГ: Колода: $trainerCards карт | Рука: 4 карт | Энергия на столе: $energyToAttach")
println("========================================")
} }
Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB