Jaffa's Treasure Class Hack

by Jaffa

14 Jun 2017

Even though I’m doing the data analysis, I thought that I would get my bearings by experimenting with Turtle. I decided to do the Turtle Treasure Hunt, using a class object as a treasure instead of using a turtle. That was pretty easy, so I tried to make multiple treasures. I couldn’t get the logic right to get that to work, so I switched gears and made mines. Since I was using identical classes, I combined them into a single class called “Buried.” I specified one as “gold” and the others as “dynamite”, “quicksand”, and “mine.” I played with the parameters a little until I felt like the mines were really a hazard.

If I were to develop this further, I might make some kind of warning sign that you are close to a mine. Perhaps the turtle’s outline could change colors or it could glow. I would also try to make the multiple treasure thing work. I think that now I have a better sense of class so, hopefully, it will be easier to apply class to the data analysis. You gotta walk before you can run.

Jaffa is a rising second-year MSIS student. She has lived in 6 different states. Find Jaffa on Twitter, Github, and on the web.