swarm-0.7.0.0: data/scenarios/Testing/1575-structure-recognizer/2201-initial-recognition-overlap.yaml
version: 1
name: Structure recognition - precluding initial overlaps
description: |
A cell may be a member of at most one structure.
Since recognition of pre-placed structures bypasses
the regular "search" process, we need to ensure that
overlaps are properly excluded by this alternate mechanism.
In this scenario, only the upper-left structure should be recognized,
based on the precedence criteria (structure size, then grid location)
creative: false
objectives:
- teaser: Recognize exactly one structure
goal:
- |
`square`{=structure} structure should be recognized upon scenario start.
- |
Although two of these structures were initially placed, only
the upper-left one should be recognized.
condition: |
def length : (rec l. Unit + a * l) -> Int = \l.
case l (\_. 0) (\c. match c \_. \tl. 1 + length tl)
end;
foundStructures <- structures "square";
pure $ length foundStructures == 1;
robots:
- name: base
dir: north
devices:
- ADT calculator
- blueprint
- fast grabber
- logger
- treads
solution: |
noop;
structures:
- name: square
recognize: [north]
structure:
palette:
'x': [stone, rock]
mask: '.'
map: |
xx
xx
known: [rock]
world:
dsl: |
{blank}
palette:
'.': [grass, erase]
'B': [grass, erase, base]
's':
structure:
name: square
cell: [grass]
upperleft: [0, 0]
map: |
...s...
....s..
.B.....