packages feed

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

version: 1
name: Scan
description: |
  Learn how to send robots to safely scan your surroundings.
objectives:
  - goal:
      - When you land on an alien planet, all the entities in the
        world will be unfamiliar to you, but you can learn what they are using
        the `scan` command, enabled by a `scanner`{=entity} device.
      - Send one or more robots to move next to some of the unknown entities (marked as "?"),
        scan them (with something like `scan forward` or `scan north`), and then return
        to the base and execute `upload base`.
      - For more information about the `scan` and `upload` commands, read
        the description of the `scanner`{=entity} in your inventory.
    condition: |
      try {
        bm <- as base {knows "mountain"};
        bt <- as base {knows "tree"};
        bw <- as base {knows "wavy water"};
        return (bm || bt || bw)
      } { return false }
solution: |
  build {
    turn east; move; move; move;
    turn left; move;
    scan left; scan forward; scan east;
    turn back; move;
    turn west; move; move; move;
    upload base;
  }
robots:
  - name: base
    dir: [0,1]
    heavy: true
    display:
      char: Ω
      attr: robot
    devices:
      - logger
      - 3D printer
    inventory:
      - [10, logger]
      - [10, compass]
      - [10, scanner]
      - [10, treads]
      - [10, solar panel]
world:
  palette:
    'Ω': [grass, null, base]
    '.': [grass]
    '~': [ice, wavy water]
    'T': [grass, tree]
    'A': [stone, mountain]
    '┌': [stone, upper left corner]
    '┐': [stone, upper right corner]
    '└': [stone, lower left corner]
    '┘': [stone, lower right corner]
    '─': [stone, horizontal wall]
    '│': [stone, vertical wall]
  upperleft: [-1, 3]
  map: |
    ┌─────┐
    │AAAT~│
    │..A.~│
    │Ω...A│
    └─────┘