Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialTim Seme
1,664 PointstotalScore = ++initialScore
it won't let me through even though I'm doing as i was taught
// Enter your code below
var initialScore = 8
initialScore = initialScore + 1
let totalScore = initialScore
totalScore = ++initialScore
3 Answers
Ronnie Stanley
4,842 Pointsif you run your code in an xcode playground the compiler will help you with the fix. the constant totalScore needs to be a variable
var initialScore = 8
initialScore = initialScore + 1
var totalScore = initialScore
totalScore = ++initialScore
Tim Seme
1,664 Pointsok i know that and this way it works in Xcode but its telling me to make totalScore a constant and then change it, even though constant can't be changed
Ronnie Stanley
4,842 PointsSorry, here is the answer you're looking for
var initialScore = 8
let totalScore = ++initialScore