william.bartlett
william.bartlett 10h ago • 0 views

Scratch Code Example: A Simple Virus Simulation for Educational Purposes

Hey everyone! 👋 Let's explore how to create a simple virus simulation using Scratch. It's a fun way to learn about programming and how things spread! Get ready to code and see your own little virus in action! 🦠
💻 Computer Science & Technology
🪄

🚀 Can't Find Your Exact Topic?

Let our AI Worksheet Generator create custom study notes, online quizzes, and printable PDFs in seconds. 100% Free!

✨ Generate Custom Content

1 Answers

✅ Best Answer
User Avatar
matthew.logan Jan 7, 2026

📚 Quick Study Guide

    🦠
  • Sprite Creation: Create a sprite that represents the 'virus'.
  • 🎨
  • Cloning: Use the 'create clone of myself' block to simulate the virus spreading.
  • 📍
  • Random Movement: Make the clones move randomly across the screen.
  • 🤝
  • Interaction: Implement a way for the clones to 'infect' other sprites.
  • ⚙️
  • Control: Add controls to start and stop the simulation.
  • 📊
  • Visualization: Display the number of infected sprites.

🧪 Practice Quiz

  1. Which Scratch block is essential for creating multiple instances of the virus in the simulation?
    1. move (10) steps
    2. create clone of myself
    3. say (hello) for (2) seconds
    4. go to (random position)
  2. How can you make the virus clones move randomly on the screen?
    1. Using the turn (15) degrees block repeatedly.
    2. Using the go to (mouse-pointer) block.
    3. Using the go to (random position) block.
    4. Using the change x by (10) and change y by (10) blocks.
  3. What is the primary purpose of using clones in this simulation?
    1. To change the color of the sprite.
    2. To make the sprite louder.
    3. To simulate the spread of the virus.
    4. To make the sprite disappear.
  4. Which block can be used to detect if a virus clone is touching another sprite?
    1. touching (color)?
    2. touching (edge)?
    3. touching (sprite2)?
    4. distance to (mouse-pointer)
  5. How can you control the start and stop of the virus simulation?
    1. By using the when green flag clicked and stop all blocks.
    2. By using the when this sprite clicked block.
    3. By using the when key pressed block to move the sprite.
    4. By using the forever block without a stop condition.
  6. What is a good way to display the number of infected sprites in the simulation?
    1. By using the ask () and wait block.
    2. By using a variable to count the clones and displaying it on the screen.
    3. By changing the background color.
    4. By playing a sound.
  7. Why is it important to limit the number of clones created in the simulation?
    1. To make the simulation more colorful.
    2. To prevent the simulation from slowing down or crashing.
    3. To make the simulation easier to understand.
    4. To use less memory.
Click to see Answers
  1. B
  2. C
  3. C
  4. C
  5. A
  6. B
  7. B

Join the discussion

Please log in to post your answer.

Log In

Earn 2 Points for answering. If your answer is selected as the best, you'll get +20 Points! 🚀