M1D3: CS50 Lecture 0 – Scratch | Part 1

What ultimately matters is where you end up relative to yourself when you began.

David Malan

Computational Thinking – application of ideas from Computer Science

Computer Science – a big part of it is programming. Study of information.

Problem Solving

→ Input → output

Unary – simple system of using single symbol, like numbers (1 digit)

Computers use something else than Unary, they use Binary (2 digits)

Binary digit – bit (0 or 1)

Bit

It’s like a lightbulb/switch, 0 is off, and 1 is on. Computers can have multiple switches to count higher numbers than 1.

For multiple switches, it can have different values, depending on its position. Base-2. Base-10(decimal).

123 – symbols of 1, 2, 3.

Computer uses 2 base.

2^2, 2^1, 2^0

= 
4, 2, 1

From the values above, they’re represented by 000 (4*0, 2*0, 1*0). Therefore, 1 is represented by 001 (4*0, 2*0, 1*1), 3 is represented by 011 (4*0, 2*1, 1*1), and 7 is represented by 111 (4*1, 2*1, 1*1). Hmm this is where the 32-bit and 64-bit came from. 32-bit couldn’t process higher values. It’s why 64-bit programs won’t work on 32-bit computers.

Byte – 8-bits

ASCII – letters/characters, uses 8 bits to represent letters

Accented and Asian characters, and emojis – Unicode (mapping of numbers to letters) https://unicode.org/charts/

Emojis are not images, they’re characters.

Emojis changing skin tone – the first set of symbols is the structure, + the another set of symbols for the skin tone.

https://unicode.org/emoji/charts/full-emoji-modifiers.html

RGB – Red, Green, and Blue

  • The RGB color model is an additive color model in which the red, green and blue primary colors of light are added together in various ways to reproduce a broad array of colors. The name of the model comes from the initials of the three additive primary colors, red, green, and blue.

Videos – fps (frames per second, or images per second)

Abstraction

– simplification of something.

Algorithm

Input → Algorithm → Output

Algorithm is a step by step instructions for solving some problems.

Every algorithm could be correct, but not all correct algorithm is the best. This is where strategy and human mind comes in.

Pseudocode

Pick up phone book
Open to middle of phone book
Look at page
If person is on page
  Call person
Else if person is earlier in book
  Open to middle of left half of book
  Go back to line 3
Else if person is later in book
  Open to middle of right half of book
  Go back to line 3
Else
  Quit

/** VERBS here are FUNCTIONS
/** IF, ELSE IF, ELSE are CONDITIONALS
/** starts with PERSON IS are BOOLEANS / answerable by yes or no
/** INDENTED LINES after the Conditionals will happen if the answer is YES
/** GO BACK TO LINE 3 are LOOPS

functions
  arguments, return values
conditionals
Boolean expressions
loops
variables
....

Scratch

https://scratch.mit.edu/

Sprite is the character.

Stopped at 1:54:37

This entry was posted in Study Notes and tagged , , . Bookmark the permalink.

Leave a Reply