mini scratch unit
DESCRIPTION
Lecture notes for mini-Scratch unit for middle school mathTRANSCRIPT
![Page 1: Mini Scratch Unit](https://reader036.vdocument.in/reader036/viewer/2022062404/554e317cb4c90518468b46f3/html5/thumbnails/1.jpg)
Intro to Programming
Algebra-Geometry
![Page 2: Mini Scratch Unit](https://reader036.vdocument.in/reader036/viewer/2022062404/554e317cb4c90518468b46f3/html5/thumbnails/2.jpg)
Computer Programming?
What is programming? The process of writing, testing, and maintaining
the source code of computer programs. Telling the computer what to do
Why learn to program? Develops logic and problem-solving skills Improves attention to detail It’s fun!
![Page 3: Mini Scratch Unit](https://reader036.vdocument.in/reader036/viewer/2022062404/554e317cb4c90518468b46f3/html5/thumbnails/3.jpg)
But I’m Not a Geek!
Until recently, programming required knowledge of computer language syntax
![Page 4: Mini Scratch Unit](https://reader036.vdocument.in/reader036/viewer/2022062404/554e317cb4c90518468b46f3/html5/thumbnails/4.jpg)
Anyone Can Program!
New tools, like Scratch, allow ANYONE to create computer programs without learning complicated syntax.
![Page 5: Mini Scratch Unit](https://reader036.vdocument.in/reader036/viewer/2022062404/554e317cb4c90518468b46f3/html5/thumbnails/5.jpg)
Programming with Scratch
Open Scratch from either the desktop icon or Start Menu
![Page 6: Mini Scratch Unit](https://reader036.vdocument.in/reader036/viewer/2022062404/554e317cb4c90518468b46f3/html5/thumbnails/6.jpg)
![Page 7: Mini Scratch Unit](https://reader036.vdocument.in/reader036/viewer/2022062404/554e317cb4c90518468b46f3/html5/thumbnails/7.jpg)
Homework
Make sure you have the latest version of Scratch installed on your Tablet PC
Finish working through the Scratch Getting Started Guide
Feel free to experiment and explore!
![Page 8: Mini Scratch Unit](https://reader036.vdocument.in/reader036/viewer/2022062404/554e317cb4c90518468b46f3/html5/thumbnails/8.jpg)
Scratch Syntax: Part 1
Algebra-Geometry
![Page 9: Mini Scratch Unit](https://reader036.vdocument.in/reader036/viewer/2022062404/554e317cb4c90518468b46f3/html5/thumbnails/9.jpg)
Statements
In programming, a statement is simply a directive that tells the computer to do something. Think of it as a command or an instruction.
In Scratch, any block whose label reads like a command is a statement.
![Page 10: Mini Scratch Unit](https://reader036.vdocument.in/reader036/viewer/2022062404/554e317cb4c90518468b46f3/html5/thumbnails/10.jpg)
Boolean Expressions
Sometimes, you only want a statement to be executed under certain conditions. Such conditions are defined in terms of Boolean expressions.
In programming, a Boolean expression is an expression that is either true or false. In Scratch, any block shaped like an elongated diamond is a Boolean expression.
![Page 11: Mini Scratch Unit](https://reader036.vdocument.in/reader036/viewer/2022062404/554e317cb4c90518468b46f3/html5/thumbnails/11.jpg)
Boolean Expressions
One such block is:
After all, it is either true that the mouse button is down or it is false.
Another such block is:
After all, it is either true that some number is less than another number or it is false.
With Boolean expressions can we construct conditions.
![Page 12: Mini Scratch Unit](https://reader036.vdocument.in/reader036/viewer/2022062404/554e317cb4c90518468b46f3/html5/thumbnails/12.jpg)
Conditions
In programming, a condition is something that must be true in order for something to happen.
A condition is thus said to "evaluate to true" or "evaluate to false."
In Scratch, any block whose label says "if," "when," or "until" is a sort of conditional construct.
![Page 13: Mini Scratch Unit](https://reader036.vdocument.in/reader036/viewer/2022062404/554e317cb4c90518468b46f3/html5/thumbnails/13.jpg)
Conditions
If Construct: Instruct a sprite to say hello only if, say, the user has depressed the mouse button:
If-Else Construct: Instruct a sprite to say hello or goodbye, depending on whether the user has depressed the mouse button:
![Page 14: Mini Scratch Unit](https://reader036.vdocument.in/reader036/viewer/2022062404/554e317cb4c90518468b46f3/html5/thumbnails/14.jpg)
Conditions
When Construct: Instruct a sprite to do something when an event occurs:
When Construct: Instruct a sprite to wait to do something until a condition is true:
![Page 15: Mini Scratch Unit](https://reader036.vdocument.in/reader036/viewer/2022062404/554e317cb4c90518468b46f3/html5/thumbnails/15.jpg)
Loops
In programming, a loop can induce multiple executions of statements.
In Scratch, any block whose label begins with "forever" or "repeat" is a looping construct.
![Page 16: Mini Scratch Unit](https://reader036.vdocument.in/reader036/viewer/2022062404/554e317cb4c90518468b46f3/html5/thumbnails/16.jpg)
Follow Me
Follow Me applet
![Page 17: Mini Scratch Unit](https://reader036.vdocument.in/reader036/viewer/2022062404/554e317cb4c90518468b46f3/html5/thumbnails/17.jpg)
Homework
Complete the Cat Walk Project You may wish to use the Scratch Reference
Guide and the Programming Concepts Handout as resources
Completed projects need to be submitted via Interact by the due date.
![Page 18: Mini Scratch Unit](https://reader036.vdocument.in/reader036/viewer/2022062404/554e317cb4c90518468b46f3/html5/thumbnails/18.jpg)
Scratch Syntax: Part 2
Algebra-Geometry
![Page 19: Mini Scratch Unit](https://reader036.vdocument.in/reader036/viewer/2022062404/554e317cb4c90518468b46f3/html5/thumbnails/19.jpg)
Variables
In programming, a variable is a placeholder for some value, much like x and y are popular variables in algebra.
In Scratch, variables are represented with blocks shaped like elongated circles, uniquely labeled by you.
![Page 20: Mini Scratch Unit](https://reader036.vdocument.in/reader036/viewer/2022062404/554e317cb4c90518468b46f3/html5/thumbnails/20.jpg)
Threads
In programming, a thread is like a mini-program within a program that can execute at the same time as other threads.
In Scratch, any block whose label begins with "when" essentially demarks the start of a thread.
![Page 21: Mini Scratch Unit](https://reader036.vdocument.in/reader036/viewer/2022062404/554e317cb4c90518468b46f3/html5/thumbnails/21.jpg)
Events
An event is a signal from one thread to another.
Blocks whose labels begin with "broadcast" signal events whereas blocks whose labels begin with "when" handle events.
![Page 22: Mini Scratch Unit](https://reader036.vdocument.in/reader036/viewer/2022062404/554e317cb4c90518468b46f3/html5/thumbnails/22.jpg)
Pac Man and Pong
Games like Pac Man use Threads
A Variable could be added to Pong
![Page 23: Mini Scratch Unit](https://reader036.vdocument.in/reader036/viewer/2022062404/554e317cb4c90518468b46f3/html5/thumbnails/23.jpg)
Homework
Complete the Tweak a Game Project Remember that the video tutorials can be
very helpful Completed projects need to be submitted via
Interact by the due date. Don’t forget to include your brief written summary!
![Page 24: Mini Scratch Unit](https://reader036.vdocument.in/reader036/viewer/2022062404/554e317cb4c90518468b46f3/html5/thumbnails/24.jpg)
Scratch Syntax: Your First Game
Algebra-Geometry
![Page 25: Mini Scratch Unit](https://reader036.vdocument.in/reader036/viewer/2022062404/554e317cb4c90518468b46f3/html5/thumbnails/25.jpg)
Adding a Level
Levels can be added using threads and events.
![Page 26: Mini Scratch Unit](https://reader036.vdocument.in/reader036/viewer/2022062404/554e317cb4c90518468b46f3/html5/thumbnails/26.jpg)
Copter Game Flight Code
![Page 27: Mini Scratch Unit](https://reader036.vdocument.in/reader036/viewer/2022062404/554e317cb4c90518468b46f3/html5/thumbnails/27.jpg)
Copter Game—One Level
![Page 28: Mini Scratch Unit](https://reader036.vdocument.in/reader036/viewer/2022062404/554e317cb4c90518468b46f3/html5/thumbnails/28.jpg)
Homework
Complete the Your First Game Project You may wish to use the Copter Game and
Levels program as resources Completed projects need to be submitted via
Interact by the due date.