Learn to Code 1 (Blog post #2)

Over the course of a week, I’ve been doing Swift Playground’s Learn to code 1 program. In learn to code 1 there are quite a few sections, but alas, I have only completed three of them. However, these sections have seven lessons each, so I feel that I can talk about my strengths and struggles completing them. Firstly, we have commands and they only require a few lines of code repeated which makes it easy and simple in order for you to get you comfortable with the controls, so nothing unexpected.

Next, there’s the function section. The function section introduces the function which makes it so that instead of writing the same code three times, you put it down once and give it a name and put the name down three times. This reduces some of the repetition and the patterns become more complex and difficult. I also found it helpful to put functions in functions to reduce time even more.

Finally, we have the third and hardest section, “For loops” which makes it so you only have to type a single function and just put it in a loop. In my opinion, it was the hardest because the amount of turns and portals in the levels. The amount of turns and the fact that I don’t know my rights from lefts made it so that I had to repeat a lesson constantly in order to figure out which way my character had to turn. The sheer amount of portals had me hoping I didn’t run into one while I was testing what direction I had to turn to. It was also a gamble which direction I would be facing once I got out of the portal. For this section, it was just trial and error.

Leave a Reply

Your email address will not be published. Required fields are marked *