December 8th 2020 archive

A Simple Problem – Swift Playground – pt 5 (Comp Tech)

Hello Everyone! For Computer Tech class, I am using a program called Swift Playground, which is another “learn to code easy” app. Today I am briefly walking you through a problem I was solving on the app!

(Goal of the project, collect gems on the top of the stairs and use functions)

This means, our character will repeat the “Solve stair” function, with additional help by turning around and turning left. We defined “solve stair” in a separate space, so instead of writing all the code down we used a function shortcut. The character (Byte” goes through these steps:

Solve stair to collect gem.

Turn around and then solve stair to collect gem

Turn left then solve stair to collect gem

Finally turn around then solve stairs.