UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Using Unwrap to Study? It’s broken?

Forums > Swift

@xan  

I've been trying to do the daily challenges in Unwrap to study but noticed it might be wrong A LOT? Maybe it should just get rid of the questions where it has you write a function from scratch if it doesn't work?

"Write a function that accepts an integer and returns it squared."

Is this not correct? Every time I try these questions where you write it yourself, I submit it, get it marked wrong, copy it into Xcode and it works.

func squareNumber(number: Int) -> Int {
    number * number 
}

Is there some other way you're supposed to do these?

2      

Try putting the return in

func squareNumber(number: Int) -> Int {
    return number * number 
}

The Full Code for Unwrap is on Gihub/twostraws/Unwrap

3      

TAKE YOUR SKILLS TO THE NEXT LEVEL If you like Hacking with Swift, you'll love Hacking with Swift+ – it's my premium service where you can learn advanced Swift and SwiftUI, functional programming, algorithms, and more. Plus it comes with stacks of benefits, including monthly live streams, downloadable projects, a 20% discount on all books, and free gifts!

Find out more

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.