Get immediate access to this and over 1,500+ other videos and books.

Boost your skills with a Beginner subscription. With over 60+ video courses and our core foundational programming books bundled in one subscription, it’s simply the best investment you can make in your development career.

Improve the Alert Title

This video was last updated on Jul 14 2022

Use conditional statements to display different messages on the alert dialog based on the player’s performance.


Heads up... You've reached locked video content where the transcript will be shown as obfuscated text.

You can unlock the rest of this video course, and our entire catalogue of books and videos, with a Professional subscription.

Okay, this is not a challenge episode. I didn’t mean what I said earlier.

private fun alertTitle(): String {
val difference = abs(targetValue - sliderValue)
val title: String = if (difference == 0) {
} else if (difference < 5) {
} else if (difference <= 10) {
} else {
return title
val dialogTitle = alertTitle()
private fun differenceAmount() = abs(targetValue - sliderValue)