{
  "format": "duck-pack/0",
  "id": "loop-the-course",
  "name": "Loop the course",
  "grades": "3 to 5",
  "grade_from": 3,
  "grade_to": 5,
  "vocabulary": "r001",
  "license": "CC-BY-4.0",
  "credit": "Duck Cards, from microduckstudio.com",
  "about": "Courses on a five by five board where the fewest cards wins, so Repeat and End repeat pay off, with two rows to debug.",
  "cards": [
    "start",
    "end",
    "walk_forward",
    "walk_backward",
    "turn_left",
    "turn_right",
    "stop",
    "greet",
    "kick_right",
    "repeat",
    "end_repeat",
    "slow",
    "fast",
    "look_left",
    "look_right"
  ],
  "score": "cards",
  "board": {"columns": 5, "rows": 5, "square_cm": 30, "duck_square_cm": 30, "duck_square_source": "duckbench simulator (Pollen's MJCF, alpha_walking), 2026-10-15, with a first spec past Pollen's pad envelope; the shipped spec is not measured yet, so on a real duck Walk and Turn cards are timed until Pollen's duck-sim and a tester's duck pass (docs/PACKS.md, Acceptance)"},
  "challenges": [
    {
      "id": "loop-1",
      "name": "Fetch the bread",
      "start": {"at": [1, 3], "facing": "north"},
      "goal": [2, 2],
      "walls": [],
      "gates": [],
      "finish_with": null,
      "par": 3,
      "solution": [{"card": "walk_forward"}, {"card": "turn_right"}, {"card": "walk_forward"}],
      "buggy": null,
      "hint": "Here the score is cards, not steps. Count every card between Start and End."
    },
    {
      "id": "loop-2",
      "name": "Down the long dock",
      "start": {"at": [2, 4], "facing": "north"},
      "goal": [2, 0],
      "walls": [],
      "gates": [],
      "finish_with": null,
      "par": 3,
      "solution": [{"card": "repeat", "times": 4}, {"card": "walk_forward"}, {"card": "end_repeat"}],
      "buggy": null,
      "hint": "Four Walk forward cards say the same thing four times. Is there a card that says it once?"
    },
    {
      "id": "loop-3",
      "name": "Who moved the bread?",
      "start": {"at": [0, 4], "facing": "north"},
      "goal": [3, 2],
      "walls": [{"between": [[0, 2], [0, 1]]}, {"between": [[3, 3], [4, 3]]}],
      "gates": [],
      "finish_with": null,
      "par": 6,
      "solution": [
        {"card": "walk_forward"},
        {"card": "walk_forward"},
        {"card": "turn_right"},
        {"card": "walk_forward"},
        {"card": "walk_forward"},
        {"card": "walk_forward"}
      ],
      "buggy": [
        {"card": "walk_forward"},
        {"card": "walk_forward"},
        {"card": "turn_left"},
        {"card": "walk_forward"},
        {"card": "walk_forward"},
        {"card": "walk_forward"}
      ],
      "hint": "This row bumps into something. Act it out, card by card, and stop where the duck goes wrong."
    },
    {
      "id": "loop-4",
      "name": "Round the pond",
      "start": {"at": [1, 1], "facing": "east"},
      "goal": [1, 1],
      "walls": [
        {"between": [[2, 2], [2, 1]]},
        {"between": [[2, 2], [1, 2]]},
        {"between": [[2, 2], [3, 2]]},
        {"between": [[2, 2], [2, 3]]}
      ],
      "gates": [{"at": [3, 1], "axis": "ew"}, {"at": [3, 3], "axis": "ns"}, {"at": [1, 3], "axis": "ew"}],
      "finish_with": null,
      "par": 5,
      "solution": [
        {"card": "repeat", "times": 4},
        {"card": "walk_forward"},
        {"card": "walk_forward"},
        {"card": "turn_right"},
        {"card": "end_repeat"}
      ],
      "buggy": null,
      "hint": "The duck walks all the way round and comes home. What part of the walk happens again and again?"
    },
    {
      "id": "loop-5",
      "name": "Stepping stones",
      "start": {"at": [0, 4], "facing": "north"},
      "goal": [3, 1],
      "walls": [{"between": [[0, 3], [0, 2]]}, {"between": [[1, 2], [1, 1]]}, {"between": [[2, 1], [2, 0]]}],
      "gates": [{"at": [1, 3], "axis": "ew"}, {"at": [2, 2], "axis": "ew"}, {"at": [3, 1], "axis": "ew"}],
      "finish_with": null,
      "par": 6,
      "solution": [
        {"card": "repeat", "times": 3},
        {"card": "walk_forward"},
        {"card": "turn_right"},
        {"card": "walk_forward"},
        {"card": "turn_left"},
        {"card": "end_repeat"}
      ],
      "buggy": null,
      "hint": "Each stone is one up and one across. Say one step of the stairs, then repeat it."
    },
    {
      "id": "loop-6",
      "name": "Stones the wrong way",
      "start": {"at": [4, 0], "facing": "south"},
      "goal": [1, 3],
      "walls": [{"between": [[4, 1], [4, 2]]}, {"between": [[3, 2], [3, 3]]}, {"between": [[2, 3], [2, 4]]}],
      "gates": [{"at": [3, 1], "axis": "ew"}, {"at": [2, 2], "axis": "ew"}, {"at": [1, 3], "axis": "ew"}],
      "finish_with": null,
      "par": 6,
      "solution": [
        {"card": "repeat", "times": 3},
        {"card": "walk_forward"},
        {"card": "turn_right"},
        {"card": "walk_forward"},
        {"card": "turn_left"},
        {"card": "end_repeat"}
      ],
      "buggy": [
        {"card": "repeat", "times": 3},
        {"card": "walk_forward"},
        {"card": "turn_right"},
        {"card": "walk_forward"},
        {"card": "turn_right"},
        {"card": "end_repeat"}
      ],
      "hint": "The loop is almost right. Act out the first time round and watch which way the duck faces at the end."
    },
    {
      "id": "loop-7",
      "name": "The big corner",
      "start": {"at": [0, 4], "facing": "north"},
      "goal": [4, 0],
      "walls": [],
      "gates": [],
      "finish_with": null,
      "par": 6,
      "solution": [
        {"card": "repeat", "times": 2},
        {"card": "repeat", "times": 4},
        {"card": "walk_forward"},
        {"card": "end_repeat"},
        {"card": "turn_right"},
        {"card": "end_repeat"}
      ],
      "buggy": null,
      "hint": "Walk a side, turn, walk a side, turn. A Repeat can hold another Repeat."
    },
    {
      "id": "loop-8",
      "name": "Lap and hello",
      "start": {"at": [0, 4], "facing": "north"},
      "goal": [0, 4],
      "walls": [
        {"between": [[1, 0], [1, 1]]},
        {"between": [[1, 3], [1, 4]]},
        {"between": [[2, 0], [2, 1]]},
        {"between": [[2, 3], [2, 4]]},
        {"between": [[3, 0], [3, 1]]},
        {"between": [[3, 3], [3, 4]]},
        {"between": [[0, 1], [1, 1]]},
        {"between": [[3, 1], [4, 1]]},
        {"between": [[0, 2], [1, 2]]},
        {"between": [[3, 2], [4, 2]]},
        {"between": [[0, 3], [1, 3]]},
        {"between": [[3, 3], [4, 3]]}
      ],
      "gates": [
        {"at": [0, 1], "axis": "ns"},
        {"at": [3, 0], "axis": "ew"},
        {"at": [4, 3], "axis": "ns"},
        {"at": [1, 4], "axis": "ew"}
      ],
      "finish_with": "greet",
      "par": 7,
      "solution": [
        {"card": "repeat", "times": 4},
        {"card": "repeat", "times": 4},
        {"card": "walk_forward"},
        {"card": "end_repeat"},
        {"card": "turn_right"},
        {"card": "end_repeat"},
        {"card": "greet"}
      ],
      "buggy": null,
      "hint": "Go all the way round the lake and say hello when you are home. Does Hello go inside the loop, or after it?"
    },
    {
      "id": "loop-9",
      "name": "Snake through the reeds",
      "start": {"at": [0, 4], "facing": "east"},
      "goal": [0, 0],
      "walls": [
        {"between": [[0, 4], [0, 3]]},
        {"between": [[1, 4], [1, 3]]},
        {"between": [[2, 4], [2, 3]]},
        {"between": [[3, 4], [3, 3]]},
        {"between": [[1, 3], [1, 2]]},
        {"between": [[2, 3], [2, 2]]},
        {"between": [[3, 3], [3, 2]]},
        {"between": [[4, 3], [4, 2]]},
        {"between": [[0, 2], [0, 1]]},
        {"between": [[1, 2], [1, 1]]},
        {"between": [[2, 2], [2, 1]]},
        {"between": [[3, 2], [3, 1]]},
        {"between": [[1, 1], [1, 0]]},
        {"between": [[2, 1], [2, 0]]},
        {"between": [[3, 1], [3, 0]]},
        {"between": [[4, 1], [4, 0]]}
      ],
      "gates": [],
      "finish_with": null,
      "par": 14,
      "solution": [
        {"card": "repeat", "times": 2},
        {"card": "repeat", "times": 4},
        {"card": "walk_forward"},
        {"card": "end_repeat"},
        {"card": "turn_left"},
        {"card": "walk_forward"},
        {"card": "turn_left"},
        {"card": "repeat", "times": 4},
        {"card": "walk_forward"},
        {"card": "end_repeat"},
        {"card": "turn_right"},
        {"card": "walk_forward"},
        {"card": "turn_right"},
        {"card": "end_repeat"}
      ],
      "buggy": null,
      "hint": "Find the part of the path that happens twice. It has two straight runs in it."
    },
    {
      "id": "loop-10",
      "name": "The lap that went wrong",
      "start": {"at": [4, 4], "facing": "west"},
      "goal": [4, 4],
      "walls": [
        {"between": [[1, 0], [1, 1]]},
        {"between": [[1, 3], [1, 4]]},
        {"between": [[2, 0], [2, 1]]},
        {"between": [[2, 3], [2, 4]]},
        {"between": [[3, 0], [3, 1]]},
        {"between": [[3, 3], [3, 4]]},
        {"between": [[0, 1], [1, 1]]},
        {"between": [[3, 1], [4, 1]]},
        {"between": [[0, 2], [1, 2]]},
        {"between": [[3, 2], [4, 2]]},
        {"between": [[0, 3], [1, 3]]},
        {"between": [[3, 3], [4, 3]]}
      ],
      "gates": [
        {"at": [1, 4], "axis": "ew"},
        {"at": [0, 1], "axis": "ns"},
        {"at": [3, 0], "axis": "ew"},
        {"at": [4, 3], "axis": "ns"}
      ],
      "finish_with": null,
      "par": 6,
      "solution": [
        {"card": "repeat", "times": 4},
        {"card": "repeat", "times": 4},
        {"card": "walk_forward"},
        {"card": "end_repeat"},
        {"card": "turn_right"},
        {"card": "end_repeat"}
      ],
      "buggy": [
        {"card": "repeat", "times": 4},
        {"card": "repeat", "times": 4},
        {"card": "walk_forward"},
        {"card": "end_repeat"},
        {"card": "turn_left"},
        {"card": "end_repeat"}
      ],
      "hint": "The duck bumps on the very first corner. Which card in the loop turns it, and which way should it turn?"
    }
  ],
  "lessons": [
    {
      "title": "Say it shorter",
      "skill": "Loops",
      "body": "Solve Down the long dock with plain cards, then again with Repeat and End repeat, writing the number in Repeat's box. The score is cards: count every card between Start and End, Repeat and End repeat included.",
      "ask": "When does a Repeat save cards, and when does it cost one?"
    },
    {
      "title": "Find what repeats",
      "skill": "Patterns",
      "body": "Before laying cards for Round the pond, trace the path with a finger and say each move aloud. Circle the part you said again and again. That part goes between Repeat and End repeat.",
      "ask": "How did you decide where the loop starts?"
    },
    {
      "title": "Find the bug",
      "skill": "Debugging",
      "body": "Hand out the buggy row for Who moved the bread? Groups act it out, find the one wrong card, and fix the row with a single swap. Then do the same for Stones the wrong way, where the wrong card sits inside a loop.",
      "ask": "Why does one wrong card inside a loop go wrong more than once?"
    },
    {
      "title": "A loop inside a loop",
      "skill": "Nested loops",
      "body": "The big corner and Lap and hello need a Repeat inside a Repeat. Unroll one on paper: write out every card the duck does, in order, and count them. Then count the cards you laid.",
      "ask": "How many steps does the duck take for each card you laid?"
    },
    {
      "title": "Slow by the reeds",
      "skill": "Parameters",
      "body": "Speed and Look cards go under a card and change how it moves, not where. On the board they change nothing, and each one costs a card. Add Slow under one walk and Look left under another, and watch the score.",
      "ask": "If a card costs a point and does not move the duck, why would you lay it?"
    }
  ],
  "yours": []
}
