Skip to main content

Treasure Hunt, Swiftplayground

Treasure Hunt 

Learn to code 1, Functions




We are currently learning to code on Swiftplayground, the video above is one of the challenges that we had to complete called ‘Treasure Hunt’. Our challenge was to decompose patterns and create our own functions. The first function that I made was to reach the switch, toggle it, turn around and reach the next switch, toggle it, turn around and walk back to where it started. Then I made the byte (the small character) turn to face the next row. Once the byte had turned around, it had to move to reach the first switch, then toggle the switch, reach the second switch, toggle it, turn around and then repeat. This code I found simple.

Comments

Popular posts from this blog

The Butterfly Lion

I feel very happy the way the book is going now, it is very interesting. I really recommend it, my favorite part was when Bertie (the main character) got to keep the white lion I felt euphoric! The part that I felt sad about was when Bertie had to move to England and then he had to scare the lion with a gun shot so he could run away and the part when Bertie's father shot the white lion's mother. I love the fact that Bertie found his white lion again and he married Millie. (Bertie's friend) I'm very angry that Bertie's dad married another women and made Bertie go to school.

My Dreadful Day at School

Hi, I’m Benny Adams, I had a dreadful day at school yesterday, probably the worst day I’ve ever had! A singing inspector came to hear us sing. He was an ugly young man, very strict, he wore large knickerbockers and had dark blue eyes like blueberries. His name was Mr. Raymond. When we entered the singing hall we all had to do the Doh Ray Me So Fah and tata tete things. Once we had done all our warm - ups, Mr. Raymond called Charles and I to stand in front and sing. I was petrified, I didn’t know about Charles but I could see he was shaking from the corner of my tearful eyes. Then Mr. Raymond called me “the long one” which I hated because that’s what everyone calls me, and then Charles was considered as “the short one” this made me angry but I tried to hide it. Mr. Raymond then asked us to sing, Charles looked at me as if to say “help!” We did not know a single song, I was getting even more terrified by now. Mr Raymond was now pointing his long oak wood stick at the modulato...