Computer Science
Grade 1
20 min
Building a Fence: Repeating Sections
Repeating sections to create a fence with blocks or craft sticks.
Tutorial Preview
1
Introduction & Learning Objectives
Learning Objectives
Identify a repeating pattern in a sequence.
Define a 'loop' as a repeating action.
Break a large task into small, repeatable sections.
Count the number of times a section repeats.
Follow a simple algorithm with a loop to build a structure.
Check their work to see if the pattern is correct.
Have you ever built a tower with blocks? π§± What if you had to build a very long fence for a puppy? πΆ
Today, we will learn how to do things over and over again. This is called a loop! It helps us build big things from small, repeating parts.
Real-World Applications
A song's chorus repeats πΆ
Brushing your teeth is a repeating motion π¦·
Stairs are the same step, over and over πͺ
A train has many of the same train cars π
2
Key Concepts & Vocabulary
TermDefinitionExample
RepeatTo do the exact same thing again. πClap your hands. π Now, repeat! ππ
LoopAn instruction that tells a computer to repeat something.A loop can tell a robot to take 5 steps forward. π€β‘οΈβ‘οΈβ‘οΈβ‘οΈβ‘οΈ
SectionOne small part of a pattern that repeats.In a fence, one post and one rail is a section. πͺ΅β
PatternSomething that is arranged following a rule or rules.Apple π, Banana π, Apple π, Banana π
InstructionOne single step in a set of directions.'Pick up the blue block' is one instruction. π΅
AlgorithmA list of steps to finish a task, like a recipe. π1. Get bread. 2. Get jelly. 3. Spread jelly. This is a sandwich algorithm!
3
Core Syntax & Patterns
The Pattern Rule
1. Find the Section. 2. Count the Repeats.
Use this to figure out how to build something big. First, find the small part that repeats. Then, count how many times you need to make it.
The Build-One-First Rule
Build one section perfectly. Then, copy it.
Before you repeat, make sure your first section is exactly right. This stops mistakes from being repeated over and over.
4 more steps in this tutorial
Sign up free to access the complete tutorial with worked examples and practice.
Sign Up Free to ContinueSample Practice Questions
Challenging
You have 10 posts and only 6 panels. Your repeating step is "Post, then Panel". What is the longest fence you can build, and what is leftover?
A.6 sections, with 4 posts leftover
B.10 sections, but you need more panels
C.5 sections, with 5 posts and 1 panel leftover
D.6 sections, with 0 parts leftover
Challenging
Which instructions build this fence: [Post-Panel]-[Post-Panel]-[GATE]-[Post-Panel]-[Post-Panel]?
A.Repeat 4 times [Add Post, Add Panel], then Add Gate
B.Repeat 2 times [Add Post, Add Panel], Add Gate, Repeat 2 times [Add Post, Add Panel]
C.Add Gate, then Repeat 4 times [Add Post, Add Panel]
D.Add Post, Add Panel, Add Gate, Add Post, Add Panel
Challenging
A "fancy fence" section is made of: Post, Panel, Small Post, Panel. To build a fence that has exactly 8 panels, how many times do you need to repeat the "fancy fence" section loop?
A.8 times
B.2 times
C.4 times
D.6 times
Want to practice and check your answers?
Sign up to access all questions with instant feedback, explanations, and progress tracking.
Start Practicing Free