1. What is Block Programming?
Block programming is a way of writing computer programs by joining colorful blocks together instead of typing code. Each block represents a command or instruction. Example: Scratch, ScratchJr, Blockly, MIT App Inventor
2. Why Use Block Programming?
- Easy to learn - No typing errors - Fun and colorful - Helps develop logical thinking - Makes coding simple for beginners
3. Features of Block Programming
- Uses drag-and-drop blocks - Easy to understand - No need to memorize programming syntax - Shows results immediately - Good for making games, stories, and animations
4. Advantages of Block Programming
- Easy for beginners - Reduces coding mistakes - Improves creativity - Develops problem-solving skills - Makes programming enjoyable
5. Disadvantages of Block Programming
- Limited for very complex programs - Not suitable for professional software development - Fewer advanced programming features
6. Common Uses of Block Programming
- Creating animations - Making games - Designing interactive stories - Learning programming concepts - Developing logical thinking
7. What is Scratch?
Scratch is a free block-based programming language developed by MIT (Massachusetts Institute of Technology). It allows users to create games, animations, stories, quizzes, and simulations without typing programming code.
8. Main Parts of Scratch
1. Menu Bar 2. Toolbar 3. Stage 4. Sprite 5. Sprite List 6. Block Palette 7. Coding Area 8. Backdrop
| Block Category | Purpose |
|---|---|
| 1. Motion | Moves the sprite |
| 2. Looks | Changes appearance |
| 3. Sound | Plays sounds |
| 4. Events | Starts the program |
| 5. Control | Controls loops and decisions |
| 6. Sensing | Detects keyboard, mouse, or touching |
| 7. Operators | Performs calculations and comparisons |
| 8. Variables | Stores information |
| 9. My Blocks | Creates custom blocks |
Additional Exercise
1. Write script to move the sprite 10 steps, when green flag clicked. Answer: Step 1: Drag “when green flag clicked” from Events. Step 2: Attach “move 10 steps” from Motion. 2. Write script to say “Namaste” for 2 seconds, when green flag clicked. Answer: Step 1: Drag “when green flag clicked” from Events. Step 2: Attach “say [Namaste] for 2 seconds” from Looks. 3. Write script to turn the sprite 15 degrees clockwise, when green flag clicked. Answer: Step 1: Drag “when green flag clicked” from Events. Step 2: Attach “turn clockwise 15 degrees” from Motion. 4. Write script to turn the sprite 15 degrees counterclockwise, when green flag clicked. Answer: Step 1: Drag “when green flag clicked” from Events. Step 2: Attach “turn counterclockwise 15 degrees” from Motion. 5. Write script to change the sprite’s costume to the next one, when green flag clicked. Answer: Step 1: Drag “when green flag clicked” from Events. Step 2: Attach “next costume” from Looks. 6. Write script to make the sprite go to the mouse pointer, when green flag clicked. Answer: Step 1: Drag “when green flag clicked” from Events. Step 2: Attach “go to mouse-pointer” from Motion. 7. Write script to glide to a random position in 1 second, when green flag clicked. Answer: Step 1: Drag “when green flag clicked” from Events. Step 2: Attach “glide 1 secs to random position” from Motion. 8. Write script to change the sprite’s size by 10%, when green flag clicked. Answer: Step 1: Drag “when green flag clicked” from Events. Step 2: Attach “change size by 10” from Looks. 9. Write script to make the sprite bounce when it touches the edge, when green flag clicked. Answer: Step 1: Drag “when green flag clicked” from Events. Step 2: Attach “if on edge, bounce” from Motion. 10. Write script to wait 1 second and then move 20 steps, when green flag clicked. Answer: Step 1: Drag “when green flag clicked” from Events. Step 2: Attach “wait 1 seconds” from Control. Step 3: Attach “move 20 steps” from Motion below the wait block. 11. Write script to repeat moving 10 steps 5 times, when green flag clicked. Answer: Step 1: Drag “when green flag clicked” from Events. Step 2: Attach “repeat 5” from Control. Step 3: Inside the repeat block, attach “move 10 steps” from Motion. 12. Write script to play a sound, when green flag clicked. Answer: Step 1: Drag “when green flag clicked” from Events. Step 2: Attach “play sound [sound name] until done” from Sound. 13. Write script to say “Good job!” and then hide, when green flag clicked. Answer: Step 1: Drag “when green flag clicked” from Events. Step 2: Attach “say [Good job!]” from Looks. Step 3: Attach “hide” from Looks below the say block. 14. Write script to go to coordinates x: 0, y: 0, when green flag clicked. Answer: Step 1: Drag “when green flag clicked” from Events. Step 2: Attach “go to x:0 y:0” from Motion. 15. Write script to change the background to “City,” when green flag clicked. Answer: Step 1: Drag “when green flag clicked” from Events. Step 2: Attach “switch backdrop to [City]” from Looks. 16. Write script to point the sprite in direction 90 degrees, when green flag clicked. Answer: Step 1: Drag “when green flag clicked” from Events. Step 2: Attach “point in direction 90” from Motion. 17. Write script to repeat turning 15 degrees 10 times, when green flag clicked. Answer: Step 1: Drag “when green flag clicked” from Events. Step 2: Attach “repeat 10” from Control. Step 3: Inside the repeat block, attach “turn clockwise 15 degrees” from Motion. 18. Write script to broadcast a message called “Start,” when green flag clicked. Answer: Step 1: Drag “when green flag clicked” from Events. Step 2: Attach “broadcast [Start]” from Events. 19. Write script to switch backdrops after 2 seconds, when green flag clicked. Answer: Step 1: Drag “when green flag clicked” from Events. Step 2: Attach “wait 2 seconds” from Control. Step 3: Attach “switch backdrop to [backdrop name]” from Looks. 20. Write script to show the sprite and then move 30 steps, when green flag clicked. Answer: Step 1: Drag “when green flag clicked” from Events. Step 2: Attach “show” from Looks. Step 3: Attach “move 30 steps” from Motion below the show block.