Saturday, May 25, 2013

ZOMBIE SUSHI ATTACK


I originally wanted to blog about another assignment from Codeacademy and title it J.S. Project : Choose Your Own Adventure Part 2!  I had even planned to mimic the same written format--which had set the tone in all the twenty posts preceding this one. Even though this formulaic composition had initially seemed effective in helping me review all the new concepts, the procedure quickly became a drag and I soon felt like blogging these assignments became more of a drudgery than a fun way to imbibe all this new material. 

However I was determined to continue this habit, perhaps subconsciously fearing that if I stopped posting on a semi-regular basis, it would seem like I wasn't really making much progress. I measured my progress to the number of posts I churned out--whether or not the quality of content each had possessed. This once interactive learning method soon became a mindless conversion of text from one window to another and I was fooling myself, until Monday... when I couldn't find my keys. You see, during the day I am the only person at home so not being able to locate my keys essentially means, not being able to go outside. Frustrated that I couldn't go on my daily jog or run by the local grocery store to grab some food, I was stuck here... Trapped... With this pain of this assignment looming over my head. So I bit the bullet and took a look at this one assignment and decided to give it a go...NOT thinking about this blog, NOT thinking about putting the instructor's words into my own and creating a teaching post, but to just work directly with the code itself. A few days ago, I stumbled upon this "open source collaborative web development debugging tool" and it was the key to my problem! I studied the code provided from Codeacademy and wrote my own--incorporating my adventures of working at a hostess at a sushi bar. 

This is my code, and you can even demo it right here

var zombie_sushi = prompt("OH NO! The bucket of plutonium got all over the sushi and now they've turned into brain-craving zombies! Do you SLAY them, EAT them, or RUN?").toUpperCase(); 

switch(zombie_sushi) {
  case 'SLAY': 
    var macho = prompt("So, you consider yourself macho? (YES or NO)?").toUpperCase(); 
    var buff = prompt("Let's see if those burpees did anything to your level of fitness! You think you're ready?").toUpperCase();
    if(macho === 'YES' || buff === 'YES') {
      console.log("You only need one of the two! You massacred all the zombie sushi! Good job, bro!");
    } else {
      console.log("You're not macho OR buff? Sucks for you, probably should have worked on those squats a little more. You died!");
    }
    break; 
  case 'EAT': 
    var soy_sauce = prompt("All right, I guess you can try to defeat them this way... Eeeurgh. Got your soy sauce packets (YES or NO)?").toUpperCase(); 
    var wasabi = prompt("Hold on a minute, dude. You've got your green glob of wasabi with you, right?").toUpperCase(); 
    if(soy_sauce === 'YES' && wasabi === 'YES') {
      console.log("Woohoo! You've defeated the zombie sushi, hopefully you won't get a bellyache later on!"); 
    } else { 
      console.log("Dang! You can only use the magical combination of soy sauce and wasabi together! Not on their own. Sorry man, but you're dead!");
    }
    break;
  case 'RUN': 
    var speedy = prompt("Come on, let's get a move on! You're fast, right?").toUpperCase(); 
    var rollerblades = prompt("Wait, you have rollerblades in your backpack?").toUpperCase(); 
    if(speedy === 'YES' || rollerblades === 'YES') {
      console.log("Bam, you got away! You live to see another glimpse of the sunlight.");
    } else {
      console.log("Oh no, you're too slow and you didn't have your rollerblades in your bag? Sorry man, but you're a goner.");
    }
    break;
  default:
    console.log("Woah, bro. Didn't understand what you said. Hit Run and try again, this time picking SLAY, EAT, or RUN!");
}

/* I know it's short, but it's a start. And I had a whole lot of fun writing this--even though it's pretty nonsensical... but who cares. Maybe I'll animate it someday? */

I think from now on, I'm going to stray away from the previous formulaic and boring method I've used to craft my post and focus on something a little more creative and thoughtful. It's way more fun and I hope you enjoy!

No comments:

Post a Comment