Tuesday, November 25, 2014

codemonkey

codemonkey is fun and teaches basic programming in a way that is accessible to kids

Wednesday, November 19, 2014

APS fail

I can not watch the video for bitsbox due to connection issues that I believe are the result of APS blocking YouTube.

codecombat

I'm not sure how well codecombat teaches programming concepts. However it is extremely addicting. It may get some students interested in programming. However I find it lacking and if I knew nothing of programming I would just find this annoying

Thursday, October 30, 2014

Tuesday, September 30, 2014

finally

finally finished my project for Khanacademy, now moving on to animation

Sunday, September 28, 2014

apearently it will not overwrite a session once it is saved the first time

grrrr

Thursday, September 25, 2014

Tuesday, September 23, 2014

my plan

I plan to finish the current and following units in Khan academy this week

Tuesday, May 20, 2014

Khan academy

I will explore the Khan academy JS course and compare it to codeacademy

so I really like Khan academy, you are actually taught by other people and there is much more collaboration also you get to have more variety in what you can do

Monday, May 5, 2014

5/5

I am going to work on codeacademy Javascript lesson Arrays and Objects in JS

Friday, May 2, 2014

5/1

finally found a way to incorporate && and || into my Javascript Choose Your Own Adventure 2. While Codeacademy said it worked, there is at least one logical error in my code. I put the code on the server and the problem still exists. Here is the source code.


alert("You are on a quest to seak the Holy Grail.");
alert("You approch a bridge.");
alert("Suddenly ...");
alert("Stop!  Who would cross the Bridge of Death must answer me these questions three!  Ere the other side he see.");
var user = prompt("What is your name?");
user.toUpperCase();
switch(user)
{
    case 'SIR LANCELOT' :
        var quest = prompt("What is your quest?");
        quest.toUpperCase();
        var color = prompt("What is your favorite color");
        color.toUpperCase();
        if (quest === "TO SEAK THE HOLY GRAIL" || color === "BLUE") {
            alert("You cross the bridge.");    
        }
        else {
            alert("You are cast into the Gorge of Eternal Peril.");
        }
        break;
    case 'SIR GALAHAD' :
         var quest = prompt("What is your quest?");
        quest.toUpperCase();
        var color = prompt("What is your favorite color");
        color.toUpperCase();
        if (quest === "I SEAK THE GRAIL!" && color === "GREEN") {
            alert("You cross the bridge");
        }
        else {
            alert("You are cast into the Gorge of Eternal Peril.");
        }
        break;
    case 'SIR ROBIN' :
        var quest = prompt("What is your quest?");
        quest.toUpperCase();
        var Assyria = prompt("What is the capital of Assyria?");
        Assyria.toUpperCase();
        if (quest === "TO SEAK THE HOLY GRAIL" && Assyria === "NINEVEH") {
            alert("You cross the bridge.");
        }
        else {
            alert("You are cast into the Gorge of Eternal Peril.");
        }
        break;
    case 'ARTHUR KING OF THE BRITAINS' :
        var quest = prompt("What is your quest?");
        quest.toUpperCase();
        var swallow = prompt("What is the average air speed of an unleaden swallow?");
        swallow.toUpperCase();
        if (quest === "TO SEAK THE HOLY GRAIL" && swallow === "AFRICAN OR EUROPEAN")  
        {
            alert("The Bridgekeeper is cast into the Gorge of Eternal Peril and you cross the bridge");
        }
        else 
        {
            alert("You are cast into the Gorge of Eternal Peril.");
        }
        break;
    default :
        var quest = prompt("What is your quest?");
        quest.toUpperCase();
        var color = prompt("What is your favorite color");
        color.toUpperCase();
        if (quest === "TO SEAK THE HOLY GRAIL" || color === "GREY") {
            alert("You cross the bridge.");    
        }
        else {
            alert("You are cast into the Gorge of Eternal Peril.");
        }
        break;
};

Wednesday, April 30, 2014

4/29

finally fixed the problem in jQuery, although still no idea why it gave me the results it did

Monday, April 28, 2014

4/22

adding elements

.append
makes the added element a last child
.prepend
makes the added element a first child
.appendTo
does the same as .append except that the added element is in front of the method
.prependTo
does the same as .prepend except that the added element is in front of the method

Tuesday, April 22, 2014

4/21

object = $(' ') and is followed by a .event

objects inside jQuery events must be inside a function

Sunday, April 13, 2014

4/13

more than one selector can go inside of the $(' ')

this refers to whatever is above it

Friday, April 11, 2014

Chose your own adventure game, stuck

I started with a question simply asking "What is your name?" but now I can't see a place for && and ||.

OK this is getting really annoying! Chrome keeps giving me the "He's dead Jim" blue screen of death every time I visit Codacademy's jQuery course

Thursday, April 3, 2014

jQuery variables

jQuery variables are done just like JavaScript variables except the are conventionally preceded by a "$" to show that the contain a jQuery object.

intro to jQuery.

jQuery is mostly like JavaScript except that it actually manipulates a website's source code. The overall syntax is the same except that jQuery has a unique syntax for its objects. It appears to be organized like HTML and CSS in the sense that it is like a tree, with object function sets within object function sets.

Monday, March 31, 2014

logical operators

&&
and - true only if all are true, false if only one is false:

true && true // = true
true && false // = false
false && true // = false
false && false // = false
||
or - true if only one is true, false only if all are false:

true || true // = true
true || false // = true
false || true // = true
false || false // = false
!
not so !true = false and !false = true

Tuesday, March 25, 2014

switch

  • switch appears to be a form of if else statement except it is a loop of sorts
  • case is like if/else if of the loop, it checks to see if the condition is equal to the variable and then moves to the next case, unless their is a break
  • default is always run unless the program breaks, functions like the else
var answer = prompt("What do you do in your free time?"); switch(answer) { case 'play games': console.log("you like me and probably have no life"); break; // Add your code here! case 'program': console.log("you are like me and have no life, but you at least have a skill for a job"); break; case 'skate': console.log("seems like you get around"); break; case 'hang out with friends': console.log("you are lucky to have so many"); break; default: console.log("well that's interesting"); }

Thursday, March 20, 2014

Wednesday, March 12, 2014

dragon slayer

var slaying=true; var youHit=Math.floor(Math.random()*2); var damageThisRound=Math.floor(Math.random()*5 + 1); var totalDamage=totalDamage+damageThisRound; while(slaying) { if (youHit===1) { console.log("you hit the dragon"); if (totalDamage>=4) { console.log("you slew the dragon!"); slaying=false; } else { youhit=Math.floor(Math.random()*2); } } else { console.log("the dragon burnates you, you are dead"); } slaying=false; } play this game on my site

Monday, March 10, 2014

while loops

While loops continue to run as long as there condition is true

do is used to run something at least once and then as long as the following while loop is true

Friday, March 7, 2014

for loops and arrays

I finally found out the problem with my js. One must be sure to have the correct String being pushed

var text=":LJSDFkl as;jdfk Jonathan LKSJFDkjasfjioodsj kdjfoa[jsdif oajdfioasdjfjkads ioah fidha oiioreah iodsajfoi;dhadoi g Jonathan ] alksjdfkasjdfiojadsiojfioajsdifojsdaiojfioajsdofijaoispjf Jonathan"; var myName = "Jonathan"; var hits = []; for (var i = 0; i < text.length; i++) { if (text[i] === myName[0]) { for (j = i; j <= i + myName.length; j++) { hits.push(text[j]); } } } console.log(hits);

Arrays

arrays are sets of data, both strings and numbers can be in an array at the same time, arrays are stored in variables

var myarray[4, "annoying", "food" 5]

Thursday, March 6, 2014

For loops

for loops take a variable and do something whenever that variable is within a certain range, they also always have a loop counter which makes me think that while loops came first

for (i=1; i<=10; i++) { console.log(i); }

Wednesday, February 19, 2014

rock paper scissors

var userChoice = prompt("Do you choose rock, paper or scissors?"); if (userChoice!="rock" && userChoice!="paper" && userChoice!="scissors") { userChoice = prompt("please enter a valid choice"); }; var computerChoice = Math.random(); if (computerChoice < 0.34) { computerChoice = "rock"; } else if(computerChoice <= 0.67) { computerChoice = "paper"; } else { computerChoice = "scissors"; } var compare=function(choice1, choice2) { if (choice1===choice2) { return"The result is a tie!"; } else if(choice1==="rock") { if (choice2==="scissors") { return "rock wins"; } else { return "paper wins"; } } else if(choice1==="paper") { if(choice2==="rock") { return "paper wins"; } else { return "scissors wins"; } } else { if(choice2==="rock") { return "rock wins"; } else { return "scissors wins"; } } }; console.log(compare(userChoice, computerChoice)); Play Game!

Tuesday, February 18, 2014

function definition
JS creates functions by assigning variables to them, instead of defining new commands like Python
function syntax
var name=function(param){what the function does;};
parameters
stuff in parentheses when function is defined
arguments
stuff in parentheses when function is called
call
to execute the commands in a function
D.R.Y.
don't repeat yourself
return
saves but does not print the result of the function
scope
global or local
global
defined outside a function
local
defined inside a function and only applicable in that particular function
var
used to define the scope of a variable, can be used even on variables of the same name to leave a global variable unchanged

Tuesday, February 11, 2014

Hello World

I made a Hello World js program.

console.log("Hello World");

Saturday, February 8, 2014

shapes notes

  • graphics in order of first on the bottom
  • y coordinate reversed
  • default fill=black if none listed
my svg graphic

Tuesday, February 4, 2014

batman

var age=prompt("What's your age?"); if(age<18) { console.log("you may play but I am not responsible for anything"); } else { console.log("play on!"); } console.log("Snow White and Batman were hanging out at the bus stop, waiting to go to the shops. There was a sale on and both needed some new threads. You've never really liked Batman. You walk up to him."); console.log("Batman glares at you."); var userAnswer=prompt("Are you feeling lucky.punk?"); if(userAnswer==="yes") { console.log("Batman hits you very hard. It's Batman and you're you! Of course Batman wins!"); } else { console.log("You did not say yes to feeling lucky. Good choice! You are a winner in the game of not getting beaten up by batman."); } var feedback=prompt("rate this game out of ten"); if(feedback>8) { console.log("This is just the begining of my game empire. Stay tuned for more!"); } else { console.log("I slaved away at this game and you gave me that score?! The nerve! Just you wait!"); }

Friday, January 31, 2014

Getting Started With Programming

Getting Started With Programming

deffinitons and required data

data types
numbers, strings, booleans
numbers
1, 2, 3, etc.
strings
anything in quotes like this
booleans
true or false
comparison operators
>, <, >=, <=, ===, !=, they compare two data types to return a boolean
conditional statements
following code is only executed if true
modulo operator
returns the remainder of a division operation
length
returns the number of characters in a string
substring()
returns part of the preceding string
variables
variables store data and must be preceded by var
var
denotes a variable

other syntax stuff

  • console.log=print or echo
  • comments start with //
  • true and false are lower case