how to write so computers will listen (2)
TRANSCRIPT
How to Write so Computers
will Listen
Learning to write java script
What is java script
• Java script is like a foreign language
• Computers understand java script
• Computers follow the instructions written in java script
• Java script can be used to make games on the web
• Java script can be used to make websites more interactive
• Java script is based on logic
How I’ve learned
• I have been taking a online Codecademy
Corse for the last 10 weeks
• I have been doing one and a half hours
per week
• I have consulted the Q and A forum for
help when I'm stuck
How it works
• Java script analyses data in strings arrays
objects and numbers
• Java script can decide something based
on whether it’s true or false
• Java script can loop through data
• Java script is what makes those annoying
boxes pop up in browsers
Evidence
I completed
java script
Course
Code for program I made• confirm("Are you ready to play harry potter / my project trivia");
• var houseState = "you do not have a house";
• var houseChoice = Math.random();
• if (houseChoice <= 0.25){
• houseChoice = "slithrin";
• houseState = " would you like to join the deatheaters now and just get it out of the way";
• }else if (houseChoice <= 0.50){
• houseChoice = "griffendor";
• houseState = " you are so brave";
• }
• else if(houseChoice <= 0.75){
• houseChoice = "ravenclaw";
• houseState = " you must be so smart";
• }
• else{
• houseChoice = "huffelpuff";
• houseState = " have you ever herd that story about the tortise and the hare";
• }
• var total = 0;
• alert("you are in " + houseChoice + houseState);
• function ask (question, answer){
• //asks question and saves value to a varible
• var userAnswer = prompt(question).toUpperCase();
• //checks to see if the griven answer is correct
•
• if (userAnswer === answer.toUpperCase()){
• alert("correct you get 10 points for " + houseChoice);
• total += 10;
• }
• else{
• alert("your answer is not correct minous 5 points from " + houseChoice + " the correct answer was " + answer);
• total -= 5;
• }
• }
• var snake = new ask("what giant bord game did harry potter have to play to get to get the sorcers stone", "chess");
• var frensey = new ask("true or false a centor called bane rescued harry from the enchanted forest", "false");
• var horcrux = new ask("what was the first horcrux destroyed", "the diary");
• var internship = new ask ("was my internship at UVM or MVS", "UVM");
• var mycelium = new ask ("what are mushrooms roots called", "mycelium");
• var RAD = new ask ("what dose RAD stand for", "rape aggression defense");
• var ginny = new ask ("true or false snape and dracko malfoy were manuplateing nevel longbottom into opening the chamber of secrets", "false");
• var girlfriend = new ask("who was harry potters first girlfrend","cho chang");
• var married = new ask("who did ron weasley marry", "Hermione granger");
• var destroy = new ask ("true or false a sord soaked in basilix veom can kill horcruxes", "true");
• var hidrocarbon = new ask ("what is a molcue that is made out of hidrogen and carbon called", "hidrocarbon");
• var rad = new ask ("true or false rad is a marshal art", "false");
• var dracko = new ask("what dose dracko malfoys first name meen in latan", "dragon");
• var coffy = new ask("true or false java script is a coffy drink that people in hollywood love", "false");
• var snape = new ask("true or false sevrouse snape is a deatheater in the end", "false");
• var lung = new ask("true or false a pulmanary reacherch lab studdys the heart", "false");
• var oil = new ask("do deasol and water mix", "no");
• var ifWin = function(){
It’s really small so you can’t cheat on the game
proficiencies
• set and meet goals
• collaborate with others to resolve issues
and problems
• solve complex problems
• Take Responsibility for Learning