You are currently viewing Looking for an extra par of eyes that can help me solve this.

Looking for an extra par of eyes that can help me solve this.

Hello everyone, I start reading a book in Kotlin by “Big Nerd Ranch” and I need some help here. Challenges are great since they make you think outside of the box, search and read documentation and explore outside of the book which at the end of the day curiosity is what make us grow.
So far I am at chapter 3, and I have covered variables, constants, some data types, conditionals nested if else, when, ranges and String templates. So far everything looks good but in the last challenge I have hit a wall, here is why…
Question asked:
…”For this more difficult challenge, make the status line configurable with a status format string. Use the character B for blessed, A for aura color, H for healthStatus, and HP for healthPoints. For example, a status format string of:

val statusFormatString = “(HP)(A) -> H”

should generate a player status display like:

(HP: 100)(Aura: Green) -> Madrigal is in excellent condition!”

Def From the book: string template

Syntax that allows a variable name to stand in for its value in a string.
ie :
println(name + ” ” + lastName)

println(“$name $lastName”)

by adding the symbol $ next to our variable/constant encapsulated in the quotation our values will be displayed. In addition, any expression encapsulated in the following (${}) will be evaluated as a part of the string.

The point is that im lost and I can’t find a way to solve this challenge…

I appreciate the help 🙂

submitted by /u/AustralopiTech
[link] [comments]