EDUPHORIA - Learn to code1 Swift Playground COMMANDS - Apple Developer iOS MacOS iPadOS XCode SWIFT Language
Hi Everybody, I am Jasper Edwin Asir. I take immense pleasure in learning and knowing things. "Eduphoria" is a spin on the word "Euphoria" which was coined by myself to describe the feelings of joy I experience whenever I self-learn something new.
In this game, we will use the same code called "Apple Swift language" which real software developers use to create iOS apps. Once you finish this game, you will be able to create and upload your new apps to the AppStore.
In this game there are three characters, Byte, Blue and Hopper, and they have unique actions, behaviours and even tantrums. It is so much fun with the lively and peppy background music, you are in for a EDUPHORIA !In the first chapter of this playground - Learn to Code 1,
There are eight sub sections, viz,
* Introduction
* Issuing Commands
* Adding a New Command
* Toggling a Switch
* Portal Practice
* Finding and Fixing Bugs
* Bug Squash Practice
* The Shortest Route
I completed all the stages and the solution code that I wrote for each stage has been given herewith for the benefit of other beginners who are searching for the same.
Although, I have shared it here, I highly recommend that the beginners challenge themselves which is better than a pre-made solution. They might come up with their different solution which will make them into a better coder.
* Introduction:
Some amazing illustrations await you in the form of a presentation which will teach you what is the core concept of the chapter. I love these visual form of learning experience, it is mostly designed keeping children in mind. Also once you write the code and execute the same, you will be able to see it in the right side of the screen.
Here is how I tackled this stage of coding.
* Issuing Commands
moveForward()
moveForward()
moveForward()
collectGem()
* Adding a New Command
moveForward()
moveForward()
moveForward()
turnLeft()
moveForward()
moveForward()
collectGem()
* Toggling a Switch
moveForward()
moveForward()
turnLeft()
moveForward()
collectGem()
moveForward()
turnLeft()
moveForward()
moveForward()
toggleSwitch()
* Portal Practice
moveForward()
moveForward()
moveForward()
turnLeft()
moveForward()
moveForward()
toggleSwitch()
moveForward()
turnLeft()
turnLeft()
turnLeft()
moveForward()
turnLeft()
moveForward()
turnLeft()
moveForward()
moveForward()
collectGem()
* Finding and Fixing Bugs
moveForward()
moveForward()
turnLeft()
moveForward()
collectGem()
moveForward()
toggleSwitch()
* Bug Squash Practice
moveForward()
turnLeft()
moveForward()
moveForward()
toggleSwitch()
moveForward()
moveForward()
moveForward()
moveForward()
collectGem()
* The Shortest Route
moveForward()
moveForward()
moveForward()
collectGem()
moveForward()
moveForward()
moveForward()
moveForward()
toggleSwitch()
After each lesson, you have multiple methods to run your code. If you want to save time, use the Run Fastest option. Should you want to see how each command is executed, simply choose Step Through My Code option. There are other options which you might want to try as well.
Swift. A powerful open language that lets everyone build amazing apps.
Swift is a robust and intuitive programming language created by Apple for building apps for iOS, Mac, Apple TV, and Apple Watch. It’s designed to give developers more freedom than ever. Swift is easy to use and open source, so anyone with an idea can create something incredible.
Source: https://www.apple.com/swift/
Comments
Post a Comment