Fortune Teller

Tonight, I had a chat and ICM review session with my friend/ITP alumni/ICM goddess, Wipawe Sirikolkarn. I expressed to her that I’m having a hard time finding programming appealing and as a result, am struggling to be creative in this context. I asked her for resources to spark my interest, but after looking at a number of examples online, she best put it that I’m just not “turned on” by it. I’m still hopeful it will kick in at some point, but for now, I will do my best to complete the homework assignments.

For this week’s homework, I had two ideas. After attending the fly-by last Thursday where  2nd year student Cristobal introduced us to Mappa, I thought it might be fun and vindictive to create a map with planes that visualize all the delayed and cancelled flights for unreliable airline companies (ahem) Spirit Airlines. (I tried to save a couple bucks last year on a flight home to CA and ended up stuck in Chicago and the airport for two days.)

I found this API resource: https://developer.flightstats.com/

This idea was a bit more ambitious to execute than I thought, so I might save it for a different project. I ended up referring to the JSON files shared by dariusk and landed on divination. A colorful array of psychics, crystal balls, tarot cards, horoscopes, magic 8-balls, and Zoltar, those kitschy coin-operated animatronic fortune tellers came to mind. The spectrum of ways in which people desire to be understood and anticipate the future has always fascinated me. My idea is to create a fortune generator with the click of a mouse.

First, I looked up images of fortune tellers to use as my background and set it up in preload. I then created a button to trigger a fortune.

In separate tabs, I referenced the data set I wanted and used the code we used in class to print the data I wanted to use.

 

The tricky part was putting them together. I needed a way to wrap the text so it fit in the crystal ball, but didn’t know how. Thanks to a resident, I was introduced to Div.

Chino walked through drawing a rectangle in the crystal ball with me to figure out the dimensions and font size for our text box and opened up the editor to test it out. We then declared our variables and set up ‘fortune telling’ in an array and used for loop to push a random fortune when the button “Get your fortune!” is pressed.

It worked!

Yikes! I sure hope not!

Leave a Reply

Your email address will not be published. Required fields are marked *