Friday, January 31, 2014

Syntax, My Dear

     It is a lovely Friday here in Texas and I am back at it! I'm here at the coffee shop getting ye 'ol caffeine going. I have been true to my lowering the caffeine amount, but I sure do miss it. So, I'm happy to have my cup 'o Joe today. So, now that I've got that and Freaks by Hawk in Paris playing, I'm ready to plug in and plug away!


                                       HTML5


     After acing the test for all the HTML that I've learned over the course of the last few days, I moved on to a social networking profile for King Kong.  That's not something you say every day.   To start they want me to make ME a profile. This:https://lh5.googleusercontent.com/-gq0oYM8KXyA/UupJccVf9NI/AAAAAAAB-tg/_F3b13eH30Q/w852-h608/but-first-coffee_0.jpg
was the picture that I went for my profile pic. I think that works just fine. I'm actually really picking up this HTML stuff really well! I think I'm starting to get how to learn how to learn programming more easily. Pretty sure my synapses are starting to realign themselves so that I remember text better. 
     I finished the social profile! I am now the social profile maker of awesome!

Olé! Now, onward to the JavaScript!



                                    JavaScript                  






     And we're meeting the Logical Operators again! There are three Logical Operators in JavaScript and they are: 'and' (&&), 'or'(||), and 'not'(!) I've already dealt with these, but now they're being again. Starting with: 


var iLoveJavaScript = true;

var iLoveLearning = true;

if(iLoveJavaScript && iLoveLearning) {

  // if iLoveJavaScript AND iLoveLearning:
  console.log("Awesome! Let's keep learning!");
} else if(!(iLoveJavaScript || iLoveLearning)) {
  // if NOT iLoveJavaScript OR iLoveLearning:
  console.log("Let's see if we can change your mind.");
} else {
  console.log("You only like one but not the other? We'll work on it.");

}
Which works out well, because; I do love learning.  
     And now to work on a Choose Your Own Adventure game involving a troll. I'm making a game, on the internet, about a troll. Irony thy name is Choose Your Own Adventure.
     So, it would seem that yet again the people writing out the lessons forgot to tell me something important... Let me explain; here's what they told me to do: do a variable that includes a prompt. Make the prompt have a <.toLowerCase> or a <toUpperCase> at the end and then create some switch statements. This is what I made:

var user = prompt("What is your quest?","Answer here.").toUpperCase();


switch(user){

    case "Bacon.":
        console.log("That's not a quest!");
        break;
    case "To seek the Holy Grail":
        console.log("Right. Off you go.");
        break;
    case"To be bored and alive":
        console.log("That's not a quest, that's what a teenager says.");
        break;
    default:
        console.log("That... isn't in the records, but whatever. Go away.");
}

     Now, at first, I didn't know why I was only getting the default switch statement. Turns out, you need to uppercase your cases like this:

  case "BACON.":
        console.log("That's not a quest!");

        break;
so that they will be the same. They didn't tell me that. Deductive reasoning alone got me through that lesson after some loss of time. Seriously, I think someone that didn't really know what they were doing made this entire series and was overseen by someone who just glanced around to make sure things ran. There should be some kind of beta testing or something for anything like this. But, I digress. Onward to the rest of the studies! 

     So, after battling my way through that, I am now moving on to Arrays and Objects. Which, I know I've gone over before, but it's never a bad thing to brush up on things already studied at this stage. You can put arrays inside other arrays? Array-ception! 

     So, you can nest other arrays in Dimensional arrays: var array=[["Hello", "Hi"],[23,46]];
Which all have the same  amount of elements as nests (number of[]'s) how many dimensions the array has is governed by how many nests it has. So, in this case, it's a two dimensional array.
And Jagged Arrays: var array=[["burp","Pizza"],["questions",42,"life"],[13]];
Which don't have the same amount of elements in their respective nests, but can still be used in the same manner. 
     Well, a lot has been done today! Good thing for the coffee!  I just have to remember syntax! Syntax,syntax,syntax!! From what I've heard, that's just something any programmer has to be aware of. So, keeping that in mind, I'll see y'all Monday!

--Martin