packages feed

swarm-0.4: data/scenarios/Testing/490-harvest.yaml

version: 1
name: Test harvest command
description: |
  Test the difference between the grab and harvest commands,
  and test that grab doesn't drain water.
  https://github.com/swarm-game/swarm/issues/490
objectives:
  - condition: |
      try {
        turn east; move;
        t1 <- ishere "tree";
        move;
        t2 <- ishere "tree";
        t3 <- as base {n <- count "water"; return (n == 4)};
        return (t1 && not t2 && t3)
      } { return false }
solution: |
  move; harvest; move; grab; turn right; move; grab; grab; harvest; grab
robots:
  - name: base
    loc: [0,0]
    dir: [1,0]
    devices:
      - treads
      - harvester
      - grabber
      - boat
world:
  palette:
    '.': [grass]
    'T': [stone, tree]
    '┌': [stone, upper left corner]
    '┐': [stone, upper right corner]
    '└': [stone, lower left corner]
    '┘': [stone, lower right corner]
    '─': [stone, horizontal wall]
    '│': [stone, vertical wall]
    '~': [stone, water]
  upperleft: [-1, 1]
  map: |
    ┌───┐
    │.TT│
    │~~~│
    └───┘