Fulfills Step 2 of GSUSA Brownie Coding Basics badge requirements.
Info Needed for badge requirements: A computer needs very specific instructions for each action. For example, if you need to make 12 sandwiches, you would have to repeat the same steps 12 times. This can be time-consuming and tedious. Programmers use loops to save time. Instead of writing the sandwich instructions 12 times, they write it once and label it “makesandwich.” Then, they write a line of code to repeat the “makesandwich” instructions 12 times. This makes the process more efficient and reduces errors. By using loops, programmers can simplify their code and make it easier to read.
Items Needed
- Paper
- Pen
Instructions
- Explain that daily routines, like a morning routine, are made up of steps, and each step can be broken down into smaller actions. Use the example: “Get Dressed: Choose clothes for the day and get dressed.” This step involves removing pajamas, putting on clothes, and putting on socks—three smaller actions.
- Explain that computers use loops to repeat steps, so you don’t have to write out all the smaller actions every time.
- Divide the scouts into small groups.
- Assign each group one morning routine step.
- Breakfast: It’s time for a healthy meal to start the day.
- Wash Up: Brush teeth and wash face to start the day fresh.
- Pack Backpack: Backpack is packed with everything needed.
- Check the Weather: A quick glance outside or at the weather.
- Put on Shoes and Jacket: Get ready to head out the door.
- Head to School: Walk/bike, take the bus, or drive to school.
- Each small group brainstorms and writes out the smaller actions that make up their step to create a loop.
- Come together as a troop and share the loops created by each group.
- (Optional) Write out all the loops in order to complete a full morning algorithm and see how long it would be if they had to do each individual instruction for all steps each morning. Compare it to the simplified list of just stating the loop names.