O'Reilly logo

Kotlin Programming: The Big Nerd Ranch Guide, First Edition by David Greenhalgh, Josh Skeen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Refactoring NyetHack

You have learned about class functions, properties, and encapsulation, and you have done some of the work to apply these concepts to NyetHack. It is time to finish the job and thoroughly clean up NyetHack’s code.

You will be moving chunks of code from one file to another. It helps to see the two files side by side. Fortunately, IntelliJ provides this feature.

With Game.kt open, right-click on the Player.kt tab at the top of the editor and select Split Vertically (Figure 12.3).

Figure 12.3  Splitting the editor vertically

Splitting the editor vertically

You now have another editor pane to work in (Figure 12.4). (You can drag tabs between ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required