Skip to content

Commit

Permalink
fix a bunch more scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
byorgey committed Jan 5, 2025
1 parent 61dc815 commit f4f84eb
Show file tree
Hide file tree
Showing 20 changed files with 65 additions and 59 deletions.
2 changes: 1 addition & 1 deletion data/scenarios/Challenges/pack-tetrominoes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ objectives:
Place all five tetrominoes.
condition: |
def found = \s.
fs <- structure s 0;
fs <- structures s;
return $ case fs (\_. false) (\_. true);
end;
Expand Down
4 changes: 2 additions & 2 deletions data/scenarios/Challenges/word-search.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ objectives:
or vertically in either the upward or downward direction.
Diagonal appearances are not valid.
condition: |
foundStructure <- structure "cow" 0;
return $ case foundStructure (\_. false) (\_. true);
foundStructures <- structures "cow";
return $ case foundStructures (\_. false) (\_. true);
robots:
- name: base
display:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ objectives:
- |
Build 3 `chevron`{=structure} structures
condition: |
foundStructure <- structure "chevron" 0;
return $ case foundStructure (\_. false) (\x. fst x >= 3);
def length : (rec l. Unit + a * l) -> Int = \l.
case l (\_. 0) (\cons. 1 + length (snd cons))
end;
foundStructures <- structures "chevron";
return $ length foundStructures >= 3
robots:
- name: base
dir: east
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ objectives:
- |
Build a `precious`{=structure} structure
condition: |
foundStructure <- structure "precious" 0;
foundStructure <- structures "precious";
return $ case foundStructure (\_. false) (\_. true);
robots:
- name: base
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ objectives:
- |
Build 12 copies of the `green_jewel`{=structure} structure
condition: |
foundGreen <- structure "green_jewel" 0;
return $ case foundGreen (\_. false) (\x. fst x >= 12);
def length : (rec l. Unit + a * l) -> Int = \l.
case l (\_. 0) (\cons. 1 + length (snd cons))
end;
foundGreen <- structures "green_jewel";
return $ length foundGreen >= 12;
robots:
- name: base
dir: east
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ objectives:
- |
Build 2 of the same structure
condition: |
foundStructure <- structure "chessboard" 0;
return $ case foundStructure (\_. false) (\fs.
let boardCount = fst fs in
boardCount >= 2;
);
def length : (rec l. Unit + a * l) -> Int = \l.
case l (\_. 0) (\cons. 1 + length (snd cons))
end;
foundStructures <- structures "chessboard";
return $ length foundStructures >= 2
- id: premature_win
teaser: Don't count win early
optional: true
Expand All @@ -29,13 +29,13 @@ objectives:
Two structures shouldn't be recognized
while the bases still possesses `silver`{=entity}
condition: |
def length : (rec l. Unit + a * l) -> Int = \l.
case l (\_. 0) (\cons. 1 + length (snd cons))
end;
robotHasSilver <- as base {has "silver"};
foundStructure <- structure "chessboard" 0;
return $ case foundStructure (\_. false) (\fs.
let boardCount = fst fs in
boardCount >= 2 && robotHasSilver;
);
foundStructures <- structures "chessboard";
return $ length foundStructures >= 2 && robotHasSilver;
robots:
- name: base
dir: south
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ objectives:
- |
Build 2 of the same structure
condition: |
foundStructure <- structure "chessboard" 0;
return $ case foundStructure (\_. false) (\fs.
let boardCount = fst fs in
boardCount >= 2;
);
def length : (rec l. Unit + a * l) -> Int = \l.
case l (\_. 0) (\cons. 1 + length (snd cons))
end;
foundStructures <- structures "chessboard";
return $ length foundStructures >= 2;
- id: premature_win
teaser: Don't count win early
optional: true
Expand All @@ -26,13 +26,13 @@ objectives:
Two structures shouldn't be recognized
while the bases still possesses `gold`{=entity}
condition: |
def length : (rec l. Unit + a * l) -> Int = \l.
case l (\_. 0) (\cons. 1 + length (snd cons))
end;
robotHasGold <- as base {has "gold"};
foundStructure <- structure "chessboard" 0;
return $ case foundStructure (\_. false) (\fs.
let boardCount = fst fs in
boardCount >= 2 && robotHasGold;
);
foundStructures <- structures "chessboard";
return $ length foundStructures >= 2 && robotHasGold;
robots:
- name: base
dir: south
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ objectives:
Build a `wooden box`{=structure} structure.
condition: |
def isRight = \x. case x (\_. false) (\_. true); end;
foundBox <- structure "wooden box" 0;
foundBox <- structures "wooden box";
return $ isRight foundBox;
robots:
- name: base
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ objectives:
- |
Build a `precious`{=structure} structure
condition: |
foundStructure <- structure "precious" 0;
foundStructure <- structures "precious";
return $ case foundStructure (\_. false) (\_. true);
robots:
- name: base
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ objectives:
- |
Place the `rock`{=entity} entity back inside the `pigpen`{=structure}.
condition: |
foundBox <- structure "pigpen" 0;
case foundBox (\_. return false) (\struc.
let structPos = snd struc in
foundBoxes <- structures "pigpen";
case foundBoxes (\_. return false) (\cons.
let structPos = fst cons in
j <- robotnamed "judge";
as j {
structBounds <- floorplan "pigpen";
Expand Down Expand Up @@ -49,8 +49,8 @@ objectives:
even with an extraneous entity within its bounds.
condition: |
def isRight = \x. case x (\_. false) (\_. true); end;
foundBox <- structure "pigpen" 0;
return $ isRight foundBox;
foundBoxes <- structures "pigpen";
return $ isRight foundBoxes;
robots:
- name: base
dir: east
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ objectives:
Replace `tree`{=entity} after grabbing.
The `double ring`{=structure} structure should be recognized again.
condition: |
foundStructure <- structure "double ring" 0;
foundStructure <- structures "double ring";
return $ case foundStructure (\_. false) (\_. true);
- teaser: Pre-recognized
id: pre_recognized
Expand All @@ -23,7 +23,7 @@ objectives:
- |
Pre-placed structure must be recognized
condition: |
foundStructure <- structure "double ring" 0;
foundStructure <- structures "double ring";
return $ case foundStructure (\_. false) (\_. true);
- teaser: Grab tree
id: grab_tree
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ objectives:
- |
Build a 3x3 structure
condition: |
foundStructure <- structure "large" 0;
foundStructure <- structures "large";
return $ case foundStructure (\_. false) (\_. true);
- id: wrong_structure
teaser: Don't recognize small structure
Expand All @@ -20,7 +20,7 @@ objectives:
- |
The small structure shouldn't be recognized.
condition: |
foundStructure <- structure "small" 0;
foundStructure <- structures "small";
return $ case foundStructure (\_. false) (\_. true);
robots:
- name: base
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ objectives:
- |
Build a `topleft`{=structure} structure
condition: |
foundStructure <- structure "topleft" 0;
foundStructure <- structures "topleft";
return $ case foundStructure (\_. false) (\_. true);
- id: wrong_structure
teaser: Don't recognize small structure
Expand All @@ -21,7 +21,7 @@ objectives:
- |
The `bottomright`{=structure} structure shouldn't be recognized.
condition: |
foundStructure <- structure "bottomright" 0;
foundStructure <- structures "bottomright";
return $ case foundStructure (\_. false) (\_. true);
robots:
- name: base
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ objectives:
condition: |
def isRight = \x. case x (\_. false) (\_. true); end;
foundGreen <- structure "green_jewel" 0;
foundGreen <- structures "green_jewel";
return $ isRight foundGreen;
- id: complete_red_structure
optional: true
Expand All @@ -26,7 +26,7 @@ objectives:
condition: |
def isRight = \x. case x (\_. false) (\_. true); end;
foundRed <- structure "red_jewel" 0;
foundRed <- structures "red_jewel";
return $ isRight foundRed;
robots:
- name: base
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ objectives:
- |
Remove a piece of the structure to destroy it
condition: |
foundStructure <- structure "chessboard" 0;
return $ case foundStructure (\_. true) (\_. false);
foundStructures <- structures "chessboard";
return $ case foundStructures (\_. true) (\_. false);
- id: complete_structure
teaser: Complete structure
goal:
- |
Build a `chessboard`{=structure} structure
condition: |
foundStructure <- structure "chessboard" 0;
return $ case foundStructure (\_. false) (\_. true);
foundStructures <- structures "chessboard";
return $ case foundStructures (\_. false) (\_. true);
robots:
- name: base
dir: south
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ objectives:
condition: |
def isRight = \x. case x (\_. false) (\_. true); end;
foundBlue <- structure "blue_jewel" 0;
foundGreen <- structure "green_jewel" 0;
foundRed <- structure "red_jewel" 0;
foundBlue <- structures "blue_jewel";
foundGreen <- structures "green_jewel";
foundRed <- structures "red_jewel";
return $ isRight foundBlue && not (isRight foundRed) && not (isRight foundRed);
- id: complete_green_structure
teaser: Complete green structure
Expand All @@ -26,8 +26,8 @@ objectives:
condition: |
def isRight = \x. case x (\_. false) (\_. true); end;
foundGreen <- structure "green_jewel" 0;
foundRed <- structure "red_jewel" 0;
foundGreen <- structures "green_jewel";
foundRed <- structures "red_jewel";
return $ isRight foundGreen && not (isRight foundRed);
- id: complete_red_structure
teaser: Complete red structure
Expand All @@ -37,7 +37,7 @@ objectives:
condition: |
def isRight = \x. case x (\_. false) (\_. true); end;
foundRed <- structure "red_jewel" 0;
foundRed <- structures "red_jewel";
return $ isRight foundRed;
robots:
- name: base
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ objectives:
- |
Have a `tee`{=structure} structure
condition: |
foundStructure <- structure "tee" 0;
foundStructure <- structures "tee";
return $ case foundStructure (\_. false) (\_. true);
robots:
- name: base
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ objectives:
- |
Build a `tee`{=structure} structure
condition: |
foundStructure <- structure "tee" 0;
foundStructure <- structures "tee";
return $ case foundStructure (\_. false) (\_. true);
robots:
- name: base
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ objectives:
condition: |
def isRight = \x. case x (\_. false) (\_. true); end;
foundBox <- structure "chevron" 0;
return $ isRight foundBox;
foundBoxes <- structures "chevron";
return $ isRight foundBoxes;
robots:
- name: base
dir: east
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ objectives:
even with an extraneous entity within its bounds.
condition: |
def isRight = \x. case x (\_. false) (\_. true); end;
foundBox <- structure "pigpen" 0;
return $ isRight foundBox;
foundBoxes <- structures "pigpen";
return $ isRight foundBoxes;
robots:
- name: base
dir: east
Expand Down

0 comments on commit f4f84eb

Please sign in to comment.