Challenge: hasSteed
In Chapter 1, your challenge was to try out some mathematical operations in the Kotlin REPL. Most of the challenges in the rest of the book are based on the project you have been working on – in this case, bounty-board. Before beginning a challenge, make a copy of your project and attack the challenge in that copy. Many chapters build on previous chapters, and working on challenges in a copy of the project ensures that you will be able to progress through the book.
Here is your first challenge based on bounty-board: In the text adventure game, players can acquire a dragon or minotaur to ride. Define a variable called hasSteed to track whether the player has acquired one. Give the variable an initial state indicating ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access