Learning to write a Ruby game
Happy thanksgiving everyone! I spent the morning of my Thanksgiving running a 10k Turkey Trot. The most amusing things that happened were in this order:
Someone won a costume contest dressed like the house from the film “Up.” Uh, can you say baller?
The friend running with me had to pee immediately following the start-gun. Subsequently we had to double our speed starting mile 4 to make it to the port-a-potties at the finish line. I sincerely hated him from miles 4 to 6.
As soon as we crossed the finish line, he turned to high-five me but suddenly faltered. I followed his gaze and watched the runner next to us begin vomiting his breakfast with complete abandon.
In summary, good times were had by all.
Something funny happened the other day.
I was in a coffee shop and the Beatles song, “Come Together” was playing in the background. The past few weeks I've been methodically going through Learn Ruby the Hard Way, and realized that things (coding) were finally coming together. I have no idea what that song is about by the way, and believe it or not, this is the second time I've blogged about that song in my life.
A quick aside. When I set up the dual-boot a few weeks ago, I intended to only have my computer boot Linux from my flash drive. Not sure what happened, but I don't need the flash drive. Apparently Linux is in my hard drive. Whatever! Works for me. A flash drive boot would have been annoying anyway. That's what every disgruntled ten-year-old says when they don't get what they want => “'Whatever! I didn't want that anyway.”
The most recent assignment from Learn Ruby was to create a text-prompted game. Not sure if you're familiar with the game Zork. What I've discovered is that most engineers will create some kind of treasure hunt or quest-driven type of game. I've never been into either or games in general, other than The Sims. Yes, please play The Sims but be prepared to say good-bye to your life as you know it when you delve deeper into a virtual one. I think about 70% of my gchats with my ex-boyfriend were dedicated to discussions about how much I “leveled-up,” what kind of careers I should choose for my Sims, and how many life points I needed for two of them to make a fantasy baby. I'm embarrassed just typing this.
So you think your mother-in-law likes you?
Anyway I created a simple text-prompted game for married women. I know. What married women have time to play games? That's not the point. I just wanted them to have a game too. The premise is that your husband calls and tells you that your mother-in-law is dropping by in a few hours and wants you to make her favorite dish. And she doesn't like you very much so the pressure to impress her is great. There's a power outage and you have to cook this food without making any mistakes. For those of you who are immediately pooping on the fact that there's a power outage and you have to use a stove, don't freak out. I have you light a match to light the stove. I thought of everything. I was going to have you use the oven but then common sense stepped in and told me that wasn't possible. I started out by trying to diagram the game to mark where I would branch off and have the player make different decisions. That didn't work. I just ended up drawing a lot of empty boxes with arrows and smiley faces, so I decided to think out loud instead while doing my hair. Hey, when you don't have a job, you have a lot of time on your hands. Quit judging me. Thinking out loud helped immensely and I sat down and started coding. This was the simplest game in the world and I took most of the day working it out. If you're interested in playing it and/or laughing at my poor coding skillz, you can find the script here: http://pastebin.com/NVMh9ikf
I was advised to begin learning Sinatra next in order to get some experience with web development. I will update on my progress soon.
I think it might be useful to learn regular expressions ("regex") simply because they resemble alien hieroglyphics.