0%
⭐ 0 XPMap
Chapter 6 · Quest 4 of 4 · 15 XP

Guild Hall

🏰 Welcome to the Guild Hall, where a team of three works together: a planner, a worker and a checker. The planner makes the plan, the worker does each step, and the checker makes sure nothing was skipped before the team reports back.

Each member is its own function with one job. Small members with one job each are easy to test, and easy to swap for a better one later. That's how real agent teams are built. Finish it for the Guild Leader badge: your bot gets its crown.

Instructions

  1. Make planner(goal) that returns pip.plan(goal).
  2. Make worker(step) that returns done: dig a hole (with the step).
  3. Make checker(steps, results) that returns True only if there's one result per step.
  4. Make guild(goal) that runs all three and returns Guild report: 3/3 steps done, or Guild report: check failed if the checker says no. Print guild("plant a tree").
💡 Hint

In guild: steps = planner(goal), then results gets worker(step) for each step. If checker(steps, results): build the report with str(len(results)) and str(len(steps)).

Ask the community

bot.py
Terminal
← BackNext →

Chapter 6: Party of Agents

The full quest map

Talk it out

  1. Read the instruction with the ✗ out loud.
  2. Say what your code does, line by line, as if to a friend.
  3. Find the line where what it does and what you want split apart.
  4. Press Run and read the terminal. Is that what you expected?
  5. Still stuck? Press Ask Pip why, or peek at the solution.
  6. Or ask on the community help board: say which quest, and paste your code.
New badge!

Your bot just got a new part. See it on the quest map.

Name your bot

It levels up as you play, and gets a new part with every chapter.