Thanksgiving Coloring Pages: 34 free pages to print →
Coding with Loops Worksheet: Pig to the Barn printable worksheet
Grade 2

Coding with Loops Worksheet: Pig to the Barn

Coding with loops for 2nd grade: write the pig's code to the barn with repeat blocks, using at most 7 blocks.

Size
US Letter (8.5 × 11 in), fits A4
PDF
2 pages: the worksheet and its answer key; high-resolution, prints sharp on US Letter and A4
Level
Grade 2
License
Free for personal & classroom use

About this worksheet

A 7 by 7 grid with the pig, one corn cob to collect and the barn, with three rocks, two logs and two fences in the way. Each block for the pig has an arrow box and a number box: right x3 means three squares to the right. The pig's walk is 16 squares long but fits in 6 blocks, and the sheet gives 7, so kids learn to spot runs of the same arrow. A test line asks them to run the pig's code with a coin. Page 2 shows a shortest code for the pig in blocks. This board is also the level "Pig to the Barn: Loops" in our free online coding game.

Tips for using it

Printing tips

Download the PDF and print at 100% (or “fit to page” on A4). Page 1 is the worksheet and page 2 is the answer key with the answers in red; print just page 1 if you want to keep the answers for checking. Free for personal, family and classroom use.

More Coding Worksheets for Kids

See all 42 →

You may also like