Posts

Showing posts with the label Chris Ching

Chris Ching Course Part 5 (Challenge 3)

Four days?! Wow, that's longer than I thought! This is not going to be a typical thing - such big gaps between coding. To make up for this, I will be sure to have a good session today and tomorrow - at least an hour for each. So, last time, I completed both of the Chris Ching challenges. I got MOST of the elements correct, though the second one had me puzzled in places. For the last part of the Chris Ching course, there is the third and final challenge. Here we go! // Challenge #3: The Library Challenge // // Instructions: // Complete the class definition so that you get the expected output in the console (specified below the class definitions). See TODOs. // class Person {          var name: String !          init ( _ fullName: String ) {         name = fullName     } } class Book {          var title: String !     var author: S...

Chris Ching Course Part 4 (Challenges 1 and 2)

Right, here we go - time for the challenges! I'm going to take my time with these, look up the syntax in any previous blog entries - where necessary- and hope that they're not too hard! Right let's go! Start time - 19:10 Challenge 1 Right I've listened to the first challenge instructions. As I mentioned before, there are a few ways of doing this - what I did last time worked well. I have to admit that I'm cheating a little, as I can pretty much see how this code plays out. But that's good - it means I'm remembering things and applying them! // Challenge #1: The Lost Animal Challenge // // Instructions:  // Given the two arrays below, write a function that takes a String as an input parameter and returns a Boolean value. The function should return true if the String input is in either array and it should return false if the String input is in neither array. // // Examples: // Call your function and pass in the String "cat" as th...

Chris Ching Course Part 3 (Properties, Initializers, Arrays and Dictionaries)

So this may be the last of these 'consolidation' Chris Ching courses that I'll use. It's been good fun but at the same time I know I am beyond this level of understanding. It's more of a confidence booster really! It's a good job that I like spending time coding and going over this stuff! OK here we go! Start time - 19:13 Properties All fine so far. Chris says that properties are variables inside the class. Well, they are. But they can also be constants! Computed properties - I need to go over this, good! class BlogInfo {     var blogTitle: String     var blogBody: String     var author: String ?     var posts: Int          var fullTitle: String {         if author != nil {             return blogTitle + " by " + author !         } else {             return "Author is unknown" ...