Swift Playgrounds 3 (“Answers”)

This time in Swift Playgrounds, I got to write out my own code. We had to make three questions with an answer box that worked. The three questions I asked were “What is one sport that you play?”, “How often do you play that sport?” and “What do you like about that sport?” The most challenging thing was that you had to get the code exactly right or else it wouldn’t work. Even if there was one space that was supposed to be there but wasn’t, the whole thing would be messed up. It took me a lot of tries to get it right, and I finally finished it! Here is the final product:

The words in blue circles represent the words that don’t show up in the actual project. The red lines are connecting the code to the part of the project the code makes happen. Overall, it was a little challenging, but fun!

Swift Playgrounds 2

In Swift Playgrounds this week I chose to focus on the “For Loop” section of it. I got pretty far. Some of the challenges I ran into was that I started writing out the code for it, but then I lost track of where my character would be on the map, so I didn’t know what to do next. So, to help me I broke the code into sections, so that I could keep track of it better. It worked and I was able to complete a lot of puzzles.

This is the progress I have made on Swift Playgrounds.

Swift Playgrounds 1

One of the Swift Playground levels that I decoded was the “Bug Squash Practice”. It took me a little while, but I eventually figured it out. Here are the steps of code I used:

  1. Move forward
  2. Turn left
  3. Move forward
  4. Move forward
  5. Toggle switch
  6. Move forward
  7. Move forward
  8. Move forward
  9. Move forward
  10. Collect gem

Some difficulties I had were that I thought I had to go a completely different way that I had to go, so I spent a lot of time on that. But then I re-read the directions and I saw that it said that all of the blocks were there, I just had to put them in them in the right order. So then I realized that since there weren’t enough blocks for me to be able to use the way I thought I had to go, I started thinking of different ways. And finally, I figured out the right way, and it worked!