Week 0: Scratch
Computational thinking before a single line of text-code: binary, abstraction, and algorithms taught in click-together blocks.
8 topics · 30 questions
Each topic is a path, not a menu: work down it in order and every question builds on the one above. Click any of them to watch the answer draw itself.
Computational Thinking and Problem Solving
- How it worksHow does a computer scientist turn a vague goal into a precise list of inputs, outputs, and steps?
- Worked exampleWalk me through turning 'get ready for school on time' into a precise step by step algorithm.
- Going furtherWhat happens to a problem's difficulty once you can name its exact inputs and outputs?
- Common mistakeWhy isn't computational thinking the same skill as memorizing programming syntax?
Your turn1 of 2
A vague goal is broken down into 8 major steps, and each major step is further broken into 6 precise sub-steps. How many total sub-steps does the finished algorithm have?Representing Numbers in Binary
- How it worksHow does flipping a row of light switches on and off let you count upward in binary?
- How it worksHow does an odometer rolling from 9 back to 0 explain why binary carries the same way decimal does?
- Worked exampleFind the binary representation of the decimal number 13.
- Common mistakeWhy isn't binary secretly a harder way of writing the same number as decimal?
Your turn1 of 2
How many distinct values can a binary number with 12 bits represent?ASCII, Unicode, and Text as Bits
- How it worksHow does ASCII map the letter A to the number 65 and every other keyboard key to its own number?
- Worked exampleFind the ASCII decimal value stored for the capital letter H.
- Common mistakeWhy doesn't a computer actually store the letter A as a tiny picture of the letter A?
Your turn1 of 2
In ASCII, the capital letter A has decimal value 65. What decimal value does the capital letter sitting 17 letters after A in the alphabet have (for example, k=2 would be C)?RGB and Representing Color
- Worked exampleFind the RGB values that mix to produce pure yellow on a screen.
- Common mistakeWhy isn't mixing light with red, green, and blue the same as mixing red, yellow, and blue paint?
- Going furtherWhat happens to a color's RGB values as you fade an image toward black?
Your turn1 of 2
A pixel's channel value is 181 out of 255. Fading this channel 40 percent of the way to black multiplies it by 0.6. What is the new value?Abstraction and Black-Box Thinking
- How it worksHow does wrapping a set of steps inside one named block let you reuse them without rethinking them?
- Going furtherWhat happens to a program's readability when it never wraps repeated steps in a block?
- Ties togetherHow does the abstraction inside a Scratch block foreshadow what a function will do in C?
Your turn1 of 2
A block of 8 steps is wrapped into one named block and that named block is called 8 times in a program. How many total step-executions happen across all the calls?Algorithms, Pseudocode, and Running Time
- How it worksHow does writing an algorithm in plain-English pseudocode force you to spell out every step?
- How it worksHow does counting the steps an algorithm takes let you compare two different solutions fairly?
- Worked exampleWalk me through counting the steps a pseudocode algorithm takes to find the biggest number in a list of 5.
- Common mistakeWhy isn't the fastest-looking algorithm on a small list always the fastest one on a huge list?
- Going furtherWhat happens to an algorithm's running time when the size of its input doubles?
Your turn1 of 2
An algorithm that finds the biggest number in a list must examine every element exactly once. How many examinations does it make on a list of 36 numbers?Conditionals and Loops in Scratch
- How it worksHow does an if-else block guarantee that exactly one of its two branches ever runs?
- Common mistakeWhy isn't an if-else block in Scratch just two separate if blocks stuck together?
- Worked exampleWalk me through a Scratch script that makes a cat sprite bounce off the edge of the stage forever.
- Going furtherWhat happens to a loop if the condition inside it can never become true?
Your turn1 of 2
A 'repeat 21' loop in Scratch contains two blocks inside it: move 10 steps, then turn 15 degrees. How many total block-executions happen when the loop finishes?Variables, Events, and Threads in Scratch
- How it worksHow does a variable act like a labeled box that a Scratch script can read from and write to?
- Worked exampleWalk me through a Scratch script that adds 1 to a score variable every time a sprite is clicked.
- Going furtherWhat happens when two Scratch scripts run as separate threads and both touch the same variable at once?
- Ties togetherHow does an event block like when green flag clicked foreshadow how a C program always starts inside main?
Your turn1 of 2
A Scratch score variable starts at 14. A sprite is clicked 33 times, and each click adds 1 to score. What is the score afterward?