├── Ch21
├── .gradle
│ ├── 4.10.1
│ │ ├── gc.properties
│ │ ├── fileChanges
│ │ │ └── last-build.bin
│ │ └── fileHashes
│ │ │ ├── fileHashes.bin
│ │ │ └── fileHashes.lock
│ └── vcs-1
│ │ └── gc.properties
└── Samodelkin
│ ├── app
│ ├── .gitignore
│ ├── src
│ │ ├── main
│ │ │ ├── res
│ │ │ │ ├── values
│ │ │ │ │ ├── strings.xml
│ │ │ │ │ ├── colors.xml
│ │ │ │ │ └── styles.xml
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ └── mipmap-anydpi-v26
│ │ │ │ │ ├── ic_launcher.xml
│ │ │ │ │ └── ic_launcher_round.xml
│ │ │ ├── AndroidManifest.xml
│ │ │ └── java
│ │ │ │ └── android
│ │ │ │ └── bignerdranch
│ │ │ │ └── com
│ │ │ │ ├── CharacterGenerator.kt
│ │ │ │ └── NewCharacterActivity.kt
│ │ ├── test
│ │ │ └── java
│ │ │ │ └── android
│ │ │ │ └── bignerdranch
│ │ │ │ └── com
│ │ │ │ └── ExampleUnitTest.kt
│ │ └── androidTest
│ │ │ └── java
│ │ │ └── android
│ │ │ └── bignerdranch
│ │ │ └── com
│ │ │ └── ExampleInstrumentedTest.kt
│ ├── proguard-rules.pro
│ └── build.gradle
│ ├── settings.gradle
│ ├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
│ ├── .idea
│ ├── codeStyles
│ │ └── codeStyleConfig.xml
│ ├── misc.xml
│ ├── runConfigurations.xml
│ └── gradle.xml
│ ├── .gitignore
│ ├── build.gradle
│ └── gradle.properties
├── Ch22
├── .gradle
│ ├── 4.10.1
│ │ ├── gc.properties
│ │ ├── fileChanges
│ │ │ └── last-build.bin
│ │ └── fileHashes
│ │ │ ├── fileHashes.bin
│ │ │ └── fileHashes.lock
│ └── vcs-1
│ │ └── gc.properties
└── Samodelkin
│ ├── app
│ ├── .gitignore
│ ├── src
│ │ ├── main
│ │ │ ├── res
│ │ │ │ ├── values
│ │ │ │ │ ├── strings.xml
│ │ │ │ │ ├── colors.xml
│ │ │ │ │ └── styles.xml
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ └── mipmap-anydpi-v26
│ │ │ │ │ ├── ic_launcher.xml
│ │ │ │ │ └── ic_launcher_round.xml
│ │ │ ├── AndroidManifest.xml
│ │ │ └── java
│ │ │ │ └── android
│ │ │ │ └── bignerdranch
│ │ │ │ └── com
│ │ │ │ └── CharacterGenerator.kt
│ │ ├── test
│ │ │ └── java
│ │ │ │ └── android
│ │ │ │ └── bignerdranch
│ │ │ │ └── com
│ │ │ │ └── ExampleUnitTest.kt
│ │ └── androidTest
│ │ │ └── java
│ │ │ └── android
│ │ │ └── bignerdranch
│ │ │ └── com
│ │ │ └── ExampleInstrumentedTest.kt
│ ├── proguard-rules.pro
│ └── build.gradle
│ ├── settings.gradle
│ ├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
│ ├── .idea
│ ├── codeStyles
│ │ └── codeStyleConfig.xml
│ ├── misc.xml
│ ├── runConfigurations.xml
│ └── gradle.xml
│ ├── .gitignore
│ ├── build.gradle
│ └── gradle.properties
├── Ch01
└── Sandbox
│ ├── src
│ └── Hello.kt
│ ├── out
│ └── production
│ │ └── Sandbox
│ │ ├── META-INF
│ │ └── Sandbox.kotlin_module
│ │ └── HelloKt.class
│ ├── .idea
│ ├── encodings.xml
│ ├── codeStyles
│ │ ├── codeStyleConfig.xml
│ │ └── Project.xml
│ ├── modules.xml
│ ├── misc.xml
│ ├── kotlinc.xml
│ └── libraries
│ │ └── KotlinJavaRuntime.xml
│ └── Sandbox.iml
├── Ch02
└── Sandbox
│ ├── src
│ ├── Hello.kt
│ └── TypeIntro.kt
│ ├── out
│ └── production
│ │ └── Sandbox
│ │ ├── META-INF
│ │ └── Sandbox.kotlin_module
│ │ ├── HelloKt.class
│ │ └── TypeIntroKt.class
│ ├── .idea
│ ├── encodings.xml
│ ├── codeStyles
│ │ ├── codeStyleConfig.xml
│ │ └── Project.xml
│ ├── modules.xml
│ ├── misc.xml
│ ├── kotlinc.xml
│ └── libraries
│ │ └── KotlinJavaRuntime.xml
│ └── Sandbox.iml
├── Ch05
└── Sandbox
│ ├── src
│ ├── Hello.kt
│ ├── TypeIntro.kt
│ └── SimVillage.kt
│ ├── out
│ └── production
│ │ └── Sandbox
│ │ ├── META-INF
│ │ └── Sandbox.kotlin_module
│ │ ├── HelloKt.class
│ │ ├── TypeIntroKt.class
│ │ ├── SimVillageKt.class
│ │ └── SimVillageKt$configureGreetingFunction$1.class
│ ├── .idea
│ ├── encodings.xml
│ ├── codeStyles
│ │ ├── codeStyleConfig.xml
│ │ └── Project.xml
│ ├── modules.xml
│ ├── misc.xml
│ ├── kotlinc.xml
│ └── libraries
│ │ └── KotlinJavaRuntime.xml
│ └── Sandbox.iml
├── Ch17
└── Sandbox
│ ├── src
│ ├── Hello.kt
│ ├── TypeIntro.kt
│ ├── Variance.kt
│ ├── SimVillage.kt
│ └── Generics.kt
│ ├── out
│ └── production
│ │ └── Sandbox
│ │ ├── Coin.class
│ │ ├── Loot.class
│ │ ├── Fedora.class
│ │ ├── META-INF
│ │ └── Sandbox.kotlin_module
│ │ ├── HelloKt.class
│ │ ├── LootBox.class
│ │ ├── GenericsKt.class
│ │ ├── TypeIntroKt.class
│ │ ├── SimVillageKt.class
│ │ ├── GenericsKt$main$coin$1.class
│ │ └── SimVillageKt$configureGreetingFunction$1.class
│ ├── .idea
│ ├── encodings.xml
│ ├── codeStyles
│ │ ├── codeStyleConfig.xml
│ │ └── Project.xml
│ ├── modules.xml
│ ├── misc.xml
│ ├── kotlinc.xml
│ └── libraries
│ │ └── KotlinJavaRuntime.xml
│ └── Sandbox.iml
├── Ch18
├── Sandbox
│ ├── src
│ │ ├── Hello.kt
│ │ ├── TypeIntro.kt
│ │ ├── Variance.kt
│ │ ├── Extensions.kt
│ │ ├── SimVillage.kt
│ │ └── Generics.kt
│ ├── out
│ │ └── production
│ │ │ └── Sandbox
│ │ │ ├── Coin.class
│ │ │ ├── Loot.class
│ │ │ ├── Barrel.class
│ │ │ ├── Fedora.class
│ │ │ ├── HelloKt.class
│ │ │ ├── LootBox.class
│ │ │ ├── GenericsKt.class
│ │ │ ├── TypeIntroKt.class
│ │ │ ├── VarianceKt.class
│ │ │ ├── ExtensionsKt.class
│ │ │ ├── SimVillageKt.class
│ │ │ ├── META-INF
│ │ │ └── Sandbox.kotlin_module
│ │ │ ├── GenericsKt$main$coin$1.class
│ │ │ └── SimVillageKt$configureGreetingFunction$1.class
│ ├── .idea
│ │ ├── encodings.xml
│ │ ├── codeStyles
│ │ │ ├── codeStyleConfig.xml
│ │ │ └── Project.xml
│ │ ├── modules.xml
│ │ ├── misc.xml
│ │ ├── kotlinc.xml
│ │ └── libraries
│ │ │ └── KotlinJavaRuntime.xml
│ └── Sandbox.iml
└── NyetHack
│ ├── data
│ ├── towns.txt
│ └── tavern-menu-items.txt
│ ├── out
│ └── production
│ │ └── NyetHack
│ │ ├── META-INF
│ │ └── NyetHack.kotlin_module
│ │ └── com
│ │ └── bignerdranch
│ │ └── nyethack
│ │ ├── Game.class
│ │ ├── GameKt.class
│ │ ├── Goblin.class
│ │ ├── Player.class
│ │ ├── Room.class
│ │ ├── Monster.class
│ │ ├── TavernKt.class
│ │ ├── Coordinate.class
│ │ ├── Direction.class
│ │ ├── Fightable.class
│ │ ├── TownSquare.class
│ │ ├── Game$GameInput.class
│ │ ├── SwordJugglerKt.class
│ │ ├── Player$hometown$2.class
│ │ ├── Fightable$DefaultImpls.class
│ │ ├── TavernKt$toDragonSpeak$1.class
│ │ ├── UnskilledSwordJugglerException.class
│ │ └── TavernKt$displayPatronBalances$1.class
│ ├── .idea
│ ├── encodings.xml
│ ├── codeStyles
│ │ ├── codeStyleConfig.xml
│ │ └── Project.xml
│ ├── modules.xml
│ ├── misc.xml
│ ├── kotlinc.xml
│ └── libraries
│ │ └── KotlinJavaRuntime.xml
│ ├── src
│ └── com
│ │ └── bignerdranch
│ │ └── nyethack
│ │ ├── extensions
│ │ └── IterableExt.kt
│ │ ├── Navigation.kt
│ │ ├── Room.kt
│ │ ├── SwordJuggler.kt
│ │ └── Creature.kt
│ └── NyetHack.iml
├── .gitattributes
├── Ch20
└── Interop
│ ├── out
│ └── production
│ │ └── Interop
│ │ ├── META-INF
│ │ └── Interop.kotlin_module
│ │ ├── Hero.class
│ │ ├── Jhava.class
│ │ ├── Spellbook.class
│ │ ├── Hero$translator$1.class
│ │ └── Spellbook$Companion.class
│ ├── .idea
│ ├── encodings.xml
│ ├── codeStyles
│ │ ├── codeStyleConfig.xml
│ │ └── Project.xml
│ ├── modules.xml
│ ├── misc.xml
│ ├── kotlinc.xml
│ └── libraries
│ │ ├── org_jetbrains_annotations_16_0_2.xml
│ │ └── KotlinJavaRuntime.xml
│ ├── Interop.iml
│ └── src
│ ├── Hero.kt
│ └── Jhava.java
├── Ch03
└── NyetHack
│ ├── out
│ └── production
│ │ └── NyetHack
│ │ ├── META-INF
│ │ └── NyetHack.kotlin_module
│ │ └── GameKt.class
│ ├── .idea
│ ├── encodings.xml
│ ├── codeStyles
│ │ ├── codeStyleConfig.xml
│ │ └── Project.xml
│ ├── modules.xml
│ ├── misc.xml
│ ├── kotlinc.xml
│ └── libraries
│ │ └── KotlinJavaRuntime.xml
│ ├── NyetHack.iml
│ └── src
│ └── Game.kt
├── Ch04
└── NyetHack
│ ├── out
│ └── production
│ │ └── NyetHack
│ │ ├── META-INF
│ │ └── NyetHack.kotlin_module
│ │ └── GameKt.class
│ ├── .idea
│ ├── encodings.xml
│ ├── codeStyles
│ │ ├── codeStyleConfig.xml
│ │ └── Project.xml
│ ├── modules.xml
│ ├── misc.xml
│ ├── kotlinc.xml
│ └── libraries
│ │ └── KotlinJavaRuntime.xml
│ └── NyetHack.iml
├── Ch06
└── NyetHack
│ ├── out
│ └── production
│ │ └── NyetHack
│ │ ├── META-INF
│ │ └── NyetHack.kotlin_module
│ │ ├── GameKt.class
│ │ ├── TavernKt.class
│ │ ├── SwordJugglerKt.class
│ │ └── UnskilledSwordJugglerException.class
│ ├── .idea
│ ├── encodings.xml
│ ├── codeStyles
│ │ ├── codeStyleConfig.xml
│ │ └── Project.xml
│ ├── modules.xml
│ ├── misc.xml
│ ├── kotlinc.xml
│ └── libraries
│ │ └── KotlinJavaRuntime.xml
│ ├── src
│ ├── Tavern.kt
│ └── SwordJuggler.kt
│ └── NyetHack.iml
├── Ch07
└── NyetHack
│ ├── out
│ └── production
│ │ └── NyetHack
│ │ ├── META-INF
│ │ └── NyetHack.kotlin_module
│ │ ├── GameKt.class
│ │ ├── TavernKt.class
│ │ ├── SwordJugglerKt.class
│ │ ├── TavernKt$toDragonSpeak$1.class
│ │ └── UnskilledSwordJugglerException.class
│ ├── .idea
│ ├── encodings.xml
│ ├── codeStyles
│ │ ├── codeStyleConfig.xml
│ │ └── Project.xml
│ ├── modules.xml
│ ├── misc.xml
│ ├── kotlinc.xml
│ └── libraries
│ │ └── KotlinJavaRuntime.xml
│ ├── NyetHack.iml
│ └── src
│ ├── SwordJuggler.kt
│ └── Tavern.kt
├── Ch08
└── NyetHack
│ ├── out
│ └── production
│ │ └── NyetHack
│ │ ├── META-INF
│ │ └── NyetHack.kotlin_module
│ │ ├── GameKt.class
│ │ ├── TavernKt.class
│ │ ├── SwordJugglerKt.class
│ │ ├── TavernKt$toDragonSpeak$1.class
│ │ └── UnskilledSwordJugglerException.class
│ ├── .idea
│ ├── encodings.xml
│ ├── codeStyles
│ │ ├── codeStyleConfig.xml
│ │ └── Project.xml
│ ├── modules.xml
│ ├── misc.xml
│ ├── kotlinc.xml
│ └── libraries
│ │ └── KotlinJavaRuntime.xml
│ ├── NyetHack.iml
│ └── src
│ ├── SwordJuggler.kt
│ └── Tavern.kt
├── Ch10
└── NyetHack
│ ├── out
│ └── production
│ │ └── NyetHack
│ │ ├── META-INF
│ │ └── NyetHack.kotlin_module
│ │ ├── GameKt.class
│ │ ├── TavernKt.class
│ │ ├── SwordJugglerKt.class
│ │ ├── TavernKt$toDragonSpeak$1.class
│ │ └── UnskilledSwordJugglerException.class
│ ├── .idea
│ ├── encodings.xml
│ ├── codeStyles
│ │ ├── codeStyleConfig.xml
│ │ └── Project.xml
│ ├── modules.xml
│ ├── misc.xml
│ ├── kotlinc.xml
│ └── libraries
│ │ └── KotlinJavaRuntime.xml
│ ├── data
│ └── tavern-menu-items.txt
│ ├── NyetHack.iml
│ └── src
│ └── SwordJuggler.kt
├── Ch11
└── NyetHack
│ ├── out
│ └── production
│ │ └── NyetHack
│ │ ├── META-INF
│ │ └── NyetHack.kotlin_module
│ │ ├── GameKt.class
│ │ ├── TavernKt.class
│ │ ├── SwordJugglerKt.class
│ │ ├── TavernKt$toDragonSpeak$1.class
│ │ ├── TavernKt$displayPatronBalances$1.class
│ │ └── UnskilledSwordJugglerException.class
│ ├── .idea
│ ├── encodings.xml
│ ├── codeStyles
│ │ ├── codeStyleConfig.xml
│ │ └── Project.xml
│ ├── modules.xml
│ ├── misc.xml
│ ├── kotlinc.xml
│ └── libraries
│ │ └── KotlinJavaRuntime.xml
│ ├── data
│ └── tavern-menu-items.txt
│ ├── NyetHack.iml
│ └── src
│ └── SwordJuggler.kt
├── Ch12
└── NyetHack
│ ├── out
│ └── production
│ │ └── NyetHack
│ │ ├── META-INF
│ │ └── NyetHack.kotlin_module
│ │ ├── GameKt.class
│ │ ├── TavernKt.class
│ │ ├── SwordJugglerKt.class
│ │ ├── TavernKt$toDragonSpeak$1.class
│ │ ├── TavernKt$displayPatronBalances$1.class
│ │ └── UnskilledSwordJugglerException.class
│ ├── .idea
│ ├── encodings.xml
│ ├── codeStyles
│ │ ├── codeStyleConfig.xml
│ │ └── Project.xml
│ ├── modules.xml
│ ├── misc.xml
│ ├── kotlinc.xml
│ └── libraries
│ │ └── KotlinJavaRuntime.xml
│ ├── data
│ └── tavern-menu-items.txt
│ ├── NyetHack.iml
│ └── src
│ └── com
│ └── bignerdranch
│ └── nyethack
│ ├── SwordJuggler.kt
│ ├── Game.kt
│ └── Player.kt
├── Ch13
└── NyetHack
│ ├── data
│ ├── towns.txt
│ └── tavern-menu-items.txt
│ ├── out
│ └── production
│ │ └── NyetHack
│ │ ├── META-INF
│ │ └── NyetHack.kotlin_module
│ │ └── com
│ │ └── bignerdranch
│ │ └── nyethack
│ │ ├── GameKt.class
│ │ ├── Player.class
│ │ ├── TavernKt.class
│ │ ├── SwordJugglerKt.class
│ │ ├── TavernKt$toDragonSpeak$1.class
│ │ ├── UnskilledSwordJugglerException.class
│ │ └── TavernKt$displayPatronBalances$1.class
│ ├── .idea
│ ├── encodings.xml
│ ├── codeStyles
│ │ ├── codeStyleConfig.xml
│ │ └── Project.xml
│ ├── modules.xml
│ ├── misc.xml
│ ├── kotlinc.xml
│ └── libraries
│ │ └── KotlinJavaRuntime.xml
│ ├── NyetHack.iml
│ └── src
│ └── com
│ └── bignerdranch
│ └── nyethack
│ ├── SwordJuggler.kt
│ ├── Game.kt
│ └── Player.kt
├── Ch14
└── NyetHack
│ ├── data
│ ├── towns.txt
│ └── tavern-menu-items.txt
│ ├── out
│ └── production
│ │ └── NyetHack
│ │ ├── META-INF
│ │ └── NyetHack.kotlin_module
│ │ └── com
│ │ └── bignerdranch
│ │ └── nyethack
│ │ ├── GameKt.class
│ │ ├── Player.class
│ │ ├── Room.class
│ │ ├── TavernKt.class
│ │ ├── TownSquare.class
│ │ ├── SwordJugglerKt.class
│ │ ├── Player$hometown$2.class
│ │ ├── TavernKt$toDragonSpeak$1.class
│ │ ├── UnskilledSwordJugglerException.class
│ │ └── TavernKt$displayPatronBalances$1.class
│ ├── .idea
│ ├── encodings.xml
│ ├── codeStyles
│ │ ├── codeStyleConfig.xml
│ │ └── Project.xml
│ ├── modules.xml
│ ├── misc.xml
│ ├── kotlinc.xml
│ └── libraries
│ │ └── KotlinJavaRuntime.xml
│ ├── NyetHack.iml
│ └── src
│ └── com
│ └── bignerdranch
│ └── nyethack
│ ├── Room.kt
│ ├── SwordJuggler.kt
│ ├── Game.kt
│ └── Player.kt
├── Ch15
└── NyetHack
│ ├── data
│ ├── towns.txt
│ └── tavern-menu-items.txt
│ ├── out
│ └── production
│ │ └── NyetHack
│ │ ├── META-INF
│ │ └── NyetHack.kotlin_module
│ │ └── com
│ │ └── bignerdranch
│ │ └── nyethack
│ │ ├── Game.class
│ │ ├── GameKt.class
│ │ ├── Player.class
│ │ ├── Room.class
│ │ ├── TavernKt.class
│ │ ├── Coordinate.class
│ │ ├── Direction.class
│ │ ├── TownSquare.class
│ │ ├── Game$GameInput.class
│ │ ├── SwordJugglerKt.class
│ │ ├── Player$hometown$2.class
│ │ ├── TavernKt$toDragonSpeak$1.class
│ │ ├── UnskilledSwordJugglerException.class
│ │ └── TavernKt$displayPatronBalances$1.class
│ ├── .idea
│ ├── encodings.xml
│ ├── codeStyles
│ │ ├── codeStyleConfig.xml
│ │ └── Project.xml
│ ├── modules.xml
│ ├── misc.xml
│ ├── kotlinc.xml
│ └── libraries
│ │ └── KotlinJavaRuntime.xml
│ ├── NyetHack.iml
│ └── src
│ └── com
│ └── bignerdranch
│ └── nyethack
│ ├── Navigation.kt
│ ├── Room.kt
│ ├── SwordJuggler.kt
│ └── Player.kt
├── Ch16
└── NyetHack
│ ├── data
│ ├── towns.txt
│ └── tavern-menu-items.txt
│ ├── out
│ └── production
│ │ └── NyetHack
│ │ ├── META-INF
│ │ └── NyetHack.kotlin_module
│ │ └── com
│ │ └── bignerdranch
│ │ └── nyethack
│ │ ├── Game.class
│ │ ├── GameKt.class
│ │ ├── Goblin.class
│ │ ├── Player.class
│ │ ├── Room.class
│ │ ├── Monster.class
│ │ ├── TavernKt.class
│ │ ├── Coordinate.class
│ │ ├── Direction.class
│ │ ├── Fightable.class
│ │ ├── TownSquare.class
│ │ ├── Game$GameInput.class
│ │ ├── SwordJugglerKt.class
│ │ ├── Player$hometown$2.class
│ │ ├── Fightable$DefaultImpls.class
│ │ ├── TavernKt$toDragonSpeak$1.class
│ │ ├── UnskilledSwordJugglerException.class
│ │ └── TavernKt$displayPatronBalances$1.class
│ ├── .idea
│ ├── encodings.xml
│ ├── codeStyles
│ │ ├── codeStyleConfig.xml
│ │ └── Project.xml
│ ├── modules.xml
│ ├── misc.xml
│ ├── kotlinc.xml
│ └── libraries
│ │ └── KotlinJavaRuntime.xml
│ ├── NyetHack.iml
│ └── src
│ └── com
│ └── bignerdranch
│ └── nyethack
│ ├── Navigation.kt
│ ├── Room.kt
│ ├── SwordJuggler.kt
│ └── Creature.kt
└── README.md
/Ch21/.gradle/4.10.1/gc.properties:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Ch21/.gradle/vcs-1/gc.properties:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Ch22/.gradle/4.10.1/gc.properties:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Ch22/.gradle/vcs-1/gc.properties:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Ch21/Samodelkin/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/Ch22/Samodelkin/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/Ch21/.gradle/4.10.1/fileChanges/last-build.bin:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Ch22/.gradle/4.10.1/fileChanges/last-build.bin:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Ch21/Samodelkin/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/Ch22/Samodelkin/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/Ch01/Sandbox/src/Hello.kt:
--------------------------------------------------------------------------------
1 | fun main() {
2 | println("안녕하세요?")
3 | }
--------------------------------------------------------------------------------
/Ch02/Sandbox/src/Hello.kt:
--------------------------------------------------------------------------------
1 | fun main() {
2 | println("안녕하세요?")
3 | }
--------------------------------------------------------------------------------
/Ch05/Sandbox/src/Hello.kt:
--------------------------------------------------------------------------------
1 | fun main() {
2 | println("안녕하세요?")
3 | }
--------------------------------------------------------------------------------
/Ch17/Sandbox/src/Hello.kt:
--------------------------------------------------------------------------------
1 | fun main() {
2 | println("안녕하세요?")
3 | }
--------------------------------------------------------------------------------
/Ch18/Sandbox/src/Hello.kt:
--------------------------------------------------------------------------------
1 | fun main() {
2 | println("안녕하세요?")
3 | }
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/Ch01/Sandbox/out/production/Sandbox/META-INF/Sandbox.kotlin_module:
--------------------------------------------------------------------------------
1 |
2 |
3 | HelloKt
--------------------------------------------------------------------------------
/Ch20/Interop/out/production/Interop/META-INF/Interop.kotlin_module:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hero
--------------------------------------------------------------------------------
/Ch03/NyetHack/out/production/NyetHack/META-INF/NyetHack.kotlin_module:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | GameKt
--------------------------------------------------------------------------------
/Ch04/NyetHack/out/production/NyetHack/META-INF/NyetHack.kotlin_module:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | GameKt
--------------------------------------------------------------------------------
/Ch02/Sandbox/out/production/Sandbox/META-INF/Sandbox.kotlin_module:
--------------------------------------------------------------------------------
1 |
2 |
3 | HelloKtTypeIntroKt
--------------------------------------------------------------------------------
/Ch05/Sandbox/out/production/Sandbox/META-INF/Sandbox.kotlin_module:
--------------------------------------------------------------------------------
1 |
2 | &
3 | HelloKtSimVillageKtTypeIntroKt
--------------------------------------------------------------------------------
/Ch06/NyetHack/out/production/NyetHack/META-INF/NyetHack.kotlin_module:
--------------------------------------------------------------------------------
1 |
2 | $
3 | GameKtSwordJugglerKtTavernKt
--------------------------------------------------------------------------------
/Ch07/NyetHack/out/production/NyetHack/META-INF/NyetHack.kotlin_module:
--------------------------------------------------------------------------------
1 |
2 | $
3 | GameKtSwordJugglerKtTavernKt
--------------------------------------------------------------------------------
/Ch08/NyetHack/out/production/NyetHack/META-INF/NyetHack.kotlin_module:
--------------------------------------------------------------------------------
1 |
2 | $
3 | GameKtSwordJugglerKtTavernKt
--------------------------------------------------------------------------------
/Ch10/NyetHack/out/production/NyetHack/META-INF/NyetHack.kotlin_module:
--------------------------------------------------------------------------------
1 |
2 | $
3 | GameKtSwordJugglerKtTavernKt
--------------------------------------------------------------------------------
/Ch11/NyetHack/out/production/NyetHack/META-INF/NyetHack.kotlin_module:
--------------------------------------------------------------------------------
1 |
2 | $
3 | GameKtSwordJugglerKtTavernKt
--------------------------------------------------------------------------------
/Ch12/NyetHack/out/production/NyetHack/META-INF/NyetHack.kotlin_module:
--------------------------------------------------------------------------------
1 |
2 | $
3 | GameKtSwordJugglerKtTavernKt
--------------------------------------------------------------------------------
/Ch21/Samodelkin/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Samodelkin
3 |
4 |
--------------------------------------------------------------------------------
/Ch22/Samodelkin/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Samodelkin
3 |
4 |
--------------------------------------------------------------------------------
/Ch17/Sandbox/out/production/Sandbox/Coin.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch17/Sandbox/out/production/Sandbox/Coin.class
--------------------------------------------------------------------------------
/Ch17/Sandbox/out/production/Sandbox/Loot.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch17/Sandbox/out/production/Sandbox/Loot.class
--------------------------------------------------------------------------------
/Ch18/Sandbox/out/production/Sandbox/Coin.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch18/Sandbox/out/production/Sandbox/Coin.class
--------------------------------------------------------------------------------
/Ch18/Sandbox/out/production/Sandbox/Loot.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch18/Sandbox/out/production/Sandbox/Loot.class
--------------------------------------------------------------------------------
/Ch20/Interop/out/production/Interop/Hero.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch20/Interop/out/production/Interop/Hero.class
--------------------------------------------------------------------------------
/Ch21/.gradle/4.10.1/fileHashes/fileHashes.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch21/.gradle/4.10.1/fileHashes/fileHashes.bin
--------------------------------------------------------------------------------
/Ch21/.gradle/4.10.1/fileHashes/fileHashes.lock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch21/.gradle/4.10.1/fileHashes/fileHashes.lock
--------------------------------------------------------------------------------
/Ch22/.gradle/4.10.1/fileHashes/fileHashes.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch22/.gradle/4.10.1/fileHashes/fileHashes.bin
--------------------------------------------------------------------------------
/Ch22/.gradle/4.10.1/fileHashes/fileHashes.lock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch22/.gradle/4.10.1/fileHashes/fileHashes.lock
--------------------------------------------------------------------------------
/Ch17/Sandbox/out/production/Sandbox/Fedora.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch17/Sandbox/out/production/Sandbox/Fedora.class
--------------------------------------------------------------------------------
/Ch17/Sandbox/out/production/Sandbox/META-INF/Sandbox.kotlin_module:
--------------------------------------------------------------------------------
1 |
2 | 2
3 |
4 | GenericsKtHelloKtSimVillageKtTypeIntroKt
--------------------------------------------------------------------------------
/Ch18/Sandbox/out/production/Sandbox/Barrel.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch18/Sandbox/out/production/Sandbox/Barrel.class
--------------------------------------------------------------------------------
/Ch18/Sandbox/out/production/Sandbox/Fedora.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch18/Sandbox/out/production/Sandbox/Fedora.class
--------------------------------------------------------------------------------
/Ch20/Interop/out/production/Interop/Jhava.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch20/Interop/out/production/Interop/Jhava.class
--------------------------------------------------------------------------------
/Ch01/Sandbox/out/production/Sandbox/HelloKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch01/Sandbox/out/production/Sandbox/HelloKt.class
--------------------------------------------------------------------------------
/Ch02/Sandbox/out/production/Sandbox/HelloKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch02/Sandbox/out/production/Sandbox/HelloKt.class
--------------------------------------------------------------------------------
/Ch03/NyetHack/out/production/NyetHack/GameKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch03/NyetHack/out/production/NyetHack/GameKt.class
--------------------------------------------------------------------------------
/Ch04/NyetHack/out/production/NyetHack/GameKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch04/NyetHack/out/production/NyetHack/GameKt.class
--------------------------------------------------------------------------------
/Ch05/Sandbox/out/production/Sandbox/HelloKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch05/Sandbox/out/production/Sandbox/HelloKt.class
--------------------------------------------------------------------------------
/Ch06/NyetHack/out/production/NyetHack/GameKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch06/NyetHack/out/production/NyetHack/GameKt.class
--------------------------------------------------------------------------------
/Ch07/NyetHack/out/production/NyetHack/GameKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch07/NyetHack/out/production/NyetHack/GameKt.class
--------------------------------------------------------------------------------
/Ch08/NyetHack/out/production/NyetHack/GameKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch08/NyetHack/out/production/NyetHack/GameKt.class
--------------------------------------------------------------------------------
/Ch10/NyetHack/out/production/NyetHack/GameKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch10/NyetHack/out/production/NyetHack/GameKt.class
--------------------------------------------------------------------------------
/Ch11/NyetHack/out/production/NyetHack/GameKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch11/NyetHack/out/production/NyetHack/GameKt.class
--------------------------------------------------------------------------------
/Ch12/NyetHack/out/production/NyetHack/GameKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch12/NyetHack/out/production/NyetHack/GameKt.class
--------------------------------------------------------------------------------
/Ch13/NyetHack/data/towns.txt:
--------------------------------------------------------------------------------
1 | Neversummer
2 | Abelhaven
3 | Phandoril
4 | Tampa
5 | Sanorith
6 | Trell
7 | Zan'tro
8 | Hermi Hermi
9 | Curlthistle Forest
--------------------------------------------------------------------------------
/Ch14/NyetHack/data/towns.txt:
--------------------------------------------------------------------------------
1 | Neversummer
2 | Abelhaven
3 | Phandoril
4 | Tampa
5 | Sanorith
6 | Trell
7 | Zan'tro
8 | Hermi Hermi
9 | Curlthistle Forest
--------------------------------------------------------------------------------
/Ch15/NyetHack/data/towns.txt:
--------------------------------------------------------------------------------
1 | Neversummer
2 | Abelhaven
3 | Phandoril
4 | Tampa
5 | Sanorith
6 | Trell
7 | Zan'tro
8 | Hermi Hermi
9 | Curlthistle Forest
--------------------------------------------------------------------------------
/Ch16/NyetHack/data/towns.txt:
--------------------------------------------------------------------------------
1 | Neversummer
2 | Abelhaven
3 | Phandoril
4 | Tampa
5 | Sanorith
6 | Trell
7 | Zan'tro
8 | Hermi Hermi
9 | Curlthistle Forest
--------------------------------------------------------------------------------
/Ch17/Sandbox/out/production/Sandbox/HelloKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch17/Sandbox/out/production/Sandbox/HelloKt.class
--------------------------------------------------------------------------------
/Ch17/Sandbox/out/production/Sandbox/LootBox.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch17/Sandbox/out/production/Sandbox/LootBox.class
--------------------------------------------------------------------------------
/Ch18/NyetHack/data/towns.txt:
--------------------------------------------------------------------------------
1 | Neversummer
2 | Abelhaven
3 | Phandoril
4 | Tampa
5 | Sanorith
6 | Trell
7 | Zan'tro
8 | Hermi Hermi
9 | Curlthistle Forest
--------------------------------------------------------------------------------
/Ch18/Sandbox/out/production/Sandbox/HelloKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch18/Sandbox/out/production/Sandbox/HelloKt.class
--------------------------------------------------------------------------------
/Ch18/Sandbox/out/production/Sandbox/LootBox.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch18/Sandbox/out/production/Sandbox/LootBox.class
--------------------------------------------------------------------------------
/Ch20/Interop/out/production/Interop/Spellbook.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch20/Interop/out/production/Interop/Spellbook.class
--------------------------------------------------------------------------------
/Ch21/Samodelkin/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch21/Samodelkin/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/Ch22/Samodelkin/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch22/Samodelkin/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/Ch02/Sandbox/out/production/Sandbox/TypeIntroKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch02/Sandbox/out/production/Sandbox/TypeIntroKt.class
--------------------------------------------------------------------------------
/Ch05/Sandbox/out/production/Sandbox/TypeIntroKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch05/Sandbox/out/production/Sandbox/TypeIntroKt.class
--------------------------------------------------------------------------------
/Ch06/NyetHack/out/production/NyetHack/TavernKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch06/NyetHack/out/production/NyetHack/TavernKt.class
--------------------------------------------------------------------------------
/Ch07/NyetHack/out/production/NyetHack/TavernKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch07/NyetHack/out/production/NyetHack/TavernKt.class
--------------------------------------------------------------------------------
/Ch08/NyetHack/out/production/NyetHack/TavernKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch08/NyetHack/out/production/NyetHack/TavernKt.class
--------------------------------------------------------------------------------
/Ch10/NyetHack/out/production/NyetHack/TavernKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch10/NyetHack/out/production/NyetHack/TavernKt.class
--------------------------------------------------------------------------------
/Ch11/NyetHack/out/production/NyetHack/TavernKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch11/NyetHack/out/production/NyetHack/TavernKt.class
--------------------------------------------------------------------------------
/Ch12/NyetHack/out/production/NyetHack/TavernKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch12/NyetHack/out/production/NyetHack/TavernKt.class
--------------------------------------------------------------------------------
/Ch13/NyetHack/out/production/NyetHack/META-INF/NyetHack.kotlin_module:
--------------------------------------------------------------------------------
1 |
2 | =
3 | com.bignerdranch.nyethackGameKtSwordJugglerKtTavernKt
--------------------------------------------------------------------------------
/Ch14/NyetHack/out/production/NyetHack/META-INF/NyetHack.kotlin_module:
--------------------------------------------------------------------------------
1 |
2 | =
3 | com.bignerdranch.nyethackGameKtSwordJugglerKtTavernKt
--------------------------------------------------------------------------------
/Ch15/NyetHack/out/production/NyetHack/META-INF/NyetHack.kotlin_module:
--------------------------------------------------------------------------------
1 |
2 | =
3 | com.bignerdranch.nyethackGameKtSwordJugglerKtTavernKt
--------------------------------------------------------------------------------
/Ch16/NyetHack/out/production/NyetHack/META-INF/NyetHack.kotlin_module:
--------------------------------------------------------------------------------
1 |
2 | =
3 | com.bignerdranch.nyethackGameKtSwordJugglerKtTavernKt
--------------------------------------------------------------------------------
/Ch17/Sandbox/out/production/Sandbox/GenericsKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch17/Sandbox/out/production/Sandbox/GenericsKt.class
--------------------------------------------------------------------------------
/Ch17/Sandbox/out/production/Sandbox/TypeIntroKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch17/Sandbox/out/production/Sandbox/TypeIntroKt.class
--------------------------------------------------------------------------------
/Ch18/NyetHack/out/production/NyetHack/META-INF/NyetHack.kotlin_module:
--------------------------------------------------------------------------------
1 |
2 | =
3 | com.bignerdranch.nyethackGameKtSwordJugglerKtTavernKt
--------------------------------------------------------------------------------
/Ch18/Sandbox/out/production/Sandbox/GenericsKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch18/Sandbox/out/production/Sandbox/GenericsKt.class
--------------------------------------------------------------------------------
/Ch18/Sandbox/out/production/Sandbox/TypeIntroKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch18/Sandbox/out/production/Sandbox/TypeIntroKt.class
--------------------------------------------------------------------------------
/Ch18/Sandbox/out/production/Sandbox/VarianceKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch18/Sandbox/out/production/Sandbox/VarianceKt.class
--------------------------------------------------------------------------------
/Ch05/Sandbox/out/production/Sandbox/SimVillageKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch05/Sandbox/out/production/Sandbox/SimVillageKt.class
--------------------------------------------------------------------------------
/Ch17/Sandbox/out/production/Sandbox/SimVillageKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch17/Sandbox/out/production/Sandbox/SimVillageKt.class
--------------------------------------------------------------------------------
/Ch18/Sandbox/out/production/Sandbox/ExtensionsKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch18/Sandbox/out/production/Sandbox/ExtensionsKt.class
--------------------------------------------------------------------------------
/Ch18/Sandbox/out/production/Sandbox/SimVillageKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch18/Sandbox/out/production/Sandbox/SimVillageKt.class
--------------------------------------------------------------------------------
/Ch06/NyetHack/out/production/NyetHack/SwordJugglerKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch06/NyetHack/out/production/NyetHack/SwordJugglerKt.class
--------------------------------------------------------------------------------
/Ch07/NyetHack/out/production/NyetHack/SwordJugglerKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch07/NyetHack/out/production/NyetHack/SwordJugglerKt.class
--------------------------------------------------------------------------------
/Ch08/NyetHack/out/production/NyetHack/SwordJugglerKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch08/NyetHack/out/production/NyetHack/SwordJugglerKt.class
--------------------------------------------------------------------------------
/Ch10/NyetHack/out/production/NyetHack/SwordJugglerKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch10/NyetHack/out/production/NyetHack/SwordJugglerKt.class
--------------------------------------------------------------------------------
/Ch11/NyetHack/out/production/NyetHack/SwordJugglerKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch11/NyetHack/out/production/NyetHack/SwordJugglerKt.class
--------------------------------------------------------------------------------
/Ch12/NyetHack/out/production/NyetHack/SwordJugglerKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch12/NyetHack/out/production/NyetHack/SwordJugglerKt.class
--------------------------------------------------------------------------------
/Ch20/Interop/out/production/Interop/Hero$translator$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch20/Interop/out/production/Interop/Hero$translator$1.class
--------------------------------------------------------------------------------
/Ch20/Interop/out/production/Interop/Spellbook$Companion.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch20/Interop/out/production/Interop/Spellbook$Companion.class
--------------------------------------------------------------------------------
/Ch21/Samodelkin/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch21/Samodelkin/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Ch21/Samodelkin/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch21/Samodelkin/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Ch21/Samodelkin/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch21/Samodelkin/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Ch22/Samodelkin/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch22/Samodelkin/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Ch22/Samodelkin/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch22/Samodelkin/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Ch22/Samodelkin/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch22/Samodelkin/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Ch18/Sandbox/out/production/Sandbox/META-INF/Sandbox.kotlin_module:
--------------------------------------------------------------------------------
1 |
2 | L
3 | ExtensionsKt
4 | GenericsKtHelloKtSimVillageKtTypeIntroKt
5 | VarianceKt
--------------------------------------------------------------------------------
/Ch21/Samodelkin/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch21/Samodelkin/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Ch21/Samodelkin/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch21/Samodelkin/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Ch22/Samodelkin/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch22/Samodelkin/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Ch22/Samodelkin/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch22/Samodelkin/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Ch01/Sandbox/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Ch02/Sandbox/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Ch03/NyetHack/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Ch04/NyetHack/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Ch05/Sandbox/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Ch06/NyetHack/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Ch07/NyetHack/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Ch08/NyetHack/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Ch10/NyetHack/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Ch11/NyetHack/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Ch12/NyetHack/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Ch13/NyetHack/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Ch14/NyetHack/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Ch15/NyetHack/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Ch16/NyetHack/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Ch17/Sandbox/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Ch17/Sandbox/out/production/Sandbox/GenericsKt$main$coin$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch17/Sandbox/out/production/Sandbox/GenericsKt$main$coin$1.class
--------------------------------------------------------------------------------
/Ch18/NyetHack/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Ch18/NyetHack/src/com/bignerdranch/nyethack/extensions/IterableExt.kt:
--------------------------------------------------------------------------------
1 | package com.bignerdranch.nyethack.extensions
2 |
3 | fun Iterable.random(): T = this.shuffled().first()
--------------------------------------------------------------------------------
/Ch18/Sandbox/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Ch18/Sandbox/out/production/Sandbox/GenericsKt$main$coin$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch18/Sandbox/out/production/Sandbox/GenericsKt$main$coin$1.class
--------------------------------------------------------------------------------
/Ch20/Interop/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Ch21/Samodelkin/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch21/Samodelkin/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Ch21/Samodelkin/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch21/Samodelkin/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Ch22/Samodelkin/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch22/Samodelkin/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Ch22/Samodelkin/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch22/Samodelkin/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Ch07/NyetHack/out/production/NyetHack/TavernKt$toDragonSpeak$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch07/NyetHack/out/production/NyetHack/TavernKt$toDragonSpeak$1.class
--------------------------------------------------------------------------------
/Ch08/NyetHack/out/production/NyetHack/TavernKt$toDragonSpeak$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch08/NyetHack/out/production/NyetHack/TavernKt$toDragonSpeak$1.class
--------------------------------------------------------------------------------
/Ch10/NyetHack/out/production/NyetHack/TavernKt$toDragonSpeak$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch10/NyetHack/out/production/NyetHack/TavernKt$toDragonSpeak$1.class
--------------------------------------------------------------------------------
/Ch11/NyetHack/out/production/NyetHack/TavernKt$toDragonSpeak$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch11/NyetHack/out/production/NyetHack/TavernKt$toDragonSpeak$1.class
--------------------------------------------------------------------------------
/Ch12/NyetHack/out/production/NyetHack/TavernKt$toDragonSpeak$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch12/NyetHack/out/production/NyetHack/TavernKt$toDragonSpeak$1.class
--------------------------------------------------------------------------------
/Ch21/Samodelkin/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch21/Samodelkin/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Ch21/Samodelkin/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch21/Samodelkin/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Ch22/Samodelkin/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch22/Samodelkin/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Ch22/Samodelkin/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch22/Samodelkin/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Ch21/Samodelkin/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch21/Samodelkin/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Ch22/Samodelkin/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch22/Samodelkin/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Ch06/NyetHack/out/production/NyetHack/UnskilledSwordJugglerException.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch06/NyetHack/out/production/NyetHack/UnskilledSwordJugglerException.class
--------------------------------------------------------------------------------
/Ch07/NyetHack/out/production/NyetHack/UnskilledSwordJugglerException.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch07/NyetHack/out/production/NyetHack/UnskilledSwordJugglerException.class
--------------------------------------------------------------------------------
/Ch08/NyetHack/out/production/NyetHack/UnskilledSwordJugglerException.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch08/NyetHack/out/production/NyetHack/UnskilledSwordJugglerException.class
--------------------------------------------------------------------------------
/Ch10/NyetHack/out/production/NyetHack/UnskilledSwordJugglerException.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch10/NyetHack/out/production/NyetHack/UnskilledSwordJugglerException.class
--------------------------------------------------------------------------------
/Ch11/NyetHack/out/production/NyetHack/TavernKt$displayPatronBalances$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch11/NyetHack/out/production/NyetHack/TavernKt$displayPatronBalances$1.class
--------------------------------------------------------------------------------
/Ch11/NyetHack/out/production/NyetHack/UnskilledSwordJugglerException.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch11/NyetHack/out/production/NyetHack/UnskilledSwordJugglerException.class
--------------------------------------------------------------------------------
/Ch12/NyetHack/out/production/NyetHack/TavernKt$displayPatronBalances$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch12/NyetHack/out/production/NyetHack/TavernKt$displayPatronBalances$1.class
--------------------------------------------------------------------------------
/Ch12/NyetHack/out/production/NyetHack/UnskilledSwordJugglerException.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch12/NyetHack/out/production/NyetHack/UnskilledSwordJugglerException.class
--------------------------------------------------------------------------------
/Ch13/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/GameKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch13/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/GameKt.class
--------------------------------------------------------------------------------
/Ch13/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Player.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch13/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Player.class
--------------------------------------------------------------------------------
/Ch14/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/GameKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch14/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/GameKt.class
--------------------------------------------------------------------------------
/Ch14/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Player.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch14/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Player.class
--------------------------------------------------------------------------------
/Ch14/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Room.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch14/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Room.class
--------------------------------------------------------------------------------
/Ch15/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Game.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch15/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Game.class
--------------------------------------------------------------------------------
/Ch15/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/GameKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch15/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/GameKt.class
--------------------------------------------------------------------------------
/Ch15/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Player.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch15/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Player.class
--------------------------------------------------------------------------------
/Ch15/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Room.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch15/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Room.class
--------------------------------------------------------------------------------
/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Game.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Game.class
--------------------------------------------------------------------------------
/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/GameKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/GameKt.class
--------------------------------------------------------------------------------
/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Goblin.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Goblin.class
--------------------------------------------------------------------------------
/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Player.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Player.class
--------------------------------------------------------------------------------
/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Room.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Room.class
--------------------------------------------------------------------------------
/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Game.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Game.class
--------------------------------------------------------------------------------
/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/GameKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/GameKt.class
--------------------------------------------------------------------------------
/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Goblin.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Goblin.class
--------------------------------------------------------------------------------
/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Player.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Player.class
--------------------------------------------------------------------------------
/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Room.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Room.class
--------------------------------------------------------------------------------
/Ch01/Sandbox/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Ch02/Sandbox/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Ch03/NyetHack/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Ch04/NyetHack/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Ch05/Sandbox/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Ch06/NyetHack/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Ch07/NyetHack/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Ch08/NyetHack/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Ch10/NyetHack/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Ch10/NyetHack/data/tavern-menu-items.txt:
--------------------------------------------------------------------------------
1 | shandy,Dragon's Breath,5.91
2 | elixir,shirley temple,4.12
3 | meal,goblet of la croix,1.22
4 | desert dessert,pickled camel hump,7.33
5 | elixir,iced boilermaker,11.22
--------------------------------------------------------------------------------
/Ch11/NyetHack/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Ch11/NyetHack/data/tavern-menu-items.txt:
--------------------------------------------------------------------------------
1 | shandy,Dragon's Breath,5.91
2 | elixir,shirley temple,4.12
3 | meal,goblet of la croix,1.22
4 | desert dessert,pickled camel hump,7.33
5 | elixir,iced boilermaker,11.22
--------------------------------------------------------------------------------
/Ch12/NyetHack/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Ch12/NyetHack/data/tavern-menu-items.txt:
--------------------------------------------------------------------------------
1 | shandy,Dragon's Breath,5.91
2 | elixir,shirley temple,4.12
3 | meal,goblet of la croix,1.22
4 | desert dessert,pickled camel hump,7.33
5 | elixir,iced boilermaker,11.22
--------------------------------------------------------------------------------
/Ch13/NyetHack/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Ch13/NyetHack/data/tavern-menu-items.txt:
--------------------------------------------------------------------------------
1 | shandy,Dragon's Breath,5.91
2 | elixir,shirley temple,4.12
3 | meal,goblet of la croix,1.22
4 | desert dessert,pickled camel hump,7.33
5 | elixir,iced boilermaker,11.22
--------------------------------------------------------------------------------
/Ch13/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TavernKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch13/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TavernKt.class
--------------------------------------------------------------------------------
/Ch14/NyetHack/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Ch14/NyetHack/data/tavern-menu-items.txt:
--------------------------------------------------------------------------------
1 | shandy,Dragon's Breath,5.91
2 | elixir,shirley temple,4.12
3 | meal,goblet of la croix,1.22
4 | desert dessert,pickled camel hump,7.33
5 | elixir,iced boilermaker,11.22
--------------------------------------------------------------------------------
/Ch14/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TavernKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch14/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TavernKt.class
--------------------------------------------------------------------------------
/Ch15/NyetHack/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Ch15/NyetHack/data/tavern-menu-items.txt:
--------------------------------------------------------------------------------
1 | shandy,Dragon's Breath,5.91
2 | elixir,shirley temple,4.12
3 | meal,goblet of la croix,1.22
4 | desert dessert,pickled camel hump,7.33
5 | elixir,iced boilermaker,11.22
--------------------------------------------------------------------------------
/Ch15/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TavernKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch15/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TavernKt.class
--------------------------------------------------------------------------------
/Ch16/NyetHack/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Ch16/NyetHack/data/tavern-menu-items.txt:
--------------------------------------------------------------------------------
1 | shandy,Dragon's Breath,5.91
2 | elixir,shirley temple,4.12
3 | meal,goblet of la croix,1.22
4 | desert dessert,pickled camel hump,7.33
5 | elixir,iced boilermaker,11.22
--------------------------------------------------------------------------------
/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Monster.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Monster.class
--------------------------------------------------------------------------------
/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TavernKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TavernKt.class
--------------------------------------------------------------------------------
/Ch17/Sandbox/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Ch18/NyetHack/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Ch18/NyetHack/data/tavern-menu-items.txt:
--------------------------------------------------------------------------------
1 | shandy,Dragon's Breath,5.91
2 | elixir,shirley temple,4.12
3 | meal,goblet of la croix,1.22
4 | desert dessert,pickled camel hump,7.33
5 | elixir,iced boilermaker,11.22
--------------------------------------------------------------------------------
/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Monster.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Monster.class
--------------------------------------------------------------------------------
/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TavernKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TavernKt.class
--------------------------------------------------------------------------------
/Ch18/Sandbox/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Ch20/Interop/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Ch14/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TownSquare.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch14/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TownSquare.class
--------------------------------------------------------------------------------
/Ch15/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Coordinate.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch15/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Coordinate.class
--------------------------------------------------------------------------------
/Ch15/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Direction.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch15/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Direction.class
--------------------------------------------------------------------------------
/Ch15/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TownSquare.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch15/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TownSquare.class
--------------------------------------------------------------------------------
/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Coordinate.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Coordinate.class
--------------------------------------------------------------------------------
/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Direction.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Direction.class
--------------------------------------------------------------------------------
/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Fightable.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Fightable.class
--------------------------------------------------------------------------------
/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TownSquare.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TownSquare.class
--------------------------------------------------------------------------------
/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Coordinate.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Coordinate.class
--------------------------------------------------------------------------------
/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Direction.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Direction.class
--------------------------------------------------------------------------------
/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Fightable.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Fightable.class
--------------------------------------------------------------------------------
/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TownSquare.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TownSquare.class
--------------------------------------------------------------------------------
/Ch21/Samodelkin/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Ch22/Samodelkin/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Ch05/Sandbox/out/production/Sandbox/SimVillageKt$configureGreetingFunction$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch05/Sandbox/out/production/Sandbox/SimVillageKt$configureGreetingFunction$1.class
--------------------------------------------------------------------------------
/Ch17/Sandbox/out/production/Sandbox/SimVillageKt$configureGreetingFunction$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch17/Sandbox/out/production/Sandbox/SimVillageKt$configureGreetingFunction$1.class
--------------------------------------------------------------------------------
/Ch18/Sandbox/out/production/Sandbox/SimVillageKt$configureGreetingFunction$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch18/Sandbox/out/production/Sandbox/SimVillageKt$configureGreetingFunction$1.class
--------------------------------------------------------------------------------
/Ch13/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/SwordJugglerKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch13/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/SwordJugglerKt.class
--------------------------------------------------------------------------------
/Ch14/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/SwordJugglerKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch14/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/SwordJugglerKt.class
--------------------------------------------------------------------------------
/Ch15/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Game$GameInput.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch15/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Game$GameInput.class
--------------------------------------------------------------------------------
/Ch15/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/SwordJugglerKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch15/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/SwordJugglerKt.class
--------------------------------------------------------------------------------
/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Game$GameInput.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Game$GameInput.class
--------------------------------------------------------------------------------
/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/SwordJugglerKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/SwordJugglerKt.class
--------------------------------------------------------------------------------
/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Game$GameInput.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Game$GameInput.class
--------------------------------------------------------------------------------
/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/SwordJugglerKt.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/SwordJugglerKt.class
--------------------------------------------------------------------------------
/Ch14/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Player$hometown$2.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch14/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Player$hometown$2.class
--------------------------------------------------------------------------------
/Ch15/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Player$hometown$2.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch15/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Player$hometown$2.class
--------------------------------------------------------------------------------
/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Player$hometown$2.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Player$hometown$2.class
--------------------------------------------------------------------------------
/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Player$hometown$2.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Player$hometown$2.class
--------------------------------------------------------------------------------
/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Fightable$DefaultImpls.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Fightable$DefaultImpls.class
--------------------------------------------------------------------------------
/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Fightable$DefaultImpls.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/Fightable$DefaultImpls.class
--------------------------------------------------------------------------------
/Ch13/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TavernKt$toDragonSpeak$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch13/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TavernKt$toDragonSpeak$1.class
--------------------------------------------------------------------------------
/Ch14/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TavernKt$toDragonSpeak$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch14/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TavernKt$toDragonSpeak$1.class
--------------------------------------------------------------------------------
/Ch15/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TavernKt$toDragonSpeak$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch15/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TavernKt$toDragonSpeak$1.class
--------------------------------------------------------------------------------
/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TavernKt$toDragonSpeak$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TavernKt$toDragonSpeak$1.class
--------------------------------------------------------------------------------
/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TavernKt$toDragonSpeak$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TavernKt$toDragonSpeak$1.class
--------------------------------------------------------------------------------
/Ch02/Sandbox/src/TypeIntro.kt:
--------------------------------------------------------------------------------
1 | const val MAX_EXPERIENCE: Int = 5000
2 |
3 | fun main() {
4 | val playerName = "에스트라곤"
5 | var experiencePoints = 5
6 | experiencePoints += 5
7 | println(experiencePoints)
8 | println(playerName)
9 | }
--------------------------------------------------------------------------------
/Ch05/Sandbox/src/TypeIntro.kt:
--------------------------------------------------------------------------------
1 | const val MAX_EXPERIENCE: Int = 5000
2 |
3 | fun main() {
4 | val playerName = "에스트라곤"
5 | var experiencePoints = 5
6 | experiencePoints += 5
7 | println(experiencePoints)
8 | println(playerName)
9 | }
--------------------------------------------------------------------------------
/Ch13/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/UnskilledSwordJugglerException.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch13/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/UnskilledSwordJugglerException.class
--------------------------------------------------------------------------------
/Ch14/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/UnskilledSwordJugglerException.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch14/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/UnskilledSwordJugglerException.class
--------------------------------------------------------------------------------
/Ch15/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/UnskilledSwordJugglerException.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch15/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/UnskilledSwordJugglerException.class
--------------------------------------------------------------------------------
/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/UnskilledSwordJugglerException.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/UnskilledSwordJugglerException.class
--------------------------------------------------------------------------------
/Ch17/Sandbox/src/TypeIntro.kt:
--------------------------------------------------------------------------------
1 | const val MAX_EXPERIENCE: Int = 5000
2 |
3 | fun main() {
4 | val playerName = "에스트라곤"
5 | var experiencePoints = 5
6 | experiencePoints += 5
7 | println(experiencePoints)
8 | println(playerName)
9 | }
--------------------------------------------------------------------------------
/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/UnskilledSwordJugglerException.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/UnskilledSwordJugglerException.class
--------------------------------------------------------------------------------
/Ch18/Sandbox/src/TypeIntro.kt:
--------------------------------------------------------------------------------
1 | const val MAX_EXPERIENCE: Int = 5000
2 |
3 | fun main() {
4 | val playerName = "에스트라곤"
5 | var experiencePoints = 5
6 | experiencePoints += 5
7 | println(experiencePoints)
8 | println(playerName)
9 | }
--------------------------------------------------------------------------------
/Ch13/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TavernKt$displayPatronBalances$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch13/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TavernKt$displayPatronBalances$1.class
--------------------------------------------------------------------------------
/Ch14/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TavernKt$displayPatronBalances$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch14/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TavernKt$displayPatronBalances$1.class
--------------------------------------------------------------------------------
/Ch15/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TavernKt$displayPatronBalances$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch15/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TavernKt$displayPatronBalances$1.class
--------------------------------------------------------------------------------
/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TavernKt$displayPatronBalances$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch16/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TavernKt$displayPatronBalances$1.class
--------------------------------------------------------------------------------
/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TavernKt$displayPatronBalances$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/BNR_Kotlin/HEAD/Ch18/NyetHack/out/production/NyetHack/com/bignerdranch/nyethack/TavernKt$displayPatronBalances$1.class
--------------------------------------------------------------------------------
/Ch17/Sandbox/src/Variance.kt:
--------------------------------------------------------------------------------
1 | class Barrel(item: T)
2 |
3 | fun main(args: Array) {
4 | var fedoraBarrel: Barrel = Barrel(Fedora("평범한 중절모", 15))
5 | var lootBarrel: Barrel = Barrel(Coin(15))
6 |
7 | fedoraBarrel = lootBarrel
8 | }
--------------------------------------------------------------------------------
/Ch18/Sandbox/src/Variance.kt:
--------------------------------------------------------------------------------
1 | class Barrel(item: T)
2 |
3 | fun main(args: Array) {
4 | var fedoraBarrel: Barrel = Barrel(Fedora("평범한 중절모", 15))
5 | var lootBarrel: Barrel = Barrel(Coin(15))
6 |
7 | fedoraBarrel = lootBarrel
8 | }
--------------------------------------------------------------------------------
/Ch21/Samodelkin/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #D81B60
6 |
7 |
--------------------------------------------------------------------------------
/Ch22/Samodelkin/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #D81B60
6 |
7 |
--------------------------------------------------------------------------------
/Ch21/Samodelkin/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 |
--------------------------------------------------------------------------------
/Ch22/Samodelkin/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 |
--------------------------------------------------------------------------------
/Ch01/Sandbox/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Ch02/Sandbox/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Ch05/Sandbox/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Ch17/Sandbox/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Ch18/Sandbox/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Ch20/Interop/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Ch21/Samodelkin/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Mar 14 19:53:12 KST 2019
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
7 |
--------------------------------------------------------------------------------
/Ch22/Samodelkin/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Mar 14 19:53:12 KST 2019
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
7 |
--------------------------------------------------------------------------------
/Ch01/Sandbox/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Ch02/Sandbox/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Ch03/NyetHack/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Ch04/NyetHack/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Ch05/Sandbox/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Ch06/NyetHack/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Ch07/NyetHack/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Ch08/NyetHack/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Ch10/NyetHack/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Ch11/NyetHack/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Ch12/NyetHack/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Ch13/NyetHack/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Ch14/NyetHack/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Ch15/NyetHack/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Ch16/NyetHack/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Ch17/Sandbox/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Ch18/NyetHack/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Ch18/Sandbox/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Ch20/Interop/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Ch03/NyetHack/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Ch04/NyetHack/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Ch06/NyetHack/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Ch07/NyetHack/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Ch08/NyetHack/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Ch10/NyetHack/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Ch11/NyetHack/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Ch12/NyetHack/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Ch13/NyetHack/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Ch14/NyetHack/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Ch15/NyetHack/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Ch16/NyetHack/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Ch18/NyetHack/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Ch21/Samodelkin/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Ch22/Samodelkin/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Ch21/Samodelkin/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Ch22/Samodelkin/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Ch06/NyetHack/src/Tavern.kt:
--------------------------------------------------------------------------------
1 | fun main() {
2 | var beverage = readLine()
3 | // beverage = null
4 |
5 | if (beverage != null) {
6 | beverage = beverage.capitalize()
7 | } else {
8 | println("beverage가 null입니다!")
9 | }
10 |
11 | val beverageServed: String = beverage ?: "맥주"
12 | println(beverageServed)
13 | }
--------------------------------------------------------------------------------
/Ch01/Sandbox/.idea/kotlinc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch02/Sandbox/.idea/kotlinc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch03/NyetHack/.idea/kotlinc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch04/NyetHack/.idea/kotlinc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch05/Sandbox/.idea/kotlinc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch06/NyetHack/.idea/kotlinc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch07/NyetHack/.idea/kotlinc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch08/NyetHack/.idea/kotlinc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch10/NyetHack/.idea/kotlinc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch11/NyetHack/.idea/kotlinc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch12/NyetHack/.idea/kotlinc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch13/NyetHack/.idea/kotlinc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch14/NyetHack/.idea/kotlinc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch15/NyetHack/.idea/kotlinc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch16/NyetHack/.idea/kotlinc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch17/Sandbox/.idea/kotlinc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch18/NyetHack/.idea/kotlinc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch18/Sandbox/.idea/kotlinc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch20/Interop/.idea/kotlinc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch21/Samodelkin/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Ch22/Samodelkin/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Ch01/Sandbox/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch02/Sandbox/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch05/Sandbox/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch17/Sandbox/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch18/Sandbox/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch20/Interop/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch20/Interop/.idea/libraries/org_jetbrains_annotations_16_0_2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch03/NyetHack/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch04/NyetHack/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch06/NyetHack/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch07/NyetHack/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch08/NyetHack/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch10/NyetHack/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch11/NyetHack/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch12/NyetHack/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch13/NyetHack/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch14/NyetHack/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch15/NyetHack/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch16/NyetHack/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch18/NyetHack/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Ch21/Samodelkin/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Ch22/Samodelkin/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Ch21/Samodelkin/app/src/test/java/android/bignerdranch/com/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package android.bignerdranch.com
2 |
3 | import org.junit.Test
4 |
5 | import org.junit.Assert.*
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | class ExampleUnitTest {
13 | @Test
14 | fun addition_isCorrect() {
15 | assertEquals(4, 2 + 2)
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Ch22/Samodelkin/app/src/test/java/android/bignerdranch/com/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package android.bignerdranch.com
2 |
3 | import org.junit.Test
4 |
5 | import org.junit.Assert.*
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | class ExampleUnitTest {
13 | @Test
14 | fun addition_isCorrect() {
15 | assertEquals(4, 2 + 2)
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 빅 너드 랜치의 코틀린 프로그래밍
2 |
3 | 
4 |
5 |
6 | **출판사** 제이펍
7 | **원서명** Kotlin Programming: The Big Nerd Ranch Guide(원서 ISBN: 9780135161630)
8 | **저자명** 조시 스킨, 데이비드 그린핼프
9 | **역자명** 심재철
10 | **출판일** 2019년 3월 29일
11 | **페이지** 476쪽
12 | **시리즈** I♥Mobile 36(아이러브모바일 36)
13 | **ISBN** 979-11-88621-53-8 (93000)
14 |
15 | [### 도서 소개 페이지 바로 가기 ###](https://jpub.tistory.com/910?category=208491)
--------------------------------------------------------------------------------
/Ch01/Sandbox/Sandbox.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Ch02/Sandbox/Sandbox.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Ch05/Sandbox/Sandbox.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Ch17/Sandbox/Sandbox.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Ch18/Sandbox/Sandbox.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Ch03/NyetHack/NyetHack.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Ch04/NyetHack/NyetHack.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Ch06/NyetHack/NyetHack.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Ch07/NyetHack/NyetHack.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Ch08/NyetHack/NyetHack.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Ch10/NyetHack/NyetHack.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Ch11/NyetHack/NyetHack.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Ch12/NyetHack/NyetHack.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Ch13/NyetHack/NyetHack.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Ch14/NyetHack/NyetHack.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Ch15/NyetHack/NyetHack.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Ch16/NyetHack/NyetHack.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Ch18/NyetHack/NyetHack.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Ch15/NyetHack/src/com/bignerdranch/nyethack/Navigation.kt:
--------------------------------------------------------------------------------
1 | package com.bignerdranch.nyethack
2 |
3 | enum class Direction(private val coordinate: Coordinate) {
4 | NORTH(Coordinate(0, -1)),
5 | EAST(Coordinate(1, 0)),
6 | SOUTH(Coordinate(0, 1)),
7 | WEST(Coordinate(-1, 0)); // 제일 끝에 세미콜론을 추가한다
8 | fun updateCoordinate(playerCoordinate: Coordinate) =
9 | coordinate + playerCoordinate
10 | }
11 |
12 | data class Coordinate(val x: Int, val y: Int) {
13 | val isInBounds = x >= 0 && y >= 0
14 |
15 | operator fun plus(other: Coordinate) = Coordinate(x + other.x, y + other.y)
16 | }
17 |
--------------------------------------------------------------------------------
/Ch16/NyetHack/src/com/bignerdranch/nyethack/Navigation.kt:
--------------------------------------------------------------------------------
1 | package com.bignerdranch.nyethack
2 |
3 | enum class Direction(private val coordinate: Coordinate) {
4 | NORTH(Coordinate(0, -1)),
5 | EAST(Coordinate(1, 0)),
6 | SOUTH(Coordinate(0, 1)),
7 | WEST(Coordinate(-1, 0)); // 제일 끝에 세미콜론을 추가한다
8 | fun updateCoordinate(playerCoordinate: Coordinate) =
9 | coordinate + playerCoordinate
10 | }
11 |
12 | data class Coordinate(val x: Int, val y: Int) {
13 | val isInBounds = x >= 0 && y >= 0
14 |
15 | operator fun plus(other: Coordinate) = Coordinate(x + other.x, y + other.y)
16 | }
17 |
--------------------------------------------------------------------------------
/Ch18/NyetHack/src/com/bignerdranch/nyethack/Navigation.kt:
--------------------------------------------------------------------------------
1 | package com.bignerdranch.nyethack
2 |
3 | enum class Direction(private val coordinate: Coordinate) {
4 | NORTH(Coordinate(0, -1)),
5 | EAST(Coordinate(1, 0)),
6 | SOUTH(Coordinate(0, 1)),
7 | WEST(Coordinate(-1, 0)); // 제일 끝에 세미콜론을 추가한다
8 | fun updateCoordinate(playerCoordinate: Coordinate) =
9 | coordinate + playerCoordinate
10 | }
11 |
12 | data class Coordinate(val x: Int, val y: Int) {
13 | val isInBounds = x >= 0 && y >= 0
14 |
15 | operator fun plus(other: Coordinate) = Coordinate(x + other.x, y + other.y)
16 | }
17 |
--------------------------------------------------------------------------------
/Ch18/Sandbox/src/Extensions.kt:
--------------------------------------------------------------------------------
1 | val String.numVowels
2 | get() = count { "aeiouy".contains(it) }
3 |
4 | fun String.addEnthusiasm(amount: Int = 1) = this + "!".repeat(amount)
5 |
6 | fun T.easyPrint() : T {
7 | println(this)
8 | return this
9 | }
10 |
11 | infix fun String?.printWithDefault(default: String) = print(this ?: default)
12 |
13 | fun main(args: Array) {
14 | "마드리갈이 그 건물에서 나왔습니다".easyPrint().addEnthusiasm().easyPrint()
15 | 42.easyPrint()
16 | "How many vowels?".numVowels.easyPrint()
17 |
18 | val nullableString: String? = null
19 | nullableString printWithDefault "기본 문자열"
20 | }
--------------------------------------------------------------------------------
/Ch21/Samodelkin/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
--------------------------------------------------------------------------------
/Ch22/Samodelkin/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Ch20/Interop/Interop.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Ch14/NyetHack/src/com/bignerdranch/nyethack/Room.kt:
--------------------------------------------------------------------------------
1 | package com.bignerdranch.nyethack
2 |
3 | open class Room(val name: String) {
4 | protected open val dangerLevel = 5
5 |
6 | fun description() = "Room: $name\r\n" + // 맥 OS나 리눅스에서는 "Room: $name\n"
7 | "위험 수준: $dangerLevel"
8 |
9 | open fun load() = "아무도 여기에 오지 않았습니다..."
10 | }
11 |
12 | class TownSquare : Room("Town Square") {
13 | override val dangerLevel = super.dangerLevel - 3
14 | private var bellSound = "댕댕"
15 |
16 | final override fun load() = "당신의 참여를 주민들이 다 함께 환영합니다!\r\n${ringBell()}"
17 |
18 | private fun ringBell() = "당신의 도착을 종탑에서 알립니다. $bellSound"
19 | }
--------------------------------------------------------------------------------
/Ch15/NyetHack/src/com/bignerdranch/nyethack/Room.kt:
--------------------------------------------------------------------------------
1 | package com.bignerdranch.nyethack
2 |
3 | open class Room(val name: String) {
4 | protected open val dangerLevel = 5
5 |
6 | fun description() = "Room: $name\r\n" + // 맥 OS나 리눅스에서는 "Room: $name\n"
7 | "위험 수준: $dangerLevel"
8 |
9 | open fun load() = "아무도 여기에 오지 않았습니다..."
10 | }
11 |
12 | class TownSquare : Room("Town Square") {
13 | override val dangerLevel = super.dangerLevel - 3
14 | private var bellSound = "댕댕"
15 |
16 | final override fun load() = "당신의 참여를 주민들이 다 함께 환영합니다!\r\n${ringBell()}"
17 |
18 | private fun ringBell() = "당신의 도착을 종탑에서 알립니다. $bellSound"
19 | }
--------------------------------------------------------------------------------
/Ch06/NyetHack/src/SwordJuggler.kt:
--------------------------------------------------------------------------------
1 | fun main(args: Array) {
2 | var swordsJuggling: Int? = null
3 | val isJugglingProficient = (1..3).shuffled().last() == 3
4 | if (isJugglingProficient) {
5 | swordsJuggling = 2
6 | }
7 |
8 | try {
9 | proficiencyCheck(swordsJuggling)
10 | swordsJuggling = swordsJuggling!!.plus(1)
11 | } catch (e: Exception) {
12 | println(e)
13 | }
14 |
15 | println("$swordsJuggling 개의 칼로 저글링합니다!")
16 | }
17 |
18 | fun proficiencyCheck(swordsJuggling: Int?) {
19 | checkNotNull(swordsJuggling, { "플레이어가 저글링을 할 수 없음" })
20 | }
21 |
22 | class UnskilledSwordJugglerException() :
23 | IllegalStateException("플레이어가 저글링을 할 수 없음")
--------------------------------------------------------------------------------
/Ch07/NyetHack/src/SwordJuggler.kt:
--------------------------------------------------------------------------------
1 | fun main(args: Array) {
2 | var swordsJuggling: Int? = null
3 | val isJugglingProficient = (1..3).shuffled().last() == 3
4 | if (isJugglingProficient) {
5 | swordsJuggling = 2
6 | }
7 |
8 | try {
9 | proficiencyCheck(swordsJuggling)
10 | swordsJuggling = swordsJuggling!!.plus(1)
11 | } catch (e: Exception) {
12 | println(e)
13 | }
14 |
15 | println("$swordsJuggling 개의 칼로 저글링합니다!")
16 | }
17 |
18 | fun proficiencyCheck(swordsJuggling: Int?) {
19 | checkNotNull(swordsJuggling, { "플레이어가 저글링을 할 수 없음" })
20 | }
21 |
22 | class UnskilledSwordJugglerException() :
23 | IllegalStateException("플레이어가 저글링을 할 수 없음")
--------------------------------------------------------------------------------
/Ch08/NyetHack/src/SwordJuggler.kt:
--------------------------------------------------------------------------------
1 | fun main(args: Array) {
2 | var swordsJuggling: Int? = null
3 | val isJugglingProficient = (1..3).shuffled().last() == 3
4 | if (isJugglingProficient) {
5 | swordsJuggling = 2
6 | }
7 |
8 | try {
9 | proficiencyCheck(swordsJuggling)
10 | swordsJuggling = swordsJuggling!!.plus(1)
11 | } catch (e: Exception) {
12 | println(e)
13 | }
14 |
15 | println("$swordsJuggling 개의 칼로 저글링합니다!")
16 | }
17 |
18 | fun proficiencyCheck(swordsJuggling: Int?) {
19 | checkNotNull(swordsJuggling, { "플레이어가 저글링을 할 수 없음" })
20 | }
21 |
22 | class UnskilledSwordJugglerException() :
23 | IllegalStateException("플레이어가 저글링을 할 수 없음")
--------------------------------------------------------------------------------
/Ch10/NyetHack/src/SwordJuggler.kt:
--------------------------------------------------------------------------------
1 | fun main(args: Array) {
2 | var swordsJuggling: Int? = null
3 | val isJugglingProficient = (1..3).shuffled().last() == 3
4 | if (isJugglingProficient) {
5 | swordsJuggling = 2
6 | }
7 |
8 | try {
9 | proficiencyCheck(swordsJuggling)
10 | swordsJuggling = swordsJuggling!!.plus(1)
11 | } catch (e: Exception) {
12 | println(e)
13 | }
14 |
15 | println("$swordsJuggling 개의 칼로 저글링합니다!")
16 | }
17 |
18 | fun proficiencyCheck(swordsJuggling: Int?) {
19 | checkNotNull(swordsJuggling, { "플레이어가 저글링을 할 수 없음" })
20 | }
21 |
22 | class UnskilledSwordJugglerException() :
23 | IllegalStateException("플레이어가 저글링을 할 수 없음")
--------------------------------------------------------------------------------
/Ch11/NyetHack/src/SwordJuggler.kt:
--------------------------------------------------------------------------------
1 | fun main(args: Array) {
2 | var swordsJuggling: Int? = null
3 | val isJugglingProficient = (1..3).shuffled().last() == 3
4 | if (isJugglingProficient) {
5 | swordsJuggling = 2
6 | }
7 |
8 | try {
9 | proficiencyCheck(swordsJuggling)
10 | swordsJuggling = swordsJuggling!!.plus(1)
11 | } catch (e: Exception) {
12 | println(e)
13 | }
14 |
15 | println("$swordsJuggling 개의 칼로 저글링합니다!")
16 | }
17 |
18 | fun proficiencyCheck(swordsJuggling: Int?) {
19 | checkNotNull(swordsJuggling, { "플레이어가 저글링을 할 수 없음" })
20 | }
21 |
22 | class UnskilledSwordJugglerException() :
23 | IllegalStateException("플레이어가 저글링을 할 수 없음")
--------------------------------------------------------------------------------
/Ch21/Samodelkin/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Ch22/Samodelkin/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Ch05/Sandbox/src/SimVillage.kt:
--------------------------------------------------------------------------------
1 | fun main() {
2 | runSimulation()
3 | }
4 |
5 | fun runSimulation() {
6 | val greetingFunction = configureGreetingFunction()
7 | println(greetingFunction("김선달"))
8 | println(greetingFunction("김선달"))
9 | }
10 | fun configureGreetingFunction(): (String) -> String {
11 | val structureType = "병원"
12 | var numBuildings = 5
13 | return { playerName: String ->
14 | val currentYear = 2019
15 | numBuildings += 1
16 | println("$numBuildings 채의 $structureType 이 추가됨")
17 | "SimVillage 방문을 환영합니다, $playerName! (copyright $currentYear)"
18 | }
19 | }
20 |
21 | fun printConstructionCost(numBuildings: Int) {
22 | val cost = 500
23 | println("건축 비용: ${cost * numBuildings}")
24 | }
--------------------------------------------------------------------------------
/Ch17/Sandbox/src/SimVillage.kt:
--------------------------------------------------------------------------------
1 | fun main() {
2 | runSimulation()
3 | }
4 |
5 | fun runSimulation() {
6 | val greetingFunction = configureGreetingFunction()
7 | println(greetingFunction("김선달"))
8 | println(greetingFunction("김선달"))
9 | }
10 | fun configureGreetingFunction(): (String) -> String {
11 | val structureType = "병원"
12 | var numBuildings = 5
13 | return { playerName: String ->
14 | val currentYear = 2019
15 | numBuildings += 1
16 | println("$numBuildings 채의 $structureType 이 추가됨")
17 | "SimVillage 방문을 환영합니다, $playerName! (copyright $currentYear)"
18 | }
19 | }
20 |
21 | fun printConstructionCost(numBuildings: Int) {
22 | val cost = 500
23 | println("건축 비용: ${cost * numBuildings}")
24 | }
--------------------------------------------------------------------------------
/Ch18/Sandbox/src/SimVillage.kt:
--------------------------------------------------------------------------------
1 | fun main() {
2 | runSimulation()
3 | }
4 |
5 | fun runSimulation() {
6 | val greetingFunction = configureGreetingFunction()
7 | println(greetingFunction("김선달"))
8 | println(greetingFunction("김선달"))
9 | }
10 | fun configureGreetingFunction(): (String) -> String {
11 | val structureType = "병원"
12 | var numBuildings = 5
13 | return { playerName: String ->
14 | val currentYear = 2019
15 | numBuildings += 1
16 | println("$numBuildings 채의 $structureType 이 추가됨")
17 | "SimVillage 방문을 환영합니다, $playerName! (copyright $currentYear)"
18 | }
19 | }
20 |
21 | fun printConstructionCost(numBuildings: Int) {
22 | val cost = 500
23 | println("건축 비용: ${cost * numBuildings}")
24 | }
--------------------------------------------------------------------------------
/Ch16/NyetHack/src/com/bignerdranch/nyethack/Room.kt:
--------------------------------------------------------------------------------
1 | package com.bignerdranch.nyethack
2 |
3 | open class Room(val name: String) {
4 | protected open val dangerLevel = 5
5 | var monster: Monster? = Goblin()
6 |
7 | fun description() = "Room: $name\r\n" + // 맥 OS나 리눅스에서는 "Room: $name\n"
8 | "위험 수준: $dangerLevel\r\n" +
9 | "Creature: ${monster?.description ?: "none."}"
10 | open fun load() = "아무도 여기에 오지 않았습니다..."
11 | }
12 |
13 | class TownSquare : Room("Town Square") {
14 | override val dangerLevel = super.dangerLevel - 3
15 | private var bellSound = "댕댕"
16 |
17 | final override fun load() = "당신의 참여를 주민들이 다 함께 환영합니다!\r\n${ringBell()}"
18 |
19 | private fun ringBell() = "당신의 도착을 종탑에서 알립니다. $bellSound"
20 | }
--------------------------------------------------------------------------------
/Ch18/NyetHack/src/com/bignerdranch/nyethack/Room.kt:
--------------------------------------------------------------------------------
1 | package com.bignerdranch.nyethack
2 |
3 | open class Room(val name: String) {
4 | protected open val dangerLevel = 5
5 | var monster: Monster? = Goblin()
6 |
7 | fun description() = "Room: $name\r\n" + // 맥 OS나 리눅스에서는 "Room: $name\n"
8 | "위험 수준: $dangerLevel\r\n" +
9 | "Creature: ${monster?.description ?: "none."}"
10 | open fun load() = "아무도 여기에 오지 않았습니다..."
11 | }
12 |
13 | class TownSquare : Room("Town Square") {
14 | override val dangerLevel = super.dangerLevel - 3
15 | private var bellSound = "댕댕"
16 |
17 | final override fun load() = "당신의 참여를 주민들이 다 함께 환영합니다!\r\n${ringBell()}"
18 |
19 | private fun ringBell() = "당신의 도착을 종탑에서 알립니다. $bellSound"
20 | }
--------------------------------------------------------------------------------
/Ch12/NyetHack/src/com/bignerdranch/nyethack/SwordJuggler.kt:
--------------------------------------------------------------------------------
1 | package com.bignerdranch.nyethack
2 |
3 | fun main(args: Array) {
4 | var swordsJuggling: Int? = null
5 | val isJugglingProficient = (1..3).shuffled().last() == 3
6 | if (isJugglingProficient) {
7 | swordsJuggling = 2
8 | }
9 |
10 | try {
11 | proficiencyCheck(swordsJuggling)
12 | swordsJuggling = swordsJuggling!!.plus(1)
13 | } catch (e: Exception) {
14 | println(e)
15 | }
16 |
17 | println("$swordsJuggling 개의 칼로 저글링합니다!")
18 | }
19 |
20 | fun proficiencyCheck(swordsJuggling: Int?) {
21 | checkNotNull(swordsJuggling, { "플레이어가 저글링을 할 수 없음" })
22 | }
23 |
24 | class UnskilledSwordJugglerException() :
25 | IllegalStateException("플레이어가 저글링을 할 수 없음")
--------------------------------------------------------------------------------
/Ch13/NyetHack/src/com/bignerdranch/nyethack/SwordJuggler.kt:
--------------------------------------------------------------------------------
1 | package com.bignerdranch.nyethack
2 |
3 | fun main(args: Array) {
4 | var swordsJuggling: Int? = null
5 | val isJugglingProficient = (1..3).shuffled().last() == 3
6 | if (isJugglingProficient) {
7 | swordsJuggling = 2
8 | }
9 |
10 | try {
11 | proficiencyCheck(swordsJuggling)
12 | swordsJuggling = swordsJuggling!!.plus(1)
13 | } catch (e: Exception) {
14 | println(e)
15 | }
16 |
17 | println("$swordsJuggling 개의 칼로 저글링합니다!")
18 | }
19 |
20 | fun proficiencyCheck(swordsJuggling: Int?) {
21 | checkNotNull(swordsJuggling, { "플레이어가 저글링을 할 수 없음" })
22 | }
23 |
24 | class UnskilledSwordJugglerException() :
25 | IllegalStateException("플레이어가 저글링을 할 수 없음")
--------------------------------------------------------------------------------
/Ch14/NyetHack/src/com/bignerdranch/nyethack/SwordJuggler.kt:
--------------------------------------------------------------------------------
1 | package com.bignerdranch.nyethack
2 |
3 | fun main(args: Array) {
4 | var swordsJuggling: Int? = null
5 | val isJugglingProficient = (1..3).shuffled().last() == 3
6 | if (isJugglingProficient) {
7 | swordsJuggling = 2
8 | }
9 |
10 | try {
11 | proficiencyCheck(swordsJuggling)
12 | swordsJuggling = swordsJuggling!!.plus(1)
13 | } catch (e: Exception) {
14 | println(e)
15 | }
16 |
17 | println("$swordsJuggling 개의 칼로 저글링합니다!")
18 | }
19 |
20 | fun proficiencyCheck(swordsJuggling: Int?) {
21 | checkNotNull(swordsJuggling, { "플레이어가 저글링을 할 수 없음" })
22 | }
23 |
24 | class UnskilledSwordJugglerException() :
25 | IllegalStateException("플레이어가 저글링을 할 수 없음")
--------------------------------------------------------------------------------
/Ch15/NyetHack/src/com/bignerdranch/nyethack/SwordJuggler.kt:
--------------------------------------------------------------------------------
1 | package com.bignerdranch.nyethack
2 |
3 | fun main(args: Array) {
4 | var swordsJuggling: Int? = null
5 | val isJugglingProficient = (1..3).shuffled().last() == 3
6 | if (isJugglingProficient) {
7 | swordsJuggling = 2
8 | }
9 |
10 | try {
11 | proficiencyCheck(swordsJuggling)
12 | swordsJuggling = swordsJuggling!!.plus(1)
13 | } catch (e: Exception) {
14 | println(e)
15 | }
16 |
17 | println("$swordsJuggling 개의 칼로 저글링합니다!")
18 | }
19 |
20 | fun proficiencyCheck(swordsJuggling: Int?) {
21 | checkNotNull(swordsJuggling, { "플레이어가 저글링을 할 수 없음" })
22 | }
23 |
24 | class UnskilledSwordJugglerException() :
25 | IllegalStateException("플레이어가 저글링을 할 수 없음")
--------------------------------------------------------------------------------
/Ch16/NyetHack/src/com/bignerdranch/nyethack/SwordJuggler.kt:
--------------------------------------------------------------------------------
1 | package com.bignerdranch.nyethack
2 |
3 | fun main(args: Array) {
4 | var swordsJuggling: Int? = null
5 | val isJugglingProficient = (1..3).shuffled().last() == 3
6 | if (isJugglingProficient) {
7 | swordsJuggling = 2
8 | }
9 |
10 | try {
11 | proficiencyCheck(swordsJuggling)
12 | swordsJuggling = swordsJuggling!!.plus(1)
13 | } catch (e: Exception) {
14 | println(e)
15 | }
16 |
17 | println("$swordsJuggling 개의 칼로 저글링합니다!")
18 | }
19 |
20 | fun proficiencyCheck(swordsJuggling: Int?) {
21 | checkNotNull(swordsJuggling, { "플레이어가 저글링을 할 수 없음" })
22 | }
23 |
24 | class UnskilledSwordJugglerException() :
25 | IllegalStateException("플레이어가 저글링을 할 수 없음")
--------------------------------------------------------------------------------
/Ch18/NyetHack/src/com/bignerdranch/nyethack/SwordJuggler.kt:
--------------------------------------------------------------------------------
1 | package com.bignerdranch.nyethack
2 |
3 | fun main(args: Array) {
4 | var swordsJuggling: Int? = null
5 | val isJugglingProficient = (1..3).shuffled().last() == 3
6 | if (isJugglingProficient) {
7 | swordsJuggling = 2
8 | }
9 |
10 | try {
11 | proficiencyCheck(swordsJuggling)
12 | swordsJuggling = swordsJuggling!!.plus(1)
13 | } catch (e: Exception) {
14 | println(e)
15 | }
16 |
17 | println("$swordsJuggling 개의 칼로 저글링합니다!")
18 | }
19 |
20 | fun proficiencyCheck(swordsJuggling: Int?) {
21 | checkNotNull(swordsJuggling, { "플레이어가 저글링을 할 수 없음" })
22 | }
23 |
24 | class UnskilledSwordJugglerException() :
25 | IllegalStateException("플레이어가 저글링을 할 수 없음")
--------------------------------------------------------------------------------
/Ch21/Samodelkin/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | ext.kotlin_version = '1.3.21'
5 | repositories {
6 | google()
7 | jcenter()
8 |
9 | }
10 | dependencies {
11 | classpath 'com.android.tools.build:gradle:3.3.2'
12 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
13 | // NOTE: Do not place your application dependencies here; they belong
14 | // in the individual module build.gradle files
15 | }
16 | }
17 |
18 | allprojects {
19 | repositories {
20 | google()
21 | jcenter()
22 |
23 | }
24 | }
25 |
26 | task clean(type: Delete) {
27 | delete rootProject.buildDir
28 | }
29 |
--------------------------------------------------------------------------------
/Ch22/Samodelkin/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | ext.kotlin_version = '1.3.21'
5 | repositories {
6 | google()
7 | jcenter()
8 |
9 | }
10 | dependencies {
11 | classpath 'com.android.tools.build:gradle:3.3.2'
12 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
13 | // NOTE: Do not place your application dependencies here; they belong
14 | // in the individual module build.gradle files
15 | }
16 | }
17 |
18 | allprojects {
19 | repositories {
20 | google()
21 | jcenter()
22 |
23 | }
24 | }
25 |
26 | task clean(type: Delete) {
27 | delete rootProject.buildDir
28 | }
29 |
--------------------------------------------------------------------------------
/Ch03/NyetHack/src/Game.kt:
--------------------------------------------------------------------------------
1 | fun main() {
2 | val name = "마드리갈"
3 | var healthPoints = 89
4 | val isBlessed = true
5 | val isImmortal = false
6 |
7 | // 아우라
8 | val auraVisible = isBlessed && healthPoints > 50 || isImmortal
9 | val auraColor = if (auraVisible) "GREEN" else "NONE"
10 |
11 | val healthStatus = when (healthPoints) {
12 | 100 -> " 최상의 상태임!"
13 | in 90..99 -> "약간의 찰과상만 있음."
14 | in 75..89 -> if (isBlessed) {
15 | "경미한 상처가 있지만 빨리 치유되고 있음!"
16 | } else {
17 | "경미한 상처만 있음."
18 | }
19 | in 15..74 -> "많이 다친 것 같음."
20 | else -> "최악의 상태임!"
21 | }
22 |
23 | // 플레이어의 상태 출력
24 | println("(Aura: $auraColor) " +
25 | "(Blessed: ${if (isBlessed) "YES" else "NO"})")
26 | println("$name $healthStatus")
27 | }
--------------------------------------------------------------------------------
/Ch21/Samodelkin/app/src/androidTest/java/android/bignerdranch/com/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package android.bignerdranch.com
2 |
3 | import android.support.test.InstrumentationRegistry
4 | import android.support.test.runner.AndroidJUnit4
5 |
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | import org.junit.Assert.*
10 |
11 | /**
12 | * Instrumented test, which will execute on an Android device.
13 | *
14 | * See [testing documentation](http://d.android.com/tools/testing).
15 | */
16 | @RunWith(AndroidJUnit4::class)
17 | class ExampleInstrumentedTest {
18 | @Test
19 | fun useAppContext() {
20 | // Context of the app under test.
21 | val appContext = InstrumentationRegistry.getTargetContext()
22 | assertEquals("android.bignerdranch.com", appContext.packageName)
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Ch22/Samodelkin/app/src/androidTest/java/android/bignerdranch/com/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package android.bignerdranch.com
2 |
3 | import android.support.test.InstrumentationRegistry
4 | import android.support.test.runner.AndroidJUnit4
5 |
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | import org.junit.Assert.*
10 |
11 | /**
12 | * Instrumented test, which will execute on an Android device.
13 | *
14 | * See [testing documentation](http://d.android.com/tools/testing).
15 | */
16 | @RunWith(AndroidJUnit4::class)
17 | class ExampleInstrumentedTest {
18 | @Test
19 | fun useAppContext() {
20 | // Context of the app under test.
21 | val appContext = InstrumentationRegistry.getTargetContext()
22 | assertEquals("android.bignerdranch.com", appContext.packageName)
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Ch21/Samodelkin/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/Ch22/Samodelkin/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/Ch21/Samodelkin/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/Ch21/Samodelkin/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # Kotlin code style for this project: "official" or "obsolete":
15 | kotlin.code.style=official
16 |
--------------------------------------------------------------------------------
/Ch22/Samodelkin/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # Kotlin code style for this project: "official" or "obsolete":
15 | kotlin.code.style=official
16 |
--------------------------------------------------------------------------------
/Ch12/NyetHack/src/com/bignerdranch/nyethack/Game.kt:
--------------------------------------------------------------------------------
1 | package com.bignerdranch.nyethack
2 |
3 | fun main() {
4 | val player = Player()
5 | player.castFireball()
6 |
7 | // 플레이어의 상태 출력
8 | printPlayerStatus(player)
9 |
10 | performCombat()
11 | performCombat("Ulrich")
12 | performCombat("Hildr", true)
13 | }
14 |
15 | private fun printPlayerStatus(player: Player) {
16 | println(
17 | "(Aura: ${player.auraColor()}) " +
18 | "(Blessed: ${if (player.isBlessed) "YES" else "NO"})"
19 | )
20 | println("${player.name} ${player.formatHealthStatus()}")
21 | }
22 |
23 | fun performCombat() {
24 | println("적군이 없다!")
25 | }
26 | fun performCombat(enemyName: String) {
27 | println("$enemyName 과 전투를 시작함.")
28 | }
29 | fun performCombat(enemyName: String, isBlessed: Boolean) {
30 | if (isBlessed) {
31 | println("$enemyName 과 전투를 시작함. 축복을 받음!")
32 | } else {
33 | println("$enemyName 과 전투를 시작함.")
34 | }
35 | }
--------------------------------------------------------------------------------
/Ch13/NyetHack/src/com/bignerdranch/nyethack/Game.kt:
--------------------------------------------------------------------------------
1 | package com.bignerdranch.nyethack
2 |
3 | fun main() {
4 | val player = Player("Madrigal")
5 | player.castFireball()
6 |
7 | // 플레이어의 상태 출력
8 | printPlayerStatus(player)
9 |
10 | performCombat()
11 | performCombat("Ulrich")
12 | performCombat("Hildr", true)
13 | }
14 |
15 | private fun printPlayerStatus(player: Player) {
16 | println(
17 | "(Aura: ${player.auraColor()}) " +
18 | "(Blessed: ${if (player.isBlessed) "YES" else "NO"})"
19 | )
20 | println("${player.name} ${player.formatHealthStatus()}")
21 | }
22 |
23 | fun performCombat() {
24 | println("적군이 없다!")
25 | }
26 | fun performCombat(enemyName: String) {
27 | println("$enemyName 과 전투를 시작함.")
28 | }
29 | fun performCombat(enemyName: String, isBlessed: Boolean) {
30 | if (isBlessed) {
31 | println("$enemyName 과 전투를 시작함. 축복을 받음!")
32 | } else {
33 | println("$enemyName 과 전투를 시작함.")
34 | }
35 | }
--------------------------------------------------------------------------------
/Ch01/Sandbox/.idea/libraries/KotlinJavaRuntime.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Ch02/Sandbox/.idea/libraries/KotlinJavaRuntime.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Ch03/NyetHack/.idea/libraries/KotlinJavaRuntime.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Ch04/NyetHack/.idea/libraries/KotlinJavaRuntime.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Ch05/Sandbox/.idea/libraries/KotlinJavaRuntime.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Ch06/NyetHack/.idea/libraries/KotlinJavaRuntime.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Ch07/NyetHack/.idea/libraries/KotlinJavaRuntime.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Ch08/NyetHack/.idea/libraries/KotlinJavaRuntime.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Ch10/NyetHack/.idea/libraries/KotlinJavaRuntime.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Ch11/NyetHack/.idea/libraries/KotlinJavaRuntime.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Ch12/NyetHack/.idea/libraries/KotlinJavaRuntime.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Ch13/NyetHack/.idea/libraries/KotlinJavaRuntime.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Ch14/NyetHack/.idea/libraries/KotlinJavaRuntime.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Ch15/NyetHack/.idea/libraries/KotlinJavaRuntime.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Ch16/NyetHack/.idea/libraries/KotlinJavaRuntime.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Ch17/Sandbox/.idea/libraries/KotlinJavaRuntime.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Ch18/NyetHack/.idea/libraries/KotlinJavaRuntime.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Ch18/Sandbox/.idea/libraries/KotlinJavaRuntime.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Ch20/Interop/.idea/libraries/KotlinJavaRuntime.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Ch22/Samodelkin/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Ch16/NyetHack/src/com/bignerdranch/nyethack/Creature.kt:
--------------------------------------------------------------------------------
1 | package com.bignerdranch.nyethack
2 | import java.util.*
3 |
4 | interface Fightable {
5 | var healthPoints: Int
6 | val diceCount: Int
7 | val diceSides: Int
8 | val damageRoll: Int
9 | get() = (0 until diceCount).map {
10 | Random().nextInt(diceSides) + 1
11 | }.sum()
12 | fun attack(opponent: Fightable): Int
13 | }
14 |
15 | abstract class Monster(val name: String,
16 | val description: String,
17 | override var healthPoints: Int) : Fightable {
18 | override fun attack(opponent: Fightable): Int {
19 | val damageDealt = damageRoll
20 | opponent.healthPoints -= damageDealt
21 | return damageDealt
22 | }
23 | }
24 |
25 | class Goblin(name: String = "Goblin",
26 | description: String = "추하게 생긴 고블린",
27 | healthPoints: Int = 30) : Monster(name, description, healthPoints) {
28 | override val diceCount = 2
29 | override val diceSides = 8
30 | }
--------------------------------------------------------------------------------
/Ch18/NyetHack/src/com/bignerdranch/nyethack/Creature.kt:
--------------------------------------------------------------------------------
1 | package com.bignerdranch.nyethack
2 | import java.util.*
3 |
4 | interface Fightable {
5 | var healthPoints: Int
6 | val diceCount: Int
7 | val diceSides: Int
8 | val damageRoll: Int
9 | get() = (0 until diceCount).map {
10 | Random().nextInt(diceSides) + 1
11 | }.sum()
12 | fun attack(opponent: Fightable): Int
13 | }
14 |
15 | abstract class Monster(val name: String,
16 | val description: String,
17 | override var healthPoints: Int) : Fightable {
18 | override fun attack(opponent: Fightable): Int {
19 | val damageDealt = damageRoll
20 | opponent.healthPoints -= damageDealt
21 | return damageDealt
22 | }
23 | }
24 |
25 | class Goblin(name: String = "Goblin",
26 | description: String = "추하게 생긴 고블린",
27 | healthPoints: Int = 30) : Monster(name, description, healthPoints) {
28 | override val diceCount = 2
29 | override val diceSides = 8
30 | }
--------------------------------------------------------------------------------
/Ch07/NyetHack/src/Tavern.kt:
--------------------------------------------------------------------------------
1 | const val TAVERN_NAME = "Taernyl's Folly"
2 |
3 | fun main() {
4 | // placeOrder("shandy,Dragon's Breath,5.91")
5 | placeOrder("elixir,Shirley's Temple,4.12")
6 | }
7 |
8 | private fun toDragonSpeak(phrase: String) =
9 | phrase.replace(Regex("[aeiou]")) {
10 | when (it.value) {
11 | "a" -> "4"
12 | "e" -> "3"
13 | "i" -> "1"
14 | "o" -> "0"
15 | "u" -> "|_|"
16 | else -> it.value
17 | }
18 | }
19 |
20 | private fun placeOrder(menuData: String) {
21 | val indexOfApostrophe = TAVERN_NAME.indexOf('\'')
22 | val tavernMaster = TAVERN_NAME.substring(0 until indexOfApostrophe)
23 | println("마드리갈은 $tavernMaster 에게 주문한다.")
24 |
25 | val (type, name, price) = menuData.split(',')
26 | val message = "마드리갈은 금화 $price 로 $name ($type)를 구입한다."
27 | println(message)
28 |
29 | val phrase = if (name == "Dragon's Breath") {
30 | "마드리갈이 감탄한다: ${toDragonSpeak("와, $name 진짜 좋구나!")}"
31 | } else {
32 | "마드리갈이 말한다: 감사합니다 $name."
33 | }
34 | println(phrase)
35 | }
--------------------------------------------------------------------------------
/Ch12/NyetHack/src/com/bignerdranch/nyethack/Player.kt:
--------------------------------------------------------------------------------
1 | package com.bignerdranch.nyethack
2 |
3 | class Player {
4 | var name = "madrigal"
5 | get() = field.capitalize()
6 | private set(value) {
7 | field = value.trim()
8 | }
9 |
10 | var healthPoints = 89
11 | val isBlessed = true
12 | private val isImmortal = false
13 |
14 | fun auraColor(): String {
15 | val auraVisible = isBlessed && healthPoints > 50 || isImmortal
16 | val auraColor = if (auraVisible) "GREEN" else "NONE"
17 | return auraColor
18 | }
19 |
20 | fun formatHealthStatus() =
21 | when (healthPoints) {
22 | 100 -> " 최상의 상태임!"
23 | in 90..99 -> "약간의 찰과상만 있음."
24 | in 75..89 -> if (isBlessed) {
25 | "경미한 상처가 있지만 빨리 치유되고 있음!"
26 | } else {
27 | "경미한 상처만 있음."
28 | }
29 | in 15..74 -> "많이 다친 것 같음."
30 | else -> "최악의 상태임!"
31 | }
32 |
33 | fun castFireball(numFireballs: Int = 2) =
34 | println("한 덩어리의 파이어볼이 나타난다. (x$numFireballs)")
35 | }
--------------------------------------------------------------------------------
/Ch14/NyetHack/src/com/bignerdranch/nyethack/Game.kt:
--------------------------------------------------------------------------------
1 | package com.bignerdranch.nyethack
2 |
3 | fun main() {
4 | val player = Player("Madrigal")
5 | player.castFireball()
6 |
7 | var currentRoom = TownSquare()
8 | println(currentRoom.description())
9 | println(currentRoom.load())
10 |
11 | // 플레이어의 상태 출력
12 | printPlayerStatus(player)
13 |
14 | performCombat()
15 | performCombat("Ulrich")
16 | performCombat("Hildr", true)
17 | }
18 |
19 | private fun printPlayerStatus(player: Player) {
20 | println(
21 | "(Aura: ${player.auraColor()}) " +
22 | "(Blessed: ${if (player.isBlessed) "YES" else "NO"})"
23 | )
24 | println("${player.name} ${player.formatHealthStatus()}")
25 | }
26 |
27 | fun performCombat() {
28 | println("적군이 없다!")
29 | }
30 | fun performCombat(enemyName: String) {
31 | println("$enemyName 과 전투를 시작함.")
32 | }
33 | fun performCombat(enemyName: String, isBlessed: Boolean) {
34 | if (isBlessed) {
35 | println("$enemyName 과 전투를 시작함. 축복을 받음!")
36 | } else {
37 | println("$enemyName 과 전투를 시작함.")
38 | }
39 | }
--------------------------------------------------------------------------------
/Ch21/Samodelkin/app/src/main/java/android/bignerdranch/com/CharacterGenerator.kt:
--------------------------------------------------------------------------------
1 | package android.bignerdranch.com
2 | import java.io.Serializable
3 |
4 | private fun List.rand() = shuffled().first()
5 | private fun Int.roll() = (0 until this)
6 | .map { (1..6).toList().rand() }
7 | .sum()
8 | .toString()
9 | private val firstName = listOf("Eli", "Alex", "Sophie")
10 | private val lastName = listOf("Lightweaver", "Greatfoot", "Oakenfeld")
11 | object CharacterGenerator {
12 | data class CharacterData(val name: String,
13 | val race: String,
14 | val dex: String,
15 | val wis: String,
16 | val str: String) : Serializable
17 | private fun name() = "${firstName.rand()} ${lastName.rand()}"
18 | private fun race() = listOf("dwarf", "elf", "human", "halfling").rand()
19 | private fun dex() = 4.roll()
20 | private fun wis() = 3.roll()
21 | private fun str() = 5.roll()
22 | fun generate() = CharacterData(name = name(),
23 | race = race(),
24 | dex = dex(),
25 | wis = wis(),
26 | str = str())
27 | }
--------------------------------------------------------------------------------
/Ch17/Sandbox/src/Generics.kt:
--------------------------------------------------------------------------------
1 | class LootBox(vararg item: T) {
2 | var open = false
3 | private var loot: Array = item
4 |
5 | operator fun get(index: Int): T? = loot[index].takeIf { open }
6 |
7 | fun fetch(item: Int): T? {
8 | return loot[item].takeIf { open }
9 | }
10 |
11 | fun fetch(item: Int, lootModFunction: (T) -> R): R? {
12 | return lootModFunction(loot[item]).takeIf { open }
13 | }
14 | }
15 |
16 | open class Loot(val value: Int)
17 |
18 | class Fedora(val name: String, value: Int) : Loot(value)
19 |
20 | class Coin(value: Int) : Loot(value)
21 |
22 | fun main(args: Array) {
23 | val lootBoxOne: LootBox = LootBox(Fedora("평범한 중절모", 15), // 제일 끝에 쉼표 추가
24 | Fedora("눈부신 자주색 중절모", 25))
25 | val lootBoxTwo: LootBox = LootBox(Coin(15))
26 |
27 | lootBoxOne.open = true
28 |
29 | lootBoxOne.fetch(1)?.run {
30 | println("$name 를 LootBox에서 꺼냈습니다!")
31 | }
32 |
33 | val coin = lootBoxOne.fetch(0) {
34 | Coin(it.value * 3)
35 | }
36 | coin?.let { println(it.value) }
37 |
38 | val fedora = lootBoxOne[1]
39 | fedora?.let { println(it.name) }
40 | }
--------------------------------------------------------------------------------
/Ch18/Sandbox/src/Generics.kt:
--------------------------------------------------------------------------------
1 | class LootBox(vararg item: T) {
2 | var open = false
3 | private var loot: Array = item
4 |
5 | operator fun get(index: Int): T? = loot[index].takeIf { open }
6 |
7 | fun fetch(item: Int): T? {
8 | return loot[item].takeIf { open }
9 | }
10 |
11 | fun fetch(item: Int, lootModFunction: (T) -> R): R? {
12 | return lootModFunction(loot[item]).takeIf { open }
13 | }
14 | }
15 |
16 | open class Loot(val value: Int)
17 |
18 | class Fedora(val name: String, value: Int) : Loot(value)
19 |
20 | class Coin(value: Int) : Loot(value)
21 |
22 | fun main(args: Array) {
23 | val lootBoxOne: LootBox = LootBox(Fedora("평범한 중절모", 15), // 제일 끝에 쉼표 추가
24 | Fedora("눈부신 자주색 중절모", 25))
25 | val lootBoxTwo: LootBox = LootBox(Coin(15))
26 |
27 | lootBoxOne.open = true
28 |
29 | lootBoxOne.fetch(1)?.run {
30 | println("$name 를 LootBox에서 꺼냈습니다!")
31 | }
32 |
33 | val coin = lootBoxOne.fetch(0) {
34 | Coin(it.value * 3)
35 | }
36 | coin?.let { println(it.value) }
37 |
38 | val fedora = lootBoxOne[1]
39 | fedora?.let { println(it.name) }
40 | }
--------------------------------------------------------------------------------
/Ch21/Samodelkin/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | apply plugin: 'kotlin-android'
4 |
5 | apply plugin: 'kotlin-android-extensions'
6 |
7 | android {
8 | compileSdkVersion 28
9 | defaultConfig {
10 | applicationId "android.bignerdranch.com"
11 | minSdkVersion 27
12 | targetSdkVersion 28
13 | versionCode 1
14 | versionName "1.0"
15 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
16 | }
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | implementation fileTree(dir: 'libs', include: ['*.jar'])
27 | implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
28 | implementation 'com.android.support:appcompat-v7:28.0.0'
29 | implementation 'com.android.support.constraint:constraint-layout:1.1.3'
30 | testImplementation 'junit:junit:4.12'
31 | androidTestImplementation 'com.android.support.test:runner:1.0.2'
32 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
33 | }
34 |
--------------------------------------------------------------------------------
/Ch22/Samodelkin/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | apply plugin: 'kotlin-android'
4 |
5 | apply plugin: 'kotlin-android-extensions'
6 |
7 | android {
8 | compileSdkVersion 28
9 | defaultConfig {
10 | applicationId "android.bignerdranch.com"
11 | minSdkVersion 27
12 | targetSdkVersion 28
13 | versionCode 1
14 | versionName "1.0"
15 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
16 | }
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | implementation fileTree(dir: 'libs', include: ['*.jar'])
27 | implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
28 | implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.1"
29 | implementation 'com.android.support:appcompat-v7:28.0.0'
30 | implementation 'com.android.support.constraint:constraint-layout:1.1.3'
31 | testImplementation 'junit:junit:4.12'
32 | androidTestImplementation 'com.android.support.test:runner:1.0.2'
33 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
34 | }
35 |
--------------------------------------------------------------------------------
/Ch20/Interop/src/Hero.kt:
--------------------------------------------------------------------------------
1 | @file:JvmName("Hero")
2 | import java.io.IOException
3 |
4 | fun main(args: Array) {
5 | val adversary = Jhava()
6 | println(adversary.utterGreeting())
7 |
8 | val friendshipLevel = adversary.determineFriendshipLevel()
9 | println(friendshipLevel?.toLowerCase()?: "무슨 의미인지 난해하군요.")
10 |
11 | val adversaryHitPoints: Int = adversary.hitPoints
12 | println(adversaryHitPoints.dec())
13 | println(adversaryHitPoints.javaClass)
14 |
15 | adversary.greeting = "안녕하세요, 용사시여."
16 | println(adversary.utterGreeting())
17 |
18 | adversary.offerFood()
19 |
20 | try {
21 | adversary.extendHandInFriendship()
22 | } catch (e: Exception) {
23 | println("잘가라, 못된 괴물아!")
24 | }
25 | }
26 |
27 | val translator = { utterance: String ->
28 | println(utterance.toLowerCase().capitalize())
29 | }
30 |
31 | fun makeProclamation() = "안녕, 괴물아!"
32 |
33 | @JvmOverloads
34 | fun handOverFood(leftHand: String = "딸기", rightHand: String = "고기") {
35 | println("맛있는 $leftHand 와 $rightHand 를 넘겨주었습니다.")
36 | }
37 |
38 | @Throws(IOException::class)
39 | fun acceptApology() {
40 | throw IOException()
41 | }
42 |
43 | class Spellbook {
44 | @JvmField
45 | val spells = listOf("Magic Ms. L", "Lay on Hans")
46 |
47 | companion object {
48 | @JvmField
49 | val MAX_SPELL_COUNT = 10
50 |
51 | @JvmStatic
52 | fun getSpellbookGreeting() = println("나는 위대한 그리모어다!")
53 | }
54 | }
--------------------------------------------------------------------------------
/Ch21/Samodelkin/app/src/main/java/android/bignerdranch/com/NewCharacterActivity.kt:
--------------------------------------------------------------------------------
1 | package android.bignerdranch.com
2 |
3 | import android.support.v7.app.AppCompatActivity
4 | import android.os.Bundle
5 | import android.widget.Button
6 | import android.widget.TextView
7 | import kotlinx.android.synthetic.main.activity_new_character.*
8 |
9 | private const val CHARACTER_DATA_KEY = "CHARACTER_DATA_KEY"
10 |
11 | private var Bundle.characterData
12 | get() = getSerializable(CHARACTER_DATA_KEY) as CharacterGenerator.CharacterData
13 | set(value) = putSerializable(CHARACTER_DATA_KEY, value)
14 |
15 | class NewCharacterActivity : AppCompatActivity() {
16 | private var characterData = CharacterGenerator.generate()
17 |
18 | override fun onSaveInstanceState(outState: Bundle) {
19 | super.onSaveInstanceState(outState)
20 | outState.characterData = characterData // 이때 확장 속성의 set(characterData)가 실행된다.
21 | }
22 |
23 | override fun onCreate(savedInstanceState: Bundle?) {
24 | super.onCreate(savedInstanceState)
25 | setContentView(R.layout.activity_new_character)
26 |
27 | characterData = savedInstanceState?.characterData ?: // 이때 확장 속성의 get()이 실행된다.
28 | CharacterGenerator.generate()
29 |
30 | generateButton.setOnClickListener {
31 | characterData = CharacterGenerator.generate()
32 | displayCharacterData()
33 | }
34 |
35 | displayCharacterData()
36 | }
37 |
38 | private fun displayCharacterData() {
39 | characterData.run {
40 | nameTextView.text = name
41 | raceTextView.text = race
42 | dexterityTextView.text = dex
43 | wisdomTextView.text = wis
44 | strengthTextView.text = str
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/Ch13/NyetHack/src/com/bignerdranch/nyethack/Player.kt:
--------------------------------------------------------------------------------
1 | package com.bignerdranch.nyethack
2 | import java.io.File
3 |
4 | class Player(_name: String,
5 | var healthPoints: Int = 100,
6 | val
7 | isBlessed: Boolean,
8 | private val isImmortal: Boolean) {
9 | var name = _name
10 | get() = "${field.capitalize()} of $hometown"
11 | private set(value) {
12 | field = value.trim()
13 | }
14 |
15 | val hometown by lazy { selectHometown() }
16 |
17 | init {
18 | require(healthPoints > 0, { "healthPoints는 0보다 커야 합니다." })
19 | require(name.isNotBlank(), { "플레이어는 이름이 있어야 합니다." })
20 | }
21 |
22 | constructor(name: String) : this(name,
23 | isBlessed = true,
24 | isImmortal = false) {
25 | if (name.toLowerCase() == "kar") healthPoints = 40
26 | }
27 |
28 | fun auraColor(): String {
29 | val auraVisible = isBlessed && healthPoints > 50 || isImmortal
30 | val auraColor = if (auraVisible) "GREEN" else "NONE"
31 | return auraColor
32 | }
33 |
34 | fun formatHealthStatus() =
35 | when (healthPoints) {
36 | 100 -> " 최상의 상태임!"
37 | in 90..99 -> "약간의 찰과상만 있음."
38 | in 75..89 -> if (isBlessed) {
39 | "경미한 상처가 있지만 빨리 치유되고 있음!"
40 | } else {
41 | "경미한 상처만 있음."
42 | }
43 | in 15..74 -> "많이 다친 것 같음."
44 | else -> "최악의 상태임!"
45 | }
46 |
47 | fun castFireball(numFireballs: Int = 2) =
48 | println("한 덩어리의 파이어볼이 나타난다. (x$numFireballs)")
49 |
50 | private fun selectHometown() = File("data/towns.txt")
51 | .readText()
52 | .split("\r\n") // 맥 OS나 리눅스에서는 .split("\n")
53 | .shuffled()
54 | .first()
55 | }
--------------------------------------------------------------------------------
/Ch14/NyetHack/src/com/bignerdranch/nyethack/Player.kt:
--------------------------------------------------------------------------------
1 | package com.bignerdranch.nyethack
2 | import java.io.File
3 |
4 | class Player(_name: String,
5 | var healthPoints: Int = 100,
6 | val
7 | isBlessed: Boolean,
8 | private val isImmortal: Boolean) {
9 | var name = _name
10 | get() = "${field.capitalize()} of $hometown"
11 | private set(value) {
12 | field = value.trim()
13 | }
14 |
15 | val hometown by lazy { selectHometown() }
16 |
17 | init {
18 | require(healthPoints > 0, { "healthPoints는 0보다 커야 합니다." })
19 | require(name.isNotBlank(), { "플레이어는 이름이 있어야 합니다." })
20 | }
21 |
22 | constructor(name: String) : this(name,
23 | isBlessed = true,
24 | isImmortal = false) {
25 | if (name.toLowerCase() == "kar") healthPoints = 40
26 | }
27 |
28 | fun auraColor(): String {
29 | val auraVisible = isBlessed && healthPoints > 50 || isImmortal
30 | val auraColor = if (auraVisible) "GREEN" else "NONE"
31 | return auraColor
32 | }
33 |
34 | fun formatHealthStatus() =
35 | when (healthPoints) {
36 | 100 -> " 최상의 상태임!"
37 | in 90..99 -> "약간의 찰과상만 있음."
38 | in 75..89 -> if (isBlessed) {
39 | "경미한 상처가 있지만 빨리 치유되고 있음!"
40 | } else {
41 | "경미한 상처만 있음."
42 | }
43 | in 15..74 -> "많이 다친 것 같음."
44 | else -> "최악의 상태임!"
45 | }
46 |
47 | fun castFireball(numFireballs: Int = 2) =
48 | println("한 덩어리의 파이어볼이 나타난다. (x$numFireballs)")
49 |
50 | private fun selectHometown() = File("data/towns.txt")
51 | .readText()
52 | .split("\r\n") // 맥 OS나 리눅스에서는 .split("\n")
53 | .shuffled()
54 | .first()
55 | }
--------------------------------------------------------------------------------
/Ch20/Interop/src/Jhava.java:
--------------------------------------------------------------------------------
1 | import kotlin.Unit;
2 | import kotlin.jvm.functions.Function1;
3 | import org.jetbrains.annotations.Nullable;
4 | import org.jetbrains.annotations.NotNull;
5 | import java.io.IOException;
6 |
7 | public class Jhava {
8 | private int hitPoints = 52489112;
9 | private String greeting = "BLARGH";
10 |
11 | @NotNull
12 | public String utterGreeting() {
13 | return greeting;
14 | }
15 |
16 | @Nullable
17 | public String determineFriendshipLevel() {
18 | return null;
19 | }
20 |
21 | public int getHitPoints() {
22 | return hitPoints;
23 | }
24 |
25 | public String getGreeting() {
26 | return greeting;
27 | }
28 |
29 | public void setGreeting(String greeting) {
30 | this.greeting = greeting;
31 | }
32 |
33 | public void offerFood() {
34 | Hero.handOverFood("피자");
35 | }
36 |
37 | public void extendHandInFriendship() throws Exception {
38 | throw new Exception();
39 | }
40 |
41 | public static void main(String[] args) {
42 | System.out.println(Hero.makeProclamation());
43 |
44 | System.out.println("Spells:");
45 | Spellbook spellbook = new Spellbook();
46 | for (String spell : spellbook.spells) {
47 | System.out.println(spell);
48 | }
49 | System.out.println("Max spell count: " + Spellbook.MAX_SPELL_COUNT);
50 |
51 | Spellbook.getSpellbookGreeting();
52 |
53 | Function1 translatorJ = Hero.getTranslator();
54 | translatorJ.invoke("TRUCE");
55 | }
56 |
57 | public void apologize() {
58 | try {
59 | Hero.acceptApology();
60 | } catch (IOException e) {
61 | System.out.println("Caught!");
62 | }
63 | }
64 | }
65 |
66 |
67 |
--------------------------------------------------------------------------------
/Ch22/Samodelkin/app/src/main/java/android/bignerdranch/com/CharacterGenerator.kt:
--------------------------------------------------------------------------------
1 | package android.bignerdranch.com
2 |
3 | import kotlinx.coroutines.Deferred
4 | import kotlinx.coroutines.GlobalScope
5 | import kotlinx.coroutines.async
6 |
7 | import java.io.Serializable
8 | import java.net.URL
9 |
10 | private const val CHARACTER_DATA_API = "https://chargen-api.herokuapp.com/"
11 |
12 | private fun List.rand() = shuffled().first()
13 | private fun Int.roll() = (0 until this)
14 | .map { (1..6).toList().rand() }
15 | .sum()
16 | .toString()
17 | private val firstName = listOf("Eli", "Alex", "Sophie")
18 | private val lastName = listOf("Lightweaver", "Greatfoot", "Oakenfeld")
19 | object CharacterGenerator {
20 | data class CharacterData(val name: String,
21 | val race: String,
22 | val dex: String,
23 | val wis: String,
24 | val str: String) : Serializable
25 | private fun name() = "${firstName.rand()} ${lastName.rand()}"
26 | private fun race() = listOf("dwarf", "elf", "human", "halfling").rand()
27 | private fun dex() = 4.roll()
28 | private fun wis() = 3.roll()
29 | private fun str() = 5.roll()
30 | fun generate() = CharacterData(name = name(),
31 | race = race(),
32 | dex = dex(),
33 | wis = wis(),
34 | str = str())
35 |
36 | fun fromApiData(apiData: String): CharacterData {
37 | val (race, name, dex, wis, str) =
38 | apiData.split(",")
39 | return CharacterData(name, race, dex, wis, str)
40 | }
41 | }
42 |
43 | fun fetchCharacterData(): Deferred {
44 | return GlobalScope.async {
45 | val apiData = URL(CHARACTER_DATA_API).readText()
46 | CharacterGenerator.fromApiData(apiData)
47 | }
48 | }
--------------------------------------------------------------------------------
/Ch15/NyetHack/src/com/bignerdranch/nyethack/Player.kt:
--------------------------------------------------------------------------------
1 | package com.bignerdranch.nyethack
2 | import java.io.File
3 |
4 | class Player(_name: String,
5 | var healthPoints: Int = 100,
6 | val
7 | isBlessed: Boolean,
8 | private val isImmortal: Boolean) {
9 | var name = _name
10 | get() = "${field.capitalize()} of $hometown"
11 | private set(value) {
12 | field = value.trim()
13 | }
14 |
15 | val hometown by lazy { selectHometown() }
16 | var currentPosition = Coordinate(0, 0)
17 |
18 | init {
19 | require(healthPoints > 0, { "healthPoints는 0보다 커야 합니다." })
20 | require(name.isNotBlank(), { "플레이어는 이름이 있어야 합니다." })
21 | }
22 |
23 | constructor(name: String) : this(name,
24 | isBlessed = true,
25 | isImmortal = false) {
26 | if (name.toLowerCase() == "kar") healthPoints = 40
27 | }
28 |
29 | fun auraColor(): String {
30 | val auraVisible = isBlessed && healthPoints > 50 || isImmortal
31 | val auraColor = if (auraVisible) "GREEN" else "NONE"
32 | return auraColor
33 | }
34 |
35 | fun formatHealthStatus() =
36 | when (healthPoints) {
37 | 100 -> " 최상의 상태임!"
38 | in 90..99 -> "약간의 찰과상만 있음."
39 | in 75..89 -> if (isBlessed) {
40 | "경미한 상처가 있지만 빨리 치유되고 있음!"
41 | } else {
42 | "경미한 상처만 있음."
43 | }
44 | in 15..74 -> "많이 다친 것 같음."
45 | else -> "최악의 상태임!"
46 | }
47 |
48 | fun castFireball(numFireballs: Int = 2) =
49 | println("한 덩어리의 파이어볼이 나타난다. (x$numFireballs)")
50 |
51 | private fun selectHometown() = File("data/towns.txt")
52 | .readText()
53 | .split("\r\n") // 맥 OS나 리눅스에서는 .split("\n")
54 | .shuffled()
55 | .first()
56 | }
--------------------------------------------------------------------------------
/Ch08/NyetHack/src/Tavern.kt:
--------------------------------------------------------------------------------
1 | import kotlin.math.roundToInt
2 |
3 | const val TAVERN_NAME = "Taernyl's Folly"
4 |
5 | var playerGold = 10
6 | var playerSilver = 10
7 |
8 | fun main() {
9 | placeOrder("shandy,Dragon's Breath,5.91")
10 | }
11 |
12 | fun performPurchase(price: Double) {
13 | displayBalance()
14 | val totalPurse = playerGold + (playerSilver / 100.0)
15 | println("지갑 전체 금액: 금화 $totalPurse")
16 | println("금화 $price 로 술을 구입함")
17 | val remainingBalance = totalPurse - price
18 | println("남은 잔액: ${"%.2f".format(remainingBalance)}")
19 |
20 | val remainingGold = remainingBalance.toInt()
21 | val remainingSilver = (remainingBalance % 1 * 100).roundToInt()
22 | playerGold = remainingGold
23 | playerSilver = remainingSilver
24 | displayBalance()
25 | }
26 | private fun displayBalance() {
27 | println("플레이어의 지갑 잔액: 금화: $playerGold 개, 은화: $playerSilver 개")
28 | }
29 |
30 | private fun toDragonSpeak(phrase: String) =
31 | phrase.replace(Regex("[aeiou]")) {
32 | when (it.value) {
33 | "a" -> "4"
34 | "e" -> "3"
35 | "i" -> "1"
36 | "o" -> "0"
37 | "u" -> "|_|"
38 | else -> it.value
39 | }
40 | }
41 |
42 | private fun placeOrder(menuData: String) {
43 | val indexOfApostrophe = TAVERN_NAME.indexOf('\'')
44 | val tavernMaster = TAVERN_NAME.substring(0 until indexOfApostrophe)
45 | println("마드리갈은 $tavernMaster 에게 주문한다.")
46 |
47 | val (type, name, price) = menuData.split(',')
48 | val message = "마드리갈은 금화 $price 로 $name ($type)를 구입한다."
49 | println(message)
50 |
51 | performPurchase(price.toDouble())
52 |
53 | val phrase = if (name == "Dragon's Breath") {
54 | "마드리갈이 감탄한다: ${toDragonSpeak("와, $name 진짜 좋구나!")}"
55 | } else {
56 | "마드리갈이 말한다: 감사합니다 $name."
57 | }
58 | println(phrase)
59 | }
--------------------------------------------------------------------------------