Teaching article

Look for exact repeated structure before writing a loop

Identify repeated structure that can simplify instructions.

A staircase route may contain recurring blocks, but similar-looking segments can hide a different turn. Compare the commands within each proposed block before deciding that one repeat instruction can represent them all.

Trace one section. Find matching sections. Describe a reusable pattern.

Match the complete blocks

Compare complete blocks command by command. A repeated visual shape may still contain a different turn that prevents exact reuse.

Forward-forward-turn may recur as a complete block.

Does every block match exactly? Mark block boundaries.

Similar-looking fragments may not be identical.

Resources

Further reading

Read next

Explore Coding and computational thinking. Browse all teaching articles.