0% found this document useful (0 votes)
61 views10 pages

Scratch Programming for Class 9 Students

The document provides an overview of Scratch, a block-based visual programming language developed by MIT, designed to help students learn programming through interactive blocks. It details the Scratch interface, including its components and coordinate system, as well as the nine categories of blocks used for various programming functions. Additionally, it includes examples of arranging blocks to create scripts and highlights important programming concepts such as loops, conditions, and events.

Uploaded by

gtf22t2bm2
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views10 pages

Scratch Programming for Class 9 Students

The document provides an overview of Scratch, a block-based visual programming language developed by MIT, designed to help students learn programming through interactive blocks. It details the Scratch interface, including its components and coordinate system, as well as the nine categories of blocks used for various programming functions. Additionally, it includes examples of arranging blocks to create scripts and highlights important programming concepts such as loops, conditions, and events.

Uploaded by

gtf22t2bm2
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SAGARMATHA S. B.

SCHOOL
CLASS 9 – COMPUTER SCIENCE (Optional)
CHAPTER: SCRATCH PROGRAMMING (Nepal CDC Curriculum)

1. Introduction to Scratch

Scratch is a block-based visual programming language developed by MIT (Massachusetts


Institute of Technology).
It helps students learn programming through colorful blocks that fit together like puzzle pieces.

Instead of typing code, users drag and connect blocks to make programs — this helps to create
animations, stories, games, and projects easily.

Main Features of Scratch


• It is free, easy, and visual.
• Drag-and-drop interface (no syntax errors).
• Helps beginners learn coding logic.
• Works online or offline (using Scratch Desktop).
• Allows animation, sound, interaction, and creativity.
• Uses sprites and backdrops instead of text commands.

2. Scratch Interface

The main parts of the Scratch interface are:

Component Description

Stage The main area where sprites perform.


Sprite The objects or characters that
perform actions.
Blocks Palette Contains all code blocks grouped by
category.
Script Area Workspace where you drag and
connect blocks to form a program.
Backdrop The background design of the stage.
Sprite List Shows all sprites in your project.
Green Flag Starts the script.
Stop Button Stops the script.

3. Coordinate System in Scratch

The stage uses x (horizontal) and y (vertical) coordinates.


• The center of the stage is (0, 0)
• Right side is positive X, left side is negative X
• Top is positive Y, bottom is negative Y

4. Categories of Blocks in Scratch

Scratch has 9 main block categories, each with a different color.

1. Motion Blocks

Used to move the sprite.

Example Description
move 10 steps Moves the sprite 10 steps forward
turn 15 degrees Turns the sprite clockwise
go to x:0 y:0 Moves to specific position
glide 1 sec to x:50 y:50 Moves smoothly
if on edge, bounce Bounces back when hitting edge

2. Looks Blocks

Used to change sprite’s appearance.

Example Description
say “Hello” for 2 seconds Displays a message
think “Hmm…” Displays thought bubble
switch costume to next costume Changes sprite’s costume
change color effect by 25 Changes sprite’s color
show / hide Makes sprite visible or invisible

3. Sound Blocks

Used to play or control sound.

Example Description
play sound meow Plays a sound
stop all sounds Stops playing sounds
change volume by 10 Increases sound
set volume to 100% Sets sound volume

4. Events Blocks

Used to start scripts and handle actions.


Example Description
when green flag clicked Starts program
when space key pressed Runs when key is pressed
when sprite clicked Runs on sprite click
broadcast message1 Sends a message to other scripts

5. Control Blocks

Used for looping and decision making.

Example Description
wait 1 second Delays for given time
repeat 10 Repeats block 10 times
forever Runs repeatedly
if then Executes when condition is true
if then else Executes one block if true, another if
false
repeat until Repeats until condition becomes true
stop all Stops all running scripts

6. Sensing Blocks

Used to detect conditions and interactions.


Example Description
touching mouse-pointer? Checks collision
key space pressed? Detects key press
ask “What is your name?” and wait Takes user input
mouse down? Checks mouse click
distance to mouse-pointer Measures distance

7. Operators Blocks

Used for math, logic, and string operations.

Example Description
5+3 Adds values
10 > 5 Comparison
pick random 1 to 10 Random number
join “Hello” “World” Combines text
not Reverses condition

8. Variables Blocks

Used to store and display data.

Example Description
set score to 0 Creates or resets variable
change score by 1 Increases or decreases variable
show variable score Displays variable
hide variable score Hides variable

9. My Blocks

Used to make custom blocks (user-defined functions).

Example Description
define jump Creates a new block
jump Runs defined custom code

5. Arrange the Blocks (Very Important for Exams)

You must arrange the blocks in correct order to make a working script.

Here are some common examples with correct answers

Example 1 – Moving Sprite Continuously

Arrange these blocks:

move 10 steps
forever
when green flag clicked
if on edge, bounce

Correct Order:

when green flag clicked


forever
move 10 steps
if on edge, bounce

Example 2 – Making Sprite Say “Hello”

Arrange:

say "Hello!" for 2 seconds


when sprite clicked

Answer:

when sprite clicked


say "Hello!" for 2 seconds

Example 3 – Asking and Answering Question

Arrange:

say (join "Hello " answer)


when green flag clicked
ask "What is your name?" and wait

Answer:

when green flag clicked


ask "What is your name?" and wait
say (join "Hello " answer)

Example 4 – Variable Score Adding


Arrange:

if touching ball then


change score by 1
when green flag clicked
forever

Answer:

when green flag clicked


forever
if touching ball then
change score by 1

Example 5 – Playing Sound with Key

Arrange:

when space key pressed


play sound meow

Answer:

when space key pressed


play sound meow

6. Example Projects

Example 1: Moving Cat

when green flag clicked


forever
move 10 steps
if on edge, bounce

Example 2: Talking Cat

when sprite clicked


say "Hello Students!" for 2 seconds
play sound meow

Example 3: Counting Score

set score to 0
forever
if touching ball then
change score by 1

7. Important Concepts

Concept Meaning
Loop Repeats actions (repeat, forever)
Condition Checks a situation (if, if-else)
Event Starts actions (green flag, key press)
Variable Stores data (like score, time)
Broadcast Sends message to control multiple
sprites

Summary Table

Topic Key Point


Scratch Visual programming by MIT
Interface Stage, Sprite, Backdrop, Script Area
Total Block Types 9 categories
Variable Used to store values
Forever Repeats endlessly
Repeat Repeats for a fixed number of times
Broadcast Sends message between sprites
Event Starts a script
Arrange the Blocks Tests correct logical sequence
Cloning Creates duplicate of sprite
Extension Adds pen, music, or sensing features
By Hemant Pokhrel

Common questions

Powered by AI

Symbolic logic blocks for conditions in Scratch provide a visual way to construct logical statements, reducing cognitive load associated with syntax and allowing learners to focus on logic development. This visual representation helps demystify conditional operators, making it easier for beginners to understand and apply logical concepts without syntax distractions found in text-based languages .

Broadcasting in Scratch allows different sprites to communicate with each other by sending and receiving messages, which can trigger actions or scripts in response. This enhances interactivity as it enables coordinated behaviors and complex sequences in projects with multiple sprites, making it easier to manage scenarios where concurrent actions or synchronizations are needed .

'My Blocks' in Scratch enables users to create custom blocks that encapsulate a sequence of commands as a single unit. This feature is pivotal for complex project development as it promotes code reusability, modularity, and abstraction, allowing users to manage complexity by breaking down tasks into simpler, reusable components .

The coordinate system in Scratch, centered at (0, 0), allows precise control over sprite positioning and movement, which is crucial for designing animations and games. By understanding this system, users can create dynamic interactions and ensure sprites move predictably across the stage, enabling complex behaviors and visually rich animations .

Integrating sound blocks in Scratch projects enhances user experience by adding an auditory dimension that complements visual animations and actions. This multisensory approach increases engagement, aids in storytelling, and provides auditory feedback, which can be crucial for making interactive and immersive projects .

Using 'forever' and 'repeat' blocks helps learners understand the concepts of loops and iterative processes, enhancing their ability to solve problems by recognizing patterns and decomposing tasks into manageable parts. This promotes computational thinking, allowing users to design repetitive tasks efficiently and logically .

The drag-and-drop interface in Scratch eliminates syntax errors commonly found in traditional text-based programming languages because it uses predefined blocks that fit together like puzzle pieces, ensuring that only valid constructs can be formed. This visual nature helps beginners focus on learning programming logic without the distraction of syntax issues .

Scratch supports creative expression by allowing users to design animations, stories, and projects using sprites and backdrops combined with various visual effects. This encourages creativity and experimentation, providing an engaging platform for education that can enhance motivation, imaginative thinking, and learning through exploration and play .

Sensing blocks in Scratch detect various interactions like mouse clicks, key presses, and collisions, facilitating the design of interactive projects that respond to user inputs. This interactivity enables learners to understand event-driven programming by creating responsive behaviors that react to user actions, thereby deepening comprehension of input handling and program dynamics .

Variables in Scratch provide a means to store and manipulate data, which aids users in understanding fundamental programming concepts like state management and data persistence. By visualizing data changes through variables, learners can grasp the utility of dynamic state changes in programs, enhancing their conceptual understanding of how programs are structured and executed .

You might also like