packages feed

swarm-0.7.0.0: data/scenarios/Testing/1592-shared-template-robot-say-logs.yaml

version: 1
name: Logs from same-template robots
creative: false
description: |
  Logs from different robots generated from the same template.

  The objective checks that base hears one message each tick,
  afterwards the integration test checks that all messages
  are present in the base log.
objectives:
  - goal:
      - Please `grab` the `token`{=entity} if you hear what you expected.
    condition: |
      as base { has "token" }
solution: |
  s <- listen;
  if (s == "Hello from (2, -2)!") {
    s <- listen;
    if (s == "Hello from (3, -2)!") {
      s <- listen;
      if (s == "Hello from (4, -2)!") {
        grab; say "OK!"
      } {say $ "3: Not what I expected: " ++ s}
    } {say $ "2: Not what I expected: " ++ s}
  } {say $ "1: Not what I expected: " ++ s}
robots:
  - name: base
    devices:
      - logger
      - hearing aid
      - comparator
      - branch predictor
      - string
      - grabber
  - name: saybot
    system: true
    display:
      invisible: false
      attr: blue
    program: |
      loc <- whereami;
      match loc \x. \_.
      wait x;
      say ("Hello from " ++ format loc ++ "!");
entities:
  - name: token
    display:
      char: 'W'
    properties:
      - known
      - pickable
    description:
      - Signals a success.
world:
  palette:
    '.': [grass]
    'B': [grass, token, base]
    's': [grass, null, saybot]
  map: |
    B...s
    ...ss
    ..sss