Computer Science Scratch 3.0
Acknowledgements
Academic Authors: Jatinder Kaur, Ayushi Jain, Anuj Gupta, Simran Singh
Creative Directors: Bhavna Tripathi, Mangal Singh Rana, Satish
Book Production: Rakesh Kumar Singh, Sanjay Kumar Goel
Project Lead: Jatinder Kaur
VP, Learning: Abhishek Bhatnagar
All products and brand names used in this book are trademarks, registered trademarks or trade names of their respective owners.
© Uolo EdTech Private Limited
First published 2023
Second published 2024
Third published 2025
This book is sold subject to the condition that it shall not by way of trade or otherwise, be lent, resold, hired out, or otherwise circulated without the publisher’s prior written consent in any form of binding or cover other than that in which it is published and without a similar condition including this condition being imposed on the subsequent purchaser and without limiting the rights under copyright reserved above, no part of this publication may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, without the prior written permission of both the copyright owner and the above-mentioned publisher of this book.
Book Title: Tekie ICSE Computer Science Scratch 3.0 I
ISBN: 978-81-981317-0-6
Published by Uolo EdTech Private Limited
Corporate Office Address:
85, Sector 44, Gurugram, Haryana 122003
CIN: U74999DL2017PTC322986
Illustrations and images: www.shutterstock.com, www.stock.adobe.com and www.freepik.com
All suggested use of the internet should be under adult supervision.
Preface
Standing at the forefront of the digital and AI revolution, the importance of coding and computational skills has reached unprecedented heights. In today’s professional landscape, whether it is in the fields of medicine, space exploration, education, science, or business, no sector remains untouched by this transformative wave. To thrive in the 21st century, basic computer literacy is no longer sufficient. Learners must evolve into “digital natives” who can fluently read, write, and communicate in the languages that machines and AI comprehend. Recognising this imperative, the National Education Policy of 2020 (NEP 2020) has strongly recommended the integration of coding skills, computational thinking, critical analysis, and problem-solving abilities into the curriculum. Moreover, forward-looking subjects like AI, Data Science, Computer Applications, and IT have been introduced as elective subjects from grade 9 onwards. It would not be surprising if further transformative measures are taken even at the elementary education level.
Inspired by these insights, Uolo has introduced an innovative 360-degree program for a codingfocused computer science curriculum, known as Tekie, spanning grades 1 to 8. The program provides an experiential learning approach, going beyond theoretical knowledge. It not only covers theoretical aspects of computer science and coding, but includes hands-on activities and technology-based projects that enable students to experience computer science first hand. The program includes chapters that provide a deeper immersion in computer science that both learners and teachers may find interesting.
This coding book is a part of the larger Tekie program that also includes a main computer science textbook, covering the basics of computing, the latest technologies, and essential computer tools.
In addition to the textbooks, we provide a digital platform where students can actively engage in practical activities and hands-on learning projects. This platform is designed to enhance the learning process by allowing students to experiment and apply their knowledge in a real-world context.
We have meticulously aligned our activities with the guidelines of the National Education Policy (NEP) 2020, which emphasises a holistic approach to learning. This approach is aimed at developing critical thinking, logical reasoning, and practical skills among students. By integrating these elements into our coding program, we aim to prepare students for the future, equipping them with the necessary skills to navigate and excel in the ever-evolving world of technology.
Our mission is to cultivate a passion for coding and computer science among young learners, making the learning process enjoyable and impactful. We are confident that this series will not only help students grasp the fundamentals of coding but also inspire them to explore the endless possibilities that technology offers.
We invite you to embark on this exciting journey of learning and discovery. Let’s empower the next generation with the skills and knowledge they need to thrive in a digital world.
from
It is below the stage and next to the Sprites pane. You can use it to add, upload, edit, or delete backdrops.
Did You Know: Interesting facts related to the topic
Go button and Stop button: The green flag is the Go button. You click it to run the script. The red button is the Stop button. You click it to stop the running script.
Discuss: A multi-faceted probing question related to the concept that arouses curiosity
Code Snippets: Complete code for each activity with output facilitating hands-on learning and immediate feedback
3
Think and Tell
Chapter Checkup
Why do we need to repeat 360 times to draw a full circle?
Think and Tell: Analysis, reflection, and text-to-self connection-based prompts for discussion in class
A Fill in the Blanks.
Do It Yourself 4A 1 What will be the output when you run the given script?
Hints thickness when I start as a clone delete this clone rotation clones is when an object moves around its centre. are the exact same copies of a sprite. The block runs the attached script when a sprite is cloned. block helps us remove a clone when it is no longer needed.
Chapter Checkup
Chapter Checkup: Chapter-end practice exercises aligned to different levels of Bloom’s Taxonomy
Coding Challenge: Hands-on challenges to encourage and actively engage with the concepts learnt throughout the chapter
Fill in the Blanks.
5 The block sets the of the sprite’s pen. F Apply Your Learning.
Apply your learning: Intellectually stimulating questions designed for higher-order thinking and analysis
Test Papers: Designed to evaluate understanding of core concepts and application of skills
Hints thickness when I start as a clone delete this clone rotation clones
1 is when an object moves around its centre.
2 are the exact same copies of a sprite.
3 The block runs the attached script when a sprite is cloned.
4 The block helps us remove a clone when it is no longer needed.
5 The block sets the of the sprite’s pen.
F Apply Your Learning.
1 Shreya is making a project to show the Earth rotating in space. Help her write the script to make the Earth sprite rotate.
5
1
A. Fill in the blanks.
1 Shreya is making a project to show the Earth rotating in space. Help her write the script to make the Earth sprite rotate. A. Fill in the blanks.
Test Paper (Based on Chapters 1 to 5)
1 is a way of giving instructions to tell a computer what to do.
2 The block repeats the instructions inside it forever, unless the Stop button is clicked.
5)
3 A is a character or object that you can move around on the stage and make this object do things.
4 A is a measure of how much you turn.
• Block-based Coding
• Scratch 3.0
• Creating a Project
• Components of Scratch
• Motion
• Looks Blocks
• Events Blocks
• Sound Blocks
• Control Blocks
• Naming a Project
• Deleting a Sprite
• Adding a Sprite
• Positioning a Sprite
• Moving a Sprite
• Pen Extension
• Drawing a Line
• Saving a Scratch Project
•
Introduction to Scratch 3.0 1
Brushing teeth is a good way to keep them healthy. We should brush our teeth twice a day, for 2 minutes each time.
Can you tell me how you brush your teeth? Right! We follow a set of steps to brush our teeth. Here are the steps to brush your teeth:
1 Wet your toothbrush.
2 Put toothpaste on your toothbrush.
3 Brush your teeth for 2 minutes.
4 Spit out the toothpaste.
5 Rinse your mouth with water. These steps are the instructions we follow to brush our teeth. Just like how we use instructions to do something step-by-step, we need to tell computers how to do something step-by-step too.
But computers do not understand our language, so we need to use a special language that they can understand. We call that language coding.
Coding is a way of giving instructions to tell a computer what to do.
We will be using block-based coding to make computers do things for us.
Block-based Coding
Block-based coding is the language in which we use colourful code blocks to tell computers what to do. You must have drawn things on a computer earlier, right? But did you know that you can use block-based coding to make computers draw shapes and other things for you?
We are going to use a block-based coding platform called Scratch 3.0 to make fun drawings.
Scratch 3.0
Scratch 3.0 is a free and simple platform where we use colourful blocks to create our own games, stories, and drawings.
Creating a Project
Now, let us learn to create a blank project.
Follow the given steps to create a project.
1 Click Create.
Did You Know?
Scratch Cat is the official mascot of Scratch because cats are curious and playful animals, just like the children who use Scratch.
2 The Scratch editor opens. By default, the name of a Scratch project is shown as Untitled.
Components of Scratch
The Scratch editor holds all the components needed to create and run a Scratch project.
The components of the Scratch editor are:
1 Menu bar: The purple bar at the top of the Scratch editor is called the Menu bar.
The main parts of the menu bar are:
a File and Edit menus: These let us create, save, and open a project.
b Project name: This space shows the name of your project.
c Folder: Clicking here takes you to your 'My Stuff' page where you can see your saved projects.
2 Sprite: A sprite can be a character or an object in a Scratch project.
3 Tabs: There are three tabs in the Scratch editor:
a Code: This tab has various code blocks to make the sprite move and do things.
b Costumes: This tab opens the Costumes editor where we can change how a sprite looks.
c Sounds: This tab opens the Sound editor to add and make changes to the sound effects of the sprite and to the backdrop.
4 Block panel: This panel has nine colour-coded categories of blocks: We can even add more categories using the Add Extension button.
5 Block palette: This is the area where you can see all the blocks for a selected block category.
6 Script area: The script area is next to the block palette. This is where you drag the blocks to make your sprite do something.
The blocks you put together in the script area are called a Script.
7 Stage: The stage is where you can see backdrops and sprites in action.
8 Sprites pane: The Sprites pane is below the stage. This pane shows all the details of sprites, like their name, location, and size.
9 Backdrop: It is the background of the stage. You can add backdrops from the Scratch library or from your computer.
10 Backdrop pane: It is below the stage and next to the Sprites pane. You can use it to add, upload, edit, or delete backdrops.
11 Go button and Stop button: The green flag is the Go button. You click it to run the script. The red button is the Stop button. You click it to stop the running script.
Discuss What is the difference between the stage and the backdrop?
Do It Yourself 1A
Identify and label the components based on the clues given below.
1 I'm a character in your project.
2 I show you the options to change the name, size, and location of a character.
3 I hold colour-coded categories of blocks.
4 I'm the area where you drag and join the blocks.
5 I hold all the blocks for a block category.
Chapter Checkup
A Fill in the Blanks.
1 In Scratch, we use colourful to create our own games, stories, and drawing.
2 To create a project in Scratch, you need to click .
3 By default, the name of the Scratch project is .
4 The purple bar at the top of the Scratch editor is called the .
5 The background of the stage is called the .
1 What is the name of the area where you can see all the details of sprites?
a Stage b Sprites pane
c Block palette d Script area
2 What do you use to stop your running scripts?
a b c d
3 The tab is used to .
a open the Sound editor b listen to songs
c close the Sound editor d open the Costumes editor
4 Which of the following option has the icon?
a File menu
b Edit menu
c Stage d Costumes tab
5 Which of the following options has this icon?
a Sprites pane b Stage
c Backdrop pane d All of these
How Do I Look? Who Am I?
D Write T for True and F for False.
Script Area Costumes Tab Go button and Stop button Sounds Tab
1 The default project name in Scratch is Project1.
2 You can add and make changes to the sound effects of your sprite and backdrop in the Sound editor.
3 The Go button is used to stop the running project.
4 Events are one of the categories of blocks.
5 The colour of the Go button is green.
E Answer the Following.
1 What is block-based coding?
2 What is the use of the Costumes tab?
4 What is a Script?
5 Describe the Go and Stop buttons.
F Apply Your Learning.
1 Rahul wants to make a project related to a jungle in Scratch. Which background should he use?
2 What is a script in a project?
None of these
3 Sheena wants to change the appearance of the sprite. What should she use?
4 Ritu wants to change the name of the sprite. Where should she go?
b c d
5 Arun wants to change the backdrop of the Stage. Which option should he choose? a b c d
Scratch Blocks 2
In the previous chapter, we learnt about Scratch and the components of the Scratch editor. Now, let us explore the various types of blocks in Scratch.
Scratch blocks are colourful pieces of code that you can drag to tell a computer what to do. Each block represents a unique instruction, like moving a sprite, playing a sound, or changing the background.
Scratch blocks are grouped into categories based on what they do. For example, the Motion blocks are used to control the movement of sprites, whereas the Looks blocks are used to change the appearance of sprites.
Each block category is represented by a different colour. This makes it easy to find the blocks you need when you are creating a program.
Let us learn more about the Scratch blocks.
Motion Blocks
blocks are used to control the movement of the sprites. They are blue in colour.
For example, the block makes this sprite move 10 steps towards the right.
Let us learn about some of the Motion blocks.
Blocks
Description
Moves the sprite forward the specified number of steps. Turns the sprite (clockwise) to the specified value. Turns the sprite (anti-clockwise) to the specified value. Moves the sprite to the specified x and y positions.
Looks Blocks
blocks are used to control how a sprite looks. They are purple in colour. For example, the block will change the boy sprite’s costume from its current costume to Costume 2.
Let us learn about some of the Looks blocks.
Blocks Description
Makes the sprite say the specified text.
Makes the sprite say the specified text for the specified number of seconds.
Makes the sprite think of the specified text.
Makes the sprite think of the specified text for the specified number of seconds. Shows the sprite.
Hides the sprite.
Changes the costume of the sprite to the specified one.
Discuss Difference between the Motion and Looks blocks.
Events Blocks
blocks are used to tell a computer when to run a script to make things happen. They are yellow in colour. An event is something that makes an action happen.
For example, the boy hitting the ball is an event and the ball moving and reaching the net is the action.
Let us learn about some of the Events blocks.
Blocks
Sound Blocks
Description
Runs the script when the green flag (the Go button) is clicked. Runs the script when the sprite is clicked.
blocks are used to control the sound. They are pink in colour.
For example, making the ball sprite play a hitting sound when the boy hits it.
Let us learn about some of the Sound blocks.
Blocks
Control Blocks
Description
Plays a sound and pauses the script until it finishes.
Plays a sound without pausing the script.
Stops all playing sounds.
blocks are used to control the scripts. They are orange in colour.
For example, making a sprite move towards the right 3 times.
Let us learn about some of the Control blocks.
Blocks Description
Pauses the script for the specified number of seconds.
Repeats the instructions inside it a specified number of times. Repeats the instructions inside it forever, unless the Stop button is clicked.
Runs the script for the clone (the copy of a sprite) when it is created.
Creates a clone of the specified sprite. Deletes a clone.
Let us create our first script to move and turn a sprite by using some of these blocks.
1 Click the Events category.
2 Drag the block in the Script area.
3 Click the Motion category.
4 Drag the block to below the block, as shown in the image below.
5 Drag the block to the Script area just below the block, as shown in the image below.
6 Click the button to run the script. The Sprite turns 15 degrees clockwise and then moves forward 10 steps each time you click the button.
We can also change the values in the and blocks to turn by specified degrees and move a specified number of steps at once.
Did You Know?
Scratch is available in more than 40 languages, so kids from all over the world can code in their language!
Do It Yourself 2A
1 Match the columns.
Column A
Column B
Plays a sound and pauses the script until it finishes.
Turns the sprite (clockwise) to the specified value.
Repeats the instructions inside the block specified number of times.
Runs the script when the green flag (the Go button) is clicked.
Pauses the script for the specified time.
2 Tick the correct colour for the Sound blocks in Scratch.
Chapter Checkup
A Fill in the Blanks.
1 are colourful pieces of code that you can drag together to tell a computer what to do.
2 blocks are orange in colour.
3 The block moves the sprite to the specified x and y position.
4 The block runs the script when the is clicked.
5 The block pauses the script for the specified number of seconds.
1 Which block is used to move a sprite?
2 Which block is used to make a sprite turn clockwise?
3 Which block is used to run a script when the sprite is clicked?
4 Which block can pause a script for 10 seconds?
5 Which block can repeat a script 5 times?
C Who Am I?
1 I change the costume of a sprite to a specified one.
2 I delete a clone of a sprite.
3 I repeat the instructions inside forever.
4 I stop all playing sounds.
5 I run the script for a clone when it is created.
D Write T for True and F for False.
1 The Motion blocks in Scratch are used to control the appearance of sprites.
2 Events blocks are used to tell a computer when to run a script.
3 Sound blocks can make a 'hitting' sound when a ball hits a sprite.
4 Each Scratch block stands for a different instruction.
5 You can use a Control block to delete a sprite from your project.
E Answer the Following.
1 What is an event?
2 What is the purpose of the Looks blocks in Scratch?
3 What is the use of the say block? Where can we find this block in Scratch?
4 Which category of Scratch blocks controls sound, and what is the colour of these blocks?
5 What is the purpose of the think for seconds block?
F Apply Your Learning.
1 Reena is making a Scratch project where she needs to move the bear from left to right. Which block should she use?
2 Simran wants to turn her pufferfish clockwise, as shown in the picture. Which block can she use?
3 Arya has a goblin sprite in his project with two different looks, as shown in the picture. Which block can he use to change the current look of the goblin to the other one?
4 Ayan made a project for his father and wants to add sound to it. Which block can he use?
5 Priya wants to make the frog sprite move forward 3 times. Which block should she use?
1
Making a Scratch Project 3
In the previous chapter, we learnt about some of the scratch blocks. Now, we are going to make a Scratch project to draw a line.
Naming a Project
When a new Scratch project gets created, it comes with a default name 'Untitled' and a default cat sprite 'Sprite1'.
To change the default name, click it and replace it with the new name 'Drawing a Line'.
Now, let us recall what a Sprite is.
A Sprite is a character or object that you can move around on the stage and make this object do things.
Before we learn how to add a sprite to our project, we need to remove the cat sprite, as we don’t need it for the project.
Deleting a Sprite
As you know, Scratch Cat is the default sprite in Scratch.
Steps to delete Scratch Cat:
1 Select the sprite to be deleted in the Sprites pane. The button appears.
2 Click the button to delete the sprite.
Adding a Sprite
In Scratch, you can choose to add a sprite from the Sprites pane in four ways:
1 Choose a Sprite: To choose a sprite from the Scratch Sprite Library.
2 Paint: To create a sprite using Paint Editor.
3 Surprise: To add a random sprite.
4 Upload Sprite: To upload a sprite from your computers.
Choosing a Sprite
Now, let us add our first sprite, the Pencil , from the Sprite Library into our project.
Steps to add a sprite from Sprite Library:
1 Click the Choose a Sprite option in the Sprites pane. The Sprite Library opens.
2 Type 'pencil' in the search bar and then click the Pencil sprite.
The Pencil sprite is added to the stage and is also visible in the Sprites pane.
3 Set the Size of the Pencil sprite to 40.
Let us now learn to position our Pencil sprite.
Positioning a Sprite
A position is a place on the stage where you want a sprite to go.
A position on the Scratch stage is made up of two values: x and y.
The x value tells the horizontal (left to right) position of the sprite.
The y value tells the vertical (top to down) position of the sprite.
To set the position of a sprite, you can use the block.
This block makes the sprite go to the position specified by the values of x and y.
Let us make the Pencil sprite go to the centre of the stage when the green flag is clicked.
1 Select the Pencil sprite in the Sprites pane.
2 Click the Events category in the block panel.
3 Drag the block in the script area.
4 Click the Motion category.
6 Set the value of x and y to 0.
Code Output
5 Drag the block to under the block in the script area.
Click the Go button to run your project.
Now, we need to move the Pencil sprite to draw a line.
Moving a Sprite
To move a sprite, you can use the block.
Let us move the pencil sprite 100 steps forward to draw a line.
1 Select the Pencil sprite in the Sprites pane.
2 Click the Motion category in the block panel.
3 Drag the block to under the block in the script area.
4 Set the value of steps to 100.
Code Output
Click the Go button to run your project.
Did the Pencil sprite draw a line when moved forward by 100 steps? No.
To make the Pencil sprite draw a line, use the Pen extension.
Pen Extension
The Pen Extension in Scratch allows sprites to draw on the stage. The Pen blocks are green in colour. They are used to create simple drawings such as lines, shapes, and patterns or more complex drawings such as pictures and animations.
To use the Pen extension, you must first add it to your Scratch project.
Adding the Pen Extension
Steps to add the pen extension:
1 Click the purple Add Extension button in the bottom left corner of the Scratch Editor window.
2 The Extension Library opens up. Click the Pen extension.
The Pen extension is added to the block panel.
Let us learn about some of the Pen blocks.
Blocks Description
Drawing a Line
Tells the sprite to start drawing on the stage.
Tells the sprite to stop drawing on the stage.
Sets the colour of the pen.
Sets the thickness of the pen.
Makes your pen lighter or darker.
Clears all pen marks on the stage.
Now, let us use Pen blocks to make the Pencil sprite draw a line.
Steps to make the Pencil sprite draw a line:
1 Drag the block between the block and the block (before the Pencil sprite starts moving).
2 Drag the block under the block (once the Pencil sprite stops moving).
Code Output
Click the Go button to run your project.
What happens when you run your project again?
Nothing changes.
What should happen?
The older drawing should be removed. To remove the older drawing, we can use the block.
Erasing a Drawing
Steps to erase the old drawing when the green flag is clicked:
1 Click the Pen category in the block panel.
2 Drag the block between the block and the 0 0 block.
Code Output
Click the Go button to run your project.
Did the old drawing get removed or not?
No.
What can be the problem?
The problem is that the new drawing is created so quickly that we cannot see the gap between the old drawing and the new drawing.
To solve the problem, we can use the block. It adds a delay between the erasing of the old drawing and creation of the new drawing.
Adding a Delay
Let us add a delay of 1 second between erasing of the old drawing and creation of the new drawing.
Steps to add a delay of 1 second:
1 Click Control in the block panel.
2 Drag the block between the 0 0 block and the block.
Code Output
Click the Go button to run your project.
The project 'Drawing a Line' is complete. Now, let us learn how to save a project in Scratch.
Saving a Scratch Project
Steps to save a scratch project:
1 Click the File menu in the Menu bar.
2 Click Save now.
Opening an Existing Scratch Project
All the projects you create get saved in the My Stuff folder.
Steps to open a Scratch project from the My Stuff folder:
1 Click the My Stuff folder icon in the top-right corner of the Menu bar.
All your saved projects appear.
2 Go to the project you want to open.
3 Click the corresponding See inside button.
The particular project opens up in the Scratch Editor window.
Discuss
What happens when you click the green flag in a Scratch project that does not have any code attached to it?
Do It Yourself 3A
1 Identify the missing code block in the given script.
2 What does the block do?
a Tells the sprite to stop drawing
b Tells the sprite to start drawing
c Changes the colour of the sprite’s pen
d None of these
Chapter Checkup
A Fill in the Blanks.
Hints pen up draw pen down erase all sprite
1 A is a character or object that you can move on the stage and make it do things.
2 To start drawing a line, you need to use the block.
3 The Pen extension allows sprites to on the stage.
4 To stop drawing a line, you need to use the block.
5 To erase all pen marks on a screen, you need to use the block.
B Tick () the Correct Option.
1 What extension do you need to make the sprite draw?
a Video
c Music
2 What block can be used to add delay?
Pen
Text
3 Which block can be used to set the colour of the sprite’s pen?
4 What does the block do?
a Turns the pen feature off inside a sprite
b Stops drawing
c Starts drawing
d Changes the pen colour
C Who Am I?
What I Do?
Performs different actions on stage.
Makes your pen lighter or darker.
Moves the sprite to the specified x and y values.
Clears all pen marks on the screen.
Sets the colour of the sprite’s pen.
D Write T for True and F for False.
Who Am I?
1 The set pen colour to block sets the thickness of the pen.
2 The erase all block adds delay to the script.
3 The x value tells the vertical (top to down) position of the sprite.
4 The Pen extension allows sprites to draw.
5 To save a Scratch project, you should click the File menu and then select Save now.
E Answer the Following.
1 What is a sprite?
2 Write any two ways to add a sprite to your project.
3 What is the use of the pen blocks?
4 What is the difference between the pen down and pen up blocks?
5 Which block is used to move a sprite to a specific position, and where can we find it?
F Apply Your Learning.
1 Rahul added a cat sprite to his Scratch project. Can you tell where will the sprite be visible now?
2 What code block can Rohit use to make a sprite move by 300 steps?
3 Imagine the girl sprite is 200 steps away from the boy sprite. Write down the script to make the ball reach the girl when the green flag is clicked.
4 Ritu wants to revisit one of her old Scratch projects. How can she do that?
1
Drawing Shapes 4
In the previous chapter, we learnt about pen blocks and how to make a sprite draw a line. Now, we will learn to draw more shapes using the pen extension.
First, we will learn to draw a square. Do you know what a square is?
A square is a 2D shape with four sides and four corners. All sides of a square are of the same length.
Imagine you are walking in a square in a garden. How would you do it?
To walk in a square, you would walk straight for a few steps, then turn, then walk straight for the same number of steps, and then turn again. You would do this four times to make a square.
But what is a turn?
A turn is a change in the direction you are walking, either clockwise or anti-clockwise.
Just like you use measuring units centimetre and metre to measure a length, you can use a unit called degrees to measure how much you turn.
To make a square, you need to turn 90 degrees four times.
A degree is a measure of how much you turn.
Did You Know?
The Rubik’s Cube is a square-shaped puzzle with nine squares on each side.
Drawing a Square
Let us look at the steps to draw a square.
1 Move forward 100 steps.
2 Turn 90 degrees to the right.
3 Move forward 100 steps.
4 Turn 90 degrees to the right.
5 Move forward 100 steps.
6 Turn 90 degrees to the right.
7 Move forward 100 steps.
8 Turn 90 degrees to the right.
In the given steps, do you observe a pattern?
Right! We are repeating steps 1 and 2 four times.
Now, observe the following:
Repeat the following steps 4 times:
1 Move forward 100 steps.
2 Turn 90 degrees to the right.
Which of the two ways looks simple, easy, and quick to make a script?
The second way, right?
But how can we do this in Scratch?
For this, we need to learn about loops.
A loop is doing something again and again to complete a task. We have the block that repeats the instructions in it for the given number of times.
We will use the script we made for 'Drawing a Line' and add more code blocks to draw a square.
Steps to draw a square:
1 Select the Pencil sprite.
2 Detach the and blocks from the script. But keep them in the script area.
3 Click the Motion in the block panel.
4 Drag the repeat block to under the block.
5 Change the number of times to 4.
6 Drag the block to inside the repeat 4 block.
7 Drag the block to below the repeat 4 block.
8 Drag the block to below the block inside the repeat 4 block.
9 Change the value of degrees to 90.
Code
Output
Click the Go button to run your project.
What
happens when you run your project?
The Pencil sprite moves quickly and draws the square. It is tough to see how the Pencil sprite turns and when. We can make the Pencil sprite pause on a turn by adding a delay.
Steps to add a delay of 1 second:
1 Click the Control in the block panel.
2 Drag the block to after the block inside the repeat block.
Code Output
Click the Go button to run your project.
We have completed the script to draw a square. Save this project with the name 'Drawing a Square'.
Next, we will learn to draw a circle.
Discuss How is a loop helpful to draw a square?
Drawing a Circle
A circle is a round shape with no corners or sides.
Imagine you are standing in the middle of a circle.
360o 180o
If you turn around all the way, you have turned 360 degrees.
If you turn halfway around, you have turned 180 degrees.
But to make a complete circle, we need to walk around the circle 360 steps, turning 1 degree with each step.
We will use the script we made for a square and make some changes to draw a circle.
Steps to draw a circle:
Did You Know?
The equator is an imaginary line that encircles the Earth horizontally in the middle.
1 Drag the block inside the repeat block to the block palette to remove it.
2 Change the value of the repeat block from 4 to 360 to make a full circle.
3 Change the number of steps in the block from 100 to 1.
4 Change the value of degrees in the block from 90 to 1.
Code Output
Think and Tell Do It Yourself 4A
Click the Go button to run your project.
Why do we need to repeat 360 times to draw a full circle?
1 What will be the output when you run the given script?
2 What will be the output when you run the given script?
a b c d
Chapter Checkup
A Fill in the Blanks.
Hints 90 4 square turn corners sides
1 A is a 2D shape with four sides of the same length.
2 A is to change the direction you are walking in.
3 A circle is a round shape with no or .
4 The code inside the block repeats times.
5 To make a square, we need to turn degrees four times.
B Tick () the Correct Option.
1 The given code block is an example of which block category? a Control b Events c Motion d Pen
2 How many move blocks do you need to create the given figure without loop?
3 Identify the shape of the carrom board.
a Circle b Square
c Triangle d Rectangle
4 What is the value of x in the given script?
a 0 b 100
c 50 d 20
C Who Am I?
Code Block
D Write T for True and F for False.
1 A circle is a shape with four equal sides.
2 You need to turn 1 degree 360 times to make a square.
3 A degree is a measure of how much you turn.
4 To add a pause or delay in a sequence of actions, you can use the 'wait' block.
E Answer the Following.
1 What is a turn?
2 What is a square?
3 How many times will the move block be used to draw a circle without the repeat block?
4 How many degrees do we need to turn to make a semi-circle?
F Apply Your Learning.
1 Arya has made a project to make his sprite run a circle shaped track, but the sprite is not completing the track. What is wrong in the script?
Code
2 Shaurya wants to make the knight reach the horse who is 100 steps away. On which sprite does he need to add the script? Write the script to make the knight reach the horse.
3 Riya is making a project where the flying cat sprite will play with the flying hippo sprite. Help her write a script to make the flying cat draw a line.
4 Rayan wants to make a ball move around a square with sides that are 200 steps long. Help him write a script to make the ball move in a square.
1
Drawing a Pattern 5
In the previous chapter, we learnt how to draw a square and a circle using the Pen extension. Now, we will learn how to draw a pattern by making a sprite rotate.
Do you know what rotation is?
Rotation is when an object moves around its centre. Like a spinning top!
Did You Know?
Think and Tell
Can you think of some objects that spin or turn around their centre?
Let us learn to rotate a sprite.
Rotating a Sprite
Steps to rotate a sprite are:
1 Select the Cat sprite in the Sprites pane.
The Earth spins around its centre once every 24 hours, causing day and night.
2 Drag the block from the Events blocks to the script area.
3 Drag the block from Motion blocks to under the block in the script area.
4 We use the block to make a sprite go to the centre of the stage.
There is another block that helps us move a sprite to any random position. A random position can be any place on the stage.
5 Click the Add Extension button to add the Pen blocks to the block panel.
6 Drag the block from the Pen blocks to under the block in the script area.
7 Drag the block from the Control blocks to under the block in the script area. Change the value inside the repeat block to 400.
8 Click the Motion in the block panel.
9 Drag the block from the Motion blocks inside the block in the script area. Change its value to 57. The cat rotates on its location when you click the Go button or the green flag. Now, we will learn to make clones of the cat sprite when it rotates.
Creating a Clone
Clones are the exact copies of a sprite.
We can make copies of a sprite using the Sprites pane, but what if we need to make 100 copies of a sprite? It will take a long time, and tracking 100 sprites will be difficult.
But there is a quick way to make many copies of a sprite without the need to track a list of 100 sprites. This way is called cloning.
Cloning is making copies of a sprite without tracking a list of sprites.
Did You Know?
Many toy companies use toy moulds to make clones of their toys.
There are three clone blocks in Scratch:
Blocks
Description
Creates a clone of the specified sprite.
Runs the attached script when a sprite is cloned. Deletes the clone that is running the script and stops all its scripts.
Steps to create the clone of a sprite:
1 Click Control in the block panel.
2 Drag the block under the block, inside the repeat block in the script area.
3 Click the Go button.
Observe that multiple clones of the cat sprite are created on the stage.
What happens when you run the project?
When the cat sprite rotates, many of its copies are created during the rotation.
Discuss
How is creating clones of a sprite better than duplicating a sprite?
This means that the clones are created but not doing anything.
Now, let us make these cloned cat sprites move and rotate to create an amazing pattern.
Drawing a Pattern
Steps to draw a pattern:
1 Select the cat sprite in the Sprites pane.
2
Drag the block from the Control blocks to the script area.
3 Drag the block under the block. Change the number of times to 40.
4 Drag the block inside the repeat block.
5 Drag the block from the Motion blocks to under the block.
6 Drag the block under the block, inside the repeat block.
Click the block multiple times to see how a clone is created that moves and rotates with each click.
What happens when you run the project?
It creates clones of the cat sprite and makes them move and rotate. In the end, all the clones rest behind the cat sprite.
But we can remove the sprites when they are no longer needed using the block.
We made a pattern using the cat sprite.
Next, we will draw the pattern the cat sprite made but with pen blocks.
To do so, we need a blank sprite. Let us learn how to make a blank sprite.
Creating a Blank Sprite
Steps to make a blank sprite:
1 Select the cat sprite.
2 Click the Costumes tab.
3 Select the Paint option to add a blank costume for the cat sprite. The blank costume appears in the costumes list.
4 Select the cat costumes one by one and then click the Delete button to delete the cat costumes, leaving only the blank costume.
Drawing a Pattern
Now, let us add pen blocks in the script to draw a pattern using the blank sprite.
Steps to draw a pattern using pen blocks:
1 Drag the block from the Control blocks to the script area.
2 Drag the block from Pen blocks and place it under the block.
3
4
5
6
7
Drag the block under the block in the script area. Change the colour of the pen.
Drag the block under the block in the script area. Change the value of the pen size to 5.
Drag the block under the block in the script area.
Drag the block under the block from the Control blocks.
Drag another repeat block and then change the value inside this block to 4.
8 Click Motion in the block panel. Drag the block inside the block. Change the value of steps to 100.
9
10
Drag the block below the block. Change the value of degrees to 90.
Drag the block below the block inside the repeat block.
11 Now, drag the block below the block. Change the value of steps to 50.
12 Drag the block below the block. Change the value of the degrees to 36.
A colourful pattern of square shapes is created on running the script.
Discuss When do we need a blank sprite?
Do It Yourself 5A
1 Find the given words in the word puzzle. Words can be found in any direction, including up, down, left, and right.
Hints
2 Colour the pattern.
Coding Challenge
Make clones of the Donut sprite so that they appear at various positions on the stage.
Hint
You can use the motion block to make clones of the donut sprite appear at a random position.
Chapter Checkup
A Fill in the Blanks.
Hints thickness when I start as a clone delete this clone rotation clones
1 is when an object moves around its centre.
2 are the exact same copies of a sprite.
3 The block runs the attached script when a sprite is cloned.
4 The block helps us remove a clone when it is no longer needed.
5 The block sets the of the sprite’s pen.
B Tick () the Correct Option.
1 Why is cloning useful when working with sprites?
a It changes the colour of the sprite.
b It creates random variations of the sprite.
c It allows you to make multiple copies without tracking each copy separately.
d It makes the sprite disappear.
2 How can we rotate a sprite in Scratch?
a By using the 'turn' block
b By using the 'rotate' block
c By using the 'spin' block
d By using the 'move' block
3 How can we create a blank sprite in Scratch?
a By using the Surprise option
b By using the Choose a costume option
c By using the Paint option
d By using the Upload option
4 What will the given script do?
a Move the clone to the centre of the stage.
b Make the clone invisible.
c Delete the clone.
d Make the clone wait for a specified number of seconds.
C Who Am I?
What I Do?
Make the sprite turn around by specified degrees.
Create a clone of the specified sprite.
Delete the clone.
Change the colour of the pen.
D Write T for True and F for False.
Who Am I?
1 Cloning can create only a single copy of a sprite.
2 Deleting the costume of a sprite deletes the sprite itself.
3 Cloning in Scratch creates exact copies of sprites.
4 The Go button is used to run a project.
5 You can move a sprite to any random position on the stage.
E Answer the Following.
1 What is rotation? Give an example.
2 What happens if you change the value of the 'turn' block?
3 What happens if you clone the cat sprite while it is turning?
4 Name the three clone blocks in Scratch.
5 Which block is used to make the clones disappear on the stage?
F Apply Your Learning.
1 Shreya is making a project to show the Earth rotating in space. Help her write the script to make the Earth sprite rotate.
2 Tina has made a project to make her sprite rotate, but the sprite is not rotating. What is wrong in the given script?
3 Sheena wants to draw a pattern with various colours. Name the block that can help her do so.
4 What will happen to the dove sprite when you run the given script?
Test
A. Fill in the blanks.
1 is a way of giving instructions to tell a computer what to do.
2 The block repeats the instructions inside it forever, unless the Stop button is clicked.
3 A is a character or object that you can move around on the stage and make this object do things.
4 A is a measure of how much you turn.
B. Tick () the correct option.
1 The purple bar at the top of the Scratch editor is called the .
a Menu bar
c Tabs
b Scripts area
d Block palette
2 blocks are used to control the scripts.
a Motion
c Control
3 What does the pen down block do?
a Turns the pen feature
b Looks
d Sound
b Stops drawing off inside a sprite
c Starts drawing
C. Write T for True and F for False.
d Changes the pen colour
1 The Backdrop pane is above the stage and next to the Sprites pane.
2 The Say block makes the sprite say the specified text.
3 The Pen Extension in Scratch allows sprites to draw on the stage.
4 All sides of a square are of the same length.
D. Answer the following questions.
1 What is block palette?
2 What is the use of motion blocks?
3 Write the four ways you can choose to add a sprite from the Sprites pane.
4 What is a turn?
E. Apply your learning.
1 Rahul wants to delete the default sprite from his Scratch project. Help him do so.
2 Anjali is making a Scratch project where she needs to move the sprite from left to right. Which block should she use?
About the Book
This coding book is supplementary to the main “Mel and Conji” content book. This book represents a 21st-century approach to learning coding concepts and developing computational thinking and problem-solving skills. To prepare students for the digital age, the curriculum is interwoven with well-thought-out concept progression, real-life examples, and practice problems.
Special Features
• Project-based learning: Engaging hands-on projects encouraging practical application of computer science and coding.
• Code snippets: Complete code for each activity with output facilitating hands-on learning and immediate feedback.
• Coding challenges: Includes projects through which learners can demonstrate their learning outcomes in coding and computer science.
• Test Papers: Designed to evaluate understanding of core concepts and application of skills.
About Uolo
Uolo partners with K-12 schools to provide technology-enabled learning programs. We believe that pedagogy and technology must come together to deliver scalable learning experiences that generate measurable outcomes. Uolo is trusted by over 15,000+ schools across India, Southeast Asia, and the Middle East.
hello@uolo.com
ISBN 978-81-981317-0-6