Posts

Showing posts with the label EDU

EDU Course Challenge 2

So, as mentioned before, rather than cracking on with Angela's more complex course, I'm spending some more time on consolidation and application. A couple of things with this EDU course - it's quite outdated so not ALL is relevant; it has made me learn a few new things; it's an excellent way to tackle practical challenges. This time I'm not heading straight in, but - like the last few Rick Walter bits - going over some of the content. Skipping through if necessary.  Start time - 9:18 Functions There's a mention here of default and variadic parameters. The variadic part I'm not so sure about so am going to check up on this.  So default values - you can set this within the parameters. So if it's there, you may e.g. have two possible ones with one of the values set.  Suppressing external names - using the _.  A variadic parameter is one which can have multiple values in it.  It's the use of the ... in the parameters.  func s...

EDU Course Challenges 1

So I don't feel quite ready to resume Angela's course! No, I've had a look through the other Udemy courses I've purchased and have decided to test out the challenges from the EDU one. I just enjoyed the last few so much that I want to get stuck in and apply what I know before I go back to Angela's. OK here we go! Start time - 20:39 Challenges for types etc. 1. Type this code in a playground: var num = 5 num.advancedBy(3) What is the result? We talked about advancedBy in connection with String indices. What does this result tell you about these indices? Do the .successor() and .predecessor() methods also work with Ints? Does the .predecessor() work when num is 0? I've never actually come across advancedBy before. It will be interesting to see if the latest Xcode even recognises it! So I assume the answer will be 8! num . advanced (by: 3 ) Indeed, the syntax has chosen since this EDU course. No bother, I fixed it easily and the answer...