version: 1 name: Debug description: | Learn how to view built robots and debug them. objectives: - goal: - Before you send your robots far away you need to learn how to figure out what went wrong with them if they crash. - | In this challenge, you should start by sending a robot to walk four steps straight east into the mountain, crashing deliberately. However, you must make sure it has a `logger`, so we can see what command failed. The simplest way to ensure that is to have it execute the `log` command; `build` will ensure it has the devices it needs to execute its commands. For example: - | build {log "Hi!"; turn east; move; move; move; log "3"; move; log "OK"} - After the robot crashes, execute `view it0` (or whichever `itN` variable corresponds to the result of the `build` command) to see how far it got. Further instructions should appear in the crashed robot's log. condition: | try { as base {has "Win"} } { return false } entities: - name: Win display: attr: device char: 'W' description: - If you have this, you win! properties: [known, portable] solution: | run "scenarios/Tutorials/crash-solution.sw" robots: - name: base dir: [0,1] heavy: true display: char: Ω attr: robot devices: - logger - 3D printer - clock inventory: - [10, logger] - [10, compass] - [10, scanner] - [10, toolkit] - [10, solar panel] - [10, treads] - [10, grabber] - name: secret dir: [0, 0] devices: - logger - flash memory - dictionary - 3D printer inventory: - [100000, Win] display: invisible: true system: true program: | run "scenarios/Tutorials/crash-secret.sw" known: [water, tree, mountain] world: default: [blank] palette: 'Ω': [grass, null, base] '!': [grass, null, secret] '.': [grass] '~': [ice, water] 'T': [grass, tree] 'A': [stone, mountain] '┌': [stone, upper left corner] '┐': [stone, upper right corner] '└': [stone, lower left corner] '┘': [stone, lower right corner] '─': [stone, horizontal wall] '│': [stone, vertical wall] upperleft: [-1, 3] map: | ┌─────┐ │AAAT~│ │..A.~│ │Ω..!A│ └─────┘