Hello. I’ve found out that that there are not enough challenges in the book to solid my knowledge in swift. Can anyone advice some resources with additional swift’t challenges?
Here are two challenges for you.
-
Write a function that computes the square root of a given number. (Note that you are not allowed to use the square-root function in the math library.)
-
Write a function that prints the largest even prime number.
-
Write a function that computes the value of the expression x2 - y2 without taking squares.
If you do these, you will be given more challenges.
I would head over to https://projecteuler.net and try solving as many of those with what you’ve learned with Swift.
Another useful site is http://exercism.io Lots of great exercises for many different languages including Swift.