← Lessons PP 4-6 ๐Ÿงš Magic Spells Bonus!
๐ŸŒฒ Universe
Enchanted Forest
Welcome, little spellcaster! Today you'll learn the most powerful magic in all of coding โ€” FUNCTIONS! Build a spell once, cast it many times! ๐Ÿงšโœจ

๐Ÿง  What's a Function?

A function is a group of steps with a name. You build it once, then use it again and again without rebuilding! In the forest, we call them magic spells ๐Ÿงš. Mix ingredients into a spell, name it, and cast it whenever you need it!

๐Ÿ”— Remember Lesson 8? You combined sequence + loops + conditions into a program. Today, you'll learn how programmers save a group of steps as a reusable spell โ€” that's a function!
CHALLENGE 1 of 4
Build a spell! Add 2 ingredients, then CAST it to light up the dark mushroom.
๐ŸŒฒ Enchanted Forest โ€” Creatures Need Your Magic! โœจ
๐ŸŽ‰ Your spell worked! Cast it AGAIN โ€” no need to rebuild! ๐Ÿ”
๐Ÿ“œ Your Spell (empty) 0 blocks
Tap ingredients below to build your spell! ๐Ÿ‘‡
๐Ÿงช Magic Ingredients โ€” tap to add!

๐ŸŒŸ What you learned

๐Ÿ”ฎ Next time: More forest adventures with data and patterns! You're becoming a real code wizard โ€” come back tomorrow! ๐ŸŒฒโœจ
๐Ÿงš

Magic Spells!

Welcome to the Enchanted Forest! The creatures need your help. Learn the most powerful magic in coding: FUNCTIONS โ€” build a spell once, then cast it again and again!

๐ŸงชTap ingredients to build a spell
โœจPress Cast Spell! to use it
๐Ÿ”Cast the SAME spell again โ€” no rebuilding!
๐Ÿ†Help all the forest creatures!