3rd edition Solutions file

The file containing the code from the book can be found here:

https://bignerdranch.com/solutions/SwiftProgramming3ed.zip

Jon, I was unable to find or was not authorized to access that zip file. I sure would appreciate the finished code for challenges in The Swift Programming book. Specifically I cannot get the printed code for Chapter 6 Loops entitled Space Shooter game to work correctly.

I tried the link just now & it still worked for me. And anyway, the file doesn’t include code for the Challenges, you’re expected to figure those out yourself. It only includes the code printed in the book.

Here’s the Chapter 6 code:

// Playground - noun: a place where people can play

import Cocoa

var myFirstInt = 0
for _ in 1...5 {
    myFirstInt += 1
    print(myFirstInt)
}

for i in 1...100 where i % 3 == 0 {
    print(i)
}

var i = 1
while i < 6 {
    myFirstInt += 1
    print(myFirstInt)
    i += 1
}

var shields = 5
var blastersOverheating = false
var blasterFireCount = 0
var spaceDemonsDestroyed = 0
while shields > 0 {
    
    if spaceDemonsDestroyed == 500 {
        print("You beat the game!")
        break
    }
    
    if blastersOverheating {
        print("Blasters are overheated!  Cooldown initiated.")
        sleep(5)
        print("Blasters ready to fire")
        sleep(1)
        blastersOverheating = false
        blasterFireCount = 0
        continue
    }
    
    if blasterFireCount > 100 {
        blastersOverheating = true
        continue
    }
    
    // Fire blasters! 
    print("Fire blasters!")
    
    blasterFireCount += 1
    spaceDemonsDestroyed += 1
}

Thank you, that should get me going. I may have an Xcode/Playground issue.