packages feed

swarm-0.4: data/scenarios/Tutorials/grab.yaml

version: 1
name: Grab
description: |
  Learn how to interact with the world by grabbing entities.
objectives:
  - goal:
      - Previously you learned how to make new things (like a `branch predictor`{=entity}) from ingredients.
        Now you will learn how to obtain the ingredients you need.
      - There are some `tree`{=entity}s ahead of your robot; `move` to each one and `grab` it.
      - You can learn more by reading about the grabber device in your
        inventory.  Remember, if the description does not fit in the
        lower left info box, you can either hit **Enter** to pop out the
        description, or focus the info box in order to scroll.
    condition: |
      try {
        t <- as base {count "tree"};
        return (t >= 6);
      } { return false }
solution:
  move;
  move; grab;
  move; grab;
  move; grab;
  move; grab;
  move; grab;
  move; grab;
robots:
  - name: base
    dir: [1,0]
    devices:
      - treads
      - grabber
      - logger
      - compass
    inventory:
      - [0, tree]
world:
  palette:
    '>': [grass, null, base]
    '.': [grass]
    'T': [grass, tree]
    '┌': [stone, upper left corner]
    '┐': [stone, upper right corner]
    '└': [stone, lower left corner]
    '┘': [stone, lower right corner]
    '─': [stone, horizontal wall]
    '│': [stone, vertical wall]
  upperleft: [-1, 1]
  map: |
    ┌────────┐
    │>.TTTTTT│
    └────────┘