3 Conditionals

In this chapter, you will learn how to define rules for when code should be executed. This language feature is called control flow, and it allows you to describe the conditions for when specific portions of your program should run. You will see the if/else statement and expression and the when expression, and you will learn how to write true/false tests using the comparison and logical operators.

To see these features in action, you will continue working in the bounty-board project, creating the quests that will be presented to the player. The quests will scale in difficulty as the player gets stronger, which is where conditionals will come into play.

Get Kotlin Programming: The Big Nerd Ranch Guide, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.