Scratch Materi 10: Variables and Data
Variabel dan Data dalam Scratch | Understanding and Using Variables
Tujuan Pembelajaran | Learning Objectives
- Memahami fungsi variable dalam Scratch.
- Understand what a variable is and why it is useful.
- Membuat dan menggunakan variable.
- Create and use a variable in a Scratch program.
- Menggunakan Set Variable dan Change Variable.
- Use Set Variable and Change Variable correctly.
- Menghubungkan variable dengan loop dan condition.
- Connect variables with loops and conditions.
1. Apa itu Variable? | What is a Variable?
Variable adalah tempat untuk menyimpan sebuah nilai yang dapat berubah selama program berjalan.
A variable is a container used to store a value that can change while the program is running.
Score
Menyimpan nilai skor permainan.
Stores the player's score.
Timer
Menyimpan waktu.
Stores time information.
Lives
Menyimpan jumlah kesempatan.
Stores the number of lives.
2. Variable Blocks
Set Variable digunakan untuk memberikan nilai tertentu.
Set Variable gives a variable a specific value.
Change Variable digunakan untuk menambah atau mengurangi nilai.
Change Variable increases or decreases the value.
3. Vocabulary
| Scratch Term | Bahasa Indonesia | English Explanation |
|---|---|---|
| Variable | Variabel | A container that stores a value. |
| Create a Variable | Membuat variabel | Create a new variable. |
| Set Variable | Menentukan nilai variabel | Give a variable a specific value. |
| Change Variable | Mengubah nilai variabel | Increase or decrease a variable. |
| Show Variable | Menampilkan variabel | Show the variable on the Stage. |
| Hide Variable | Menyembunyikan variabel | Hide the variable from the Stage. |
4. Practice: Let's Change the Score
Pilih tindakan dan lihat bagaimana nilai score berubah.
Choose an action and watch the score change.
5. Challenges
Drag blocks from Block Library to the Script Area.
Jalankan program, amati Stage, kemudian klik Check.
Challenge 1: Starting Score
Create a program that sets the score to 0.
Challenge 2: Collect Points
CAT moves and the score increases by 10.
Challenge 3: Repeat and Score
Use Repeat 5 and increase the score by 10 in each iteration.
Challenge 4: Condition and Score
If the condition is true, CAT moves and score increases by 10. If the condition is false, score decreases by 5.
6. Reflection
Centang pernyataan yang sesuai dengan pemahamanmu.
Check the statements that match your understanding.
7. Quiz | Kuis
What is the purpose of a Variable in Scratch?
Which block gives a variable a specific value?
If score = 20 and the program runs change score by 10, what is the new score?
What can variables be used with?
8. Next Lesson
Setelah memahami Variable, kita dapat menggunakannya untuk membuat program yang lebih interaktif.
After learning Variables, we can use them to create more interactive programs.
Materi berikutnya: Variables in Interactive Projects.