swarm-0.1.0.0: data/scenarios/Tutorials/grab.yaml
version: 1
name: Grab
description: |
Learn how to interact with the world by grabbing entities.
objectives:
- goal:
- Previously you learned how to make new things (like a branch predictor) from ingredients.
Now you will learn how to obtain the ingredients you need.
- There are some trees ahead of your robot; `move` to each one and `grab` it.
- You can learn more by reading about the grabber device in your inventory.
- |
TIP: You can use the arrow key Up ('↑') to reuse your previous commands.
condition: |
try {
t <- as base {count "tree"};
return (t >= 6);
} { return false }
solution:
move;
move; grab;
move; grab;
move; grab;
move; grab;
move; grab;
move; grab;
robots:
- name: base
dir: [1,0]
devices:
- treads
- grabber
- logger
- compass
inventory:
- [0, tree]
world:
default: [blank]
palette:
'>': [grass, null, base]
'.': [grass]
'T': [grass, tree]
'┌': [stone, upper left corner]
'┐': [stone, upper right corner]
'└': [stone, lower left corner]
'┘': [stone, lower right corner]
'─': [stone, horizontal wall]
'│': [stone, vertical wall]
upperleft: [-1, 1]
map: |
┌────────┐
│>.TTTTTT│
└────────┘