Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

horton's flower #1594

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions data/scenarios/Challenges/_horton/solution.sw
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
def goDir = \f. \d.
if (d == down) {
grab;
f;
} {
turn d; move; f;
}
end;

def followRoute =
nextDir <- path (inL ()) (inR "flower");
case nextDir return $ goDir followRoute;
end;

followRoute;
72 changes: 72 additions & 0 deletions data/scenarios/Challenges/horton.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
version: 1
name: Horton's Field
author: Karl Ostmo
seed: 1
description: |
Find Horton's flower.
creative: false
objectives:
- goal:
- |
Find Horton's flower.
condition: |
return false
robots:
- name: base
dir: [0, 1]
devices:
- ADT calculator
- branch predictor
- comparator
- compass
- dictionary
- grabber
- hourglass
- clock
- lambda
- logger
- net
- scanner
- strange loop
- treads
- wayfinder
solution: |
run "scenarios/Challenges/_horton/solution.sw"
entities:
- name: wayfinder
display:
char: 'w'
description:
- Enables `path` command
properties: [known, portable]
capabilities: [path]
known: [water, boulder, mountain, flower]
world:
dsl: |
let
cl = perlin seed 4 0.08 0.5,
patch = cl > 0.0,
prize = cl < -0.8
in
overlay
[ {dirt}
, mask (patch) {boulder}
, mask (prize) {flower}
, mask (y < -80 || y > 80 || x < -60 || x > 60) (overlay [{water}])
]
upperleft: [-4, 4]
offset: false
palette:
'B': [grass, erase, base]
'.': [grass, erase]
'x': [blank]
map: |
xxx...xxx
x.......x
x.......x
.........
....B....
.........
x.......x
x.......x
xxx...xxx
Loading