Skip to content

Commit

Permalink
fishing scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
kostmo committed Nov 15, 2023
1 parent 8f52e53 commit ae551e8
Show file tree
Hide file tree
Showing 4 changed files with 393 additions and 0 deletions.
1 change: 1 addition & 0 deletions data/scenarios/Challenges/Ranching/00-ORDER.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
capture.yaml
powerset.yaml
fishing.yaml
gated-paddock.yaml
48 changes: 48 additions & 0 deletions data/scenarios/Challenges/Ranching/_fishing/solution.sw
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
def doN = \n. \f. if (n > 0) {f; doN (n - 1) f} {}; end;

def makeRoll =
make "nori";
make "california roll";
end;

def checkIngredients =
hasTuna <- has "crab";
hasSeaweed <- has "seaweed";
return $ hasTuna && hasSeaweed;
end;

def catchFish = \rod.
use rod forward;
ready <- checkIngredients;
if ready {
makeRoll;
} {
catchFish rod;
};
end;

def harvestIngreients =
turn back;
doN 4 move;
turn right;
move;
harvest;
turn back;
doN 2 move;
harvest;
doN 3 move;
harvest;
turn left;
doN 7 move;
turn left;
end;

def go =
harvestIngreients;
let rod = "fishing tackle" in
make rod;
equip rod;
catchFish rod;
end;

go;
343 changes: 343 additions & 0 deletions data/scenarios/Challenges/Ranching/fishing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,343 @@
version: 1
name: Gone Fishing
author: Karl Ostmo
description: |
Catch a variety of fish for your restaurant
creative: false
seed: 0
objectives:
- teaser: Sushi chef
goal:
- |
Make a `california roll`{=entity}
condition: |
as base {
has "california roll"
}
robots:
- name: base
dir: [1, 0]
devices:
- branch predictor
- ADT calculator
- hourglass
- comparator
- dictionary
- grabber
- harvester
- keyboard
- lambda
- logger
- scanner
- strange loop
- treads
- welder
- workbench
inventory:
- [1, branch]
- [1, string]
- [1, fish hook]
- [1, lead weight]
solution: |
run "scenarios/Challenges/Ranching/_fishing/solution.sw"
entities:
- name: lakewater
display:
attr: water
char: ' '
description:
- Potable water from a lake
properties: [known, infinite, liquid]
- name: fishing tackle
display:
char: 'r'
attr: wood
description:
- A fishing rod equipped with hook, line and sinker.
- Use on `water`{=entity} to catch fish
properties: [known, portable]
- name: lead weight
display:
char: 'w'
attr: metal
description:
- Used as a fishing sinker
properties: [known, portable]
- name: fish hook
display:
char: 'j'
attr: metal
description:
- Use to catch fish
properties: [known, portable]
- name: california roll
display:
char: 'c'
description:
- Delicious
properties: [known, portable]
- name: rice
display:
char: 'i'
attr: plant
description:
- Perfect for sushi
properties: [known, portable, growable]
- name: avocado
display:
char: 'A'
attr: plant
description:
- Perfect for sushi
properties: [known, portable, growable]
- name: cucumber
display:
char: 'u'
attr: plant
description:
- Perfect for sushi
properties: [known, portable, growable]
- name: tuna
display:
char: 't'
description:
- Edible fish
properties: [known, portable]
- name: crab
display:
char: 'c'
description:
- Perfect for sushi
properties: [known, portable]
- name: pufferfish
display:
char: 'p'
description:
- Poisonous
properties: [known, portable]
- name: trout
display:
char: 't'
description:
- Good to eat
properties: [known, portable]
- name: salmon
display:
char: 't'
description:
- Good to eat
properties: [known, portable]
- name: oarfish
display:
char: 'r'
description:
- Too long
properties: [known, portable]
- name: narwhal
display:
char: 'n'
description:
- Too big
properties: [known, portable]
- name: marlin
display:
char: 'm'
description:
- Pointy
properties: [known, portable]
- name: seaweed
display:
char: 'w'
description:
- Inedible...?
properties: [known, portable]
- name: nori
display:
char: 'n'
description:
- Dried seaweed wrap for sushi rolls
properties: [known, portable]
- name: car tire
display:
char: 'o'
description:
- Useless
properties: [known, portable]
- name: kitchen sink
display:
char: 'i'
description:
- Anything but this!
properties: [known, portable]
- name: boot
display:
char: 'b'
description:
- Useless
properties: [known, portable]
- name: rusty bicycle
display:
char: '8'
description:
- Useless
properties: [known, portable]
recipes:
- in:
- [1, lakewater]
out:
- [1, rusty bicycle]
- [1, lakewater]
required:
- [1, fishing tackle]
time: 10
weight: 1
- in:
- [1, lakewater]
out:
- [1, car tire]
- [1, lakewater]
required:
- [1, fishing tackle]
time: 10
weight: 1
- in:
- [1, lakewater]
out:
- [1, boot]
- [1, lakewater]
required:
- [1, fishing tackle]
time: 10
weight: 1
- in:
- [1, lakewater]
out:
- [1, kitchen sink]
- [1, lakewater]
required:
- [1, fishing tackle]
time: 10
weight: 1
- in:
- [1, lakewater]
out:
- [1, seaweed]
- [1, lakewater]
required:
- [1, fishing tackle]
time: 10
weight: 1
- in:
- [1, lakewater]
out:
- [1, tuna]
- [1, lakewater]
required:
- [1, fishing tackle]
time: 10
weight: 1
- in:
- [1, lakewater]
out:
- [1, salmon]
- [1, lakewater]
required:
- [1, fishing tackle]
time: 10
weight: 1
- in:
- [1, lakewater]
out:
- [1, narwhal]
- [1, lakewater]
required:
- [1, fishing tackle]
time: 10
weight: 1
- in:
- [1, lakewater]
out:
- [1, oarfish]
- [1, lakewater]
required:
- [1, fishing tackle]
time: 10
weight: 1
- in:
- [1, lakewater]
out:
- [1, trout]
- [1, lakewater]
required:
- [1, fishing tackle]
time: 10
weight: 1
- in:
- [1, lakewater]
out:
- [1, marlin]
- [1, lakewater]
required:
- [1, fishing tackle]
time: 10
weight: 1
- in:
- [1, lakewater]
out:
- [1, pufferfish]
- [1, lakewater]
required:
- [1, fishing tackle]
time: 10
weight: 1
- in:
- [1, lakewater]
out:
- [1, crab]
- [1, lakewater]
required:
- [1, fishing tackle]
time: 10
weight: 1
- in:
- [1, seaweed]
out:
- [1, nori]
- in:
- [1, crab]
- [1, rice]
- [1, nori]
- [1, cucumber]
- [1, avocado]
out:
- [1, california roll]
- in:
- [1, branch]
- [1, fish hook]
- [1, string]
- [1, lead weight]
out:
- [1, fishing tackle]
known: [tree]
world:
dsl: |
{grass}
upperleft: [0, 0]
offset: false
palette:
'B': [grass, null, base]
'.': [grass]
'w': [grass, lakewater]
'A': [grass, avocado]
'i': [grass, rice]
'c': [grass, cucumber]
map: |
.AA.................
.AA........wwwwww...
......B...wwwwwwww..
.ii.......wwwwwwww..
.ii......wwwwwwwww..
.........wwwwwwww...
.cc........wwww.....
.cc.................
Loading

0 comments on commit ae551e8

Please sign in to comment.