Why my code is the same as tutorials but can't run?

I didn’t look at the tutorial, but it may not set title as LET. Look back and see if it should be VAR.

1 Like

Try it with your opening and closing braces on different lines.

 let title:String
    
    if difference == 0 {
        title = "Bull's Eye!"
        points += 100
    } else if difference < 5 {
        title = "So close!"
        
        if difference == 1 {
            points += 50
        }
    } else if difference < 10 {
        title = "You almost had it"
    } else if difference < 15 {
        title = "Pretty good"
    } else {
        title = "Not very close"
    }