version: 1 name: Invisible, loopy maze author: Brent Yorgey description: There is a maze, but it can't be seen, only sensed... can you program a robot to navigate it successfully? objectives: - goal: - There is a maze, but it can't be seen, only sensed... can you program a robot to navigate it successfully? You need to get a robot to the goal square, labelled with an exclamation mark; you win by `grab`bing the `goal`. - In this challenge, you are NOT guaranteed that the maze is a tree, that is, the maze may contain loops. condition: | try { teleport self (27, -17); b <- ishere "goal"; return (not b) } { return false } solution: | run "scenarios/Challenges/Mazes/loopy_maze_sol.sw" robots: - name: base dir: [0,1] display: char: 'Ω' attr: robot devices: - dictionary - 3D printer - logger - grabber inventory: - [50, solar panel] - [50, treads] - [50, compass] - [50, scanner] - [50, lambda] - [50, branch predictor] - [50, strange loop] - [50, logger] - [50, grabber] - [1000, rock] - [0, boulder] - [0, goal] entities: - name: wall display: invisible: true description: - An invisible wall. properties: [unwalkable, known] - name: goal display: char: '!' attr: device description: - The place you're trying to reach! You win by executing `grab` on this item. properties: [known, portable] world: default: [grass] palette: 'Ω': [grass, null, base] '.': [grass, null] 'x': [grass, wall] '@': [grass, boulder] '!': [grass, goal] upperleft: [-1,1] map: | @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @.........x...x..............@ @xx.xxxxx.x.x.xxx....xxxxxxx.@ @.x.x...x.x.x...xxxx.......x.@ @.....x.x.x.x.x....xxxxxxxxx.@ @xx.xxxxx.x.x.xxxx...........@ @.......x...x....xxxxxxx.xxxx@ @.xxxxx.xxx.xxxx.x...........@ @.x.x.x..x...Ω...x.xxx.xxxxx.@ @.x.x.xx.x.x.xxx.x.x.....x...@ @.x.x.xx.x.x...x...x.x.x.x.xx@ @......x...x.x...x.x.x.x.x...@ @xxxxxxx.xxx.xxxxx.x.x.x.xxx.@ @....................x.x.x.x.@ @xxxxxxxxxx.xxxxxxxxxx.x.x.x.@ @..x...x.......x.....x.x.....@ @x.......x...x...x.x.x.x.x.x.@ @xxxxxxxxxx.xxxxxx.x.x.x.x.x.@ @..................x...x...x!@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@