Due: ~15 minutes ago
All office hours are now posted on the course website!
"Tay-tay" (Taylor Swift)
(CS 105 @ UIUC, MP0 Submission, Spring 2015)
Every Scratch block is a JavaScript statement.
All statements tell the computer to do something.
A function call runs code somewhere else that does something else.
Examples
In Scratch, the say funciton runs code on a sprite that has it speak.
A function call runs code somewhere else that does something else.
Examples
In JavaScript, the alert funciton runs code in a web browser that informs the user.
alert("Hello, world!");
alert("Hello, world!");
alert ( "Hello, world!" ) ;Run as a JsFiddle!
Variables store data in a computer's memory for later use.
var statement = "Hello, world!"; alert(statement);
var a = 3; a = a * 3; alert(a);
var a = 3; a = a * 3; var b = a * 10; alert(b);
Conditionals allow the computer to make decisions based on values of variables.
Conditionals encapsulate other blocks, so they use curly braces, NOT semicolons.
var x = 10; if (x > 5) { alert("x is larger than 5"); }
DDR
(CS 50, Harvard University)
Lab 1
Final lab on Scratch!
MP0
Out now, due next Tuesday by 8:00pm
Activity 1
Out today, due next Wednesday by 11:45am
Lecture (Week 2)
Monday is Labor Day — No Lecture on Monday or Wednesday
Lab 2
First lab on JavaScript
(Activity 1 due before labs begin!)
MP1
Out on Tuesday, Sept. 8, due Sept. 15
Activity 2
Due before lecture on Sept. 14/16