{
  "format": "duck-pack/0",
  "id": "plan-the-farm",
  "name": "Plan the farm",
  "grades": "6 to 8",
  "grade_from": 6,
  "grade_to": 8,
  "vocabulary": "r001",
  "license": "CC-BY-4.0",
  "credit": "Duck Cards, from microduckstudio.com",
  "about": "Plan a route the way people plan work for real farm robots: write down what it must do, name routines as Your cards, fit a whole field into 40 steps, then write a level for another group.",
  "cards": ["start", "end", "walk_forward", "walk_backward", "turn_left", "turn_right", "stop", "slow", "peck_ground", "greet", "repeat", "end_repeat", "when_falls", "card_4", "card_5", "card_6"],
  "score": "cards",
  "board": {"columns": 6, "rows": 6, "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": "pf-1",
      "name": "Two rows and a turn",
      "columns": 6,
      "rows": 2,
      "start": {"at": [0, 0], "facing": "east"},
      "goal": [0, 1],
      "walls": [{"between": [[0, 0], [0, 1]]}, {"between": [[1, 0], [1, 1]]}, {"between": [[2, 0], [2, 1]]}, {"between": [[3, 0], [3, 1]]}, {"between": [[4, 0], [4, 1]]}],
      "gates": [],
      "finish_with": null,
      "par": 3,
      "solution": [
        {"card": "card_4"},
        {"card": "card_5"},
        {"card": "card_4"}
      ],
      "buggy": null,
      "hint": "Your cards name a routine. Three names can say the whole route.",
      "note": "Two rows of a field and the turn between them: one row out, round the end, and one row back."
    },
    {
      "id": "pf-2",
      "name": "The whole field",
      "columns": 6,
      "rows": 5,
      "start": {"at": [0, 0], "facing": "east"},
      "goal": [5, 4],
      "walls": [{"between": [[0, 0], [0, 1]]}, {"between": [[1, 0], [1, 1]]}, {"between": [[2, 0], [2, 1]]}, {"between": [[3, 0], [3, 1]]}, {"between": [[4, 0], [4, 1]]}, {"between": [[1, 1], [1, 2]]}, {"between": [[2, 1], [2, 2]]}, {"between": [[3, 1], [3, 2]]}, {"between": [[4, 1], [4, 2]]}, {"between": [[5, 1], [5, 2]]}, {"between": [[0, 2], [0, 3]]}, {"between": [[1, 2], [1, 3]]}, {"between": [[2, 2], [2, 3]]}, {"between": [[3, 2], [3, 3]]}, {"between": [[4, 2], [4, 3]]}, {"between": [[1, 3], [1, 4]]}, {"between": [[2, 3], [2, 4]]}, {"between": [[3, 3], [3, 4]]}, {"between": [[4, 3], [4, 4]]}, {"between": [[5, 3], [5, 4]]}],
      "gates": [{"at": [5, 0], "axis": "ew"}, {"at": [0, 1], "axis": "ew"}, {"at": [5, 2], "axis": "ew"}, {"at": [0, 3], "axis": "ew"}, {"at": [5, 4], "axis": "ew"}],
      "finish_with": null,
      "par": 7,
      "solution": [
        {"card": "repeat", "times": 2},
        {"card": "card_4"},
        {"card": "card_5"},
        {"card": "card_4"},
        {"card": "card_6"},
        {"card": "end_repeat"},
        {"card": "card_4"}
      ],
      "buggy": null,
      "hint": "Name the pattern for two rows, then repeat it. Why is this field five rows and not six?",
      "note": "Five rows, a gate at each row end, and one row of cards. Write what the route must do before you lay any."
    },
    {
      "id": "pf-3",
      "name": "Peck at the barn",
      "start": {"at": [0, 5], "facing": "north"},
      "goal": [5, 0],
      "walls": [],
      "gates": [],
      "finish_with": "peck_ground",
      "par": 4,
      "solution": [
        {"card": "card_4"},
        {"card": "turn_right"},
        {"card": "card_4"},
        {"card": "peck_ground"}
      ],
      "buggy": null,
      "hint": "Walk the row walks five squares whichever way the duck is facing. Does it have to be a row?",
      "note": "From the far corner to the barn door, then one pretend peck at the door."
    }
  ],
  "lessons": [
    {
      "title": "Name a routine",
      "skill": "Your cards",
      "body": "Walk the row, Row end right and Row end left are Your cards: printed cards saved under one name. Write out every card The whole field stands for, step by step, and count them. Then count the cards you laid.",
      "ask": "When is a run of cards worth a name of its own?"
    },
    {
      "title": "Write the spec first",
      "skill": "Specifications",
      "body": "Before laying cards, write in plain sentences what the route must do: where it starts and faces, where it ends, which gates it passes, what it must never bump, and the card it finishes with. A spec says what, not how. Trade specs with another group, and each writes a row for the other's spec.",
      "ask": "Did a row meet your spec and still surprise you? What did the spec leave out?"
    },
    {
      "title": "Forty steps",
      "skill": "Limits",
      "body": "A duck runs at most 40 steps in one row. A full six by six field, row by row, takes 45 steps, so The whole field is five rows, which take 37. Plan the sixth row as a second run: mark a nest square where the first run ends, and a person sets the duck there, facing the right way, before the second run.",
      "ask": "Where would you split a field into runs, and why there?"
    },
    {
      "title": "Start a level",
      "skill": "Authoring",
      "body": "Each group draws a six by six field on squared paper: a start and facing, a goal, walls, one or two gates, and a finish card if you like. Solve it with plain cards only, because a class pack Studio writes carries no Your cards. Your card count is your par. Trade levels and try to beat each other's par.",
      "ask": "If another group beat your par, what did they see that you did not?"
    },
    {
      "title": "Real robots, real specs",
      "skill": "Robots and people",
      "body": "Real field robots and milking robots follow plans that people write and check. A milking robot stays in one place and the cows walk to it. The duck only plays a game about these robots; it does no farm work. Write three more lines a real farm robot's spec would need.",
      "ask": "What should a real farm robot do when a person or an animal is in its way?"
    }
  ],
  "yours": [
    {
      "tag": 203,
      "code": "card_4",
      "name": "Walk the row",
      "category": "yours",
      "kind": "yours",
      "plan": null,
      "does": "Walk forward five times: one whole row, end to end.",
      "row": [{"card": "repeat", "times": 5}, {"card": "walk_forward"}, {"card": "end_repeat"}]
    },
    {
      "tag": 204,
      "code": "card_5",
      "name": "Row end right",
      "category": "yours",
      "kind": "yours",
      "plan": null,
      "does": "Turn right, walk forward, turn right: round the end of a row and back along the next.",
      "row": [{"card": "turn_right"}, {"card": "walk_forward"}, {"card": "turn_right"}]
    },
    {
      "tag": 205,
      "code": "card_6",
      "name": "Row end left",
      "category": "yours",
      "kind": "yours",
      "plan": null,
      "does": "Turn left, walk forward, turn left: round the end of a row the other way.",
      "row": [{"card": "turn_left"}, {"card": "walk_forward"}, {"card": "turn_left"}]
    }
  ]
}
