packages feed

swarm-0.7.0.0: data/scenarios/Challenges/wave.yaml

version: 1
name: Wave
author: Karl Ostmo
description: |
  Ride the wave
creative: false
objectives:
  - goal:
      - |
        Grab the `bitcoin`{=entity} at the east end of the path.
        Don't let the patrolling robots catch you!
    prerequisite:
      not: got_caught
    condition: |
      as base {has "bitcoin"};
  - id: got_caught
    teaser: Got caught
    optional: true
    hidden: true
    goal:
      - |
        The robots caught you!
    condition: |
      as base {x <- meet; pure $ case x (\_. false) (\_. true)};
robots:
  - name: base
    dir: north
    devices:
      - branch predictor
      - comparator
      - dictionary
      - grabber
      - hourglass
      - clock
      - lambda
      - logger
      - net
      - scanner
      - strange loop
      - treads
  - name: wavebot
    system: true
    dir: north
    display:
      invisible: false
      attr: 'plant'
    program: |
      def crossPath =
          move; move; move; move; move; move;
          turn back;
          wait 5;
          end;
      def go =
          crossPath;
          go;
          end;
      def start =
          pos <- whereami;
          match pos \x. \_.
          wait x;
          go;
          end;
      start;
solution: |
  run "scenarios/Challenges/_wave/solution.sw"
entities: []
known: [wavy water, water, bitcoin]
world:
  dsl: |
    overlay
    [ {dirt, water}
    , if (x / 2 - y) % 5 == 0 then {dirt, wavy water} else {blank}
    ]
  upperleft: [-3, 6]
  palette:
    'B': [grass, erase, base]
    'w': [grass, erase, wavebot]
    'x': [dirt, water]
    'z': [grass, bitcoin]
    '.': [grass, erase]
  map: |
    xxxxxx..................................................................................................................................................................................................................................................xxxxxx
    xxx........................................................................................................................................................................................................................................................xxx
    x............................................................................................................................................................................................................................................................x
    B............................................................................................................................................................................................................................................................z
    x............................................................................................................................................................................................................................................................x
    xxx........................................................................................................................................................................................................................................................xxx
    xxxxxxwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwxxxxxx