Scratch – Introduction to Scratch : Online Course
Create your simple program |
As you know that any long journey begins with a single step. Similarly, if you want to learn any technical language, then you should have basic program knowledge. The first step in learning a programming language would be to write a program that would display the words “Hello World” on the screen. Most programming language courses start with a very simple program called “Hello, World”. This is a simple example that shows what a program looks like and how to output a message. In this way we can gradually master Scratch.
Example 1 – The “Hello World” Project
The simplest script will be added to Scratch Trademark Cat. In this program we have to say hello world only. So for this only one command or block will be required.
A block that allows the sprite to say hello world, i.e. this text will appear in the speech bubble next to the cat. Let’s see the steps.
- Click the Looks Tab.
- Drag the block to the script area from the blocks palette.
- Then, instead of the text Hello, type Hello World and click on the modified block.
- The sprite say the hello world for 2 sec.
- To run the program. You should get the following result
Output:
Example 2 – The “Make a program for the cat to say hello to changing colors with each turn.” Project
To make a program for the cat to say hello to changing colors with each turn. In this program the cat will have to take 100 steps forward and 90 degree turn, with each turn the color of the cat will change. If you want to use this step four times, then you will have to use a repeat loop.
Procedure: Let’s say the steps
- Click the Motion Tab.
- Drag the “move()”block to the script area from the Motion Block Palette.
- Change the value 10 to 100 in the “move()”block.
- After “move()” block, we need a “turn()” block for turn 90 degree.
- Drag the “turn()”block to the script area from the Motion Block Palette.
- Change the degree value 15 to 900 in the “turn()”block.
- After “turn()” block, we need a “say()” block for say something.
- Click the Looks tab.
- Drag the “say()” block to the script area from the looks Block Palette.
- The sprite say the hello world for 2 sec.
- After the “say()” block, we need the “color()” block to change the color of the sprite every turn.
- Drag the “color()” block to the script area from the looks Block Palette.
- After complete all this steps, we required a “repeat()” block to repeat all this steps four time.
- Drag a repeat () block from the Control Block Palette.
- Change the value 10 to 4 in the “repeat()”block.
- To run the program. You should get the following result.
Output:
Scratch: Online Course
आशा करता हूँ, कि यह आर्टिकल आपको पसंद आया होगा तो सोच क्या रहे हैं अभी इसी वक्त इसे अपने दोस्तों के साथ सोशल मीडिया पर Share करें।
Thanking You………………धन्यवाद………………..शुक्रिया………………..मेहरबानी…………………..
Read More