CS 105

Week 1, Part 2

MP0

Build your own, original Scratch program!

Available on CS 105 Website
Due: Tuesday, Feb. 3, 8:00pm

Activity 1

Getting Set Up with CS 105 + Intro to JavaScript

Release: Later Today
Due: Monday, Feb. 2, 9:00am

Review

Statements instruct the computer to DO something.

Conditionals CONTROL the path of execution.

Variables allow a program to REMEMBER a value for later use.

1

2

3

4

5

6

7

8

9

???

10

11

12

64-bit Computer




0

1

2

3

4

000

0
000

1
001

2
010

3
011

4
100

Binary

A system using only zeros and ones to represent numbers.

Binary numbers are base-2 numbers.

Scratch

Example

"Dog Chases Tail"
(Scratch Project)

Loops

Loops also CONTROL the path of execution.

Loops

Loops often use booleans when controlling the path of execution.

Functions

Functions allow us to GROUP code together for easy re-use.


Functions have two parts:

  • Function definition
  • Function call

Function Definition

Function definitions DEFINE what code should run when the function is called.

Function Call

Function calls are just statements.

Function calls EXECUTE the function definition before continuing.

Intro: Lab 1

"Underwater Maze"
(Scratch Project)

Solving a Maze