Skip to content

Commit

Permalink
normalize scenarios (#1711)
Browse files Browse the repository at this point in the history
Closes #845

**All changes are non-significant whitespace.**  This can be verified with:

    git show --ignore-all-space --ignore-blank-lines

in which the remaining changes are only elimination of manual word-wrap in descriptions.

Normalization is accomplished with this command:

    scripts/normalize-all-scenarios.sh

This is an initial normalization pass that shall be a pre-requisite for #1713.
  • Loading branch information
kostmo authored Jan 5, 2024
1 parent 3cfc3c4 commit ab9f86e
Show file tree
Hide file tree
Showing 145 changed files with 915 additions and 1,154 deletions.
79 changes: 36 additions & 43 deletions data/scenarios/Challenges/2048.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@ author: Brent Yorgey
description: Make 2048!
objectives:
- goal:
- OK, OK, it's not really the same as the classic "2048" game.
However, your goal is still to make 2048! You start with a `1`{=entity}
which regrows immediately when
it is `harvest`ed, so if you plant it, you can get as many as you want. Your
job is to combine `1`{=entity}s in order to make a `2048`{=entity}
entity.
- "Hint: the `format` command can turn numbers into strings!"
- OK, OK, it's not really the same as the classic "2048" game. However, your goal is still to make 2048! You start with a `1`{=entity} which regrows immediately when it is `harvest`ed, so if you plant it, you can get as many as you want. Your job is to combine `1`{=entity}s in order to make a `2048`{=entity} entity.
- "Hint: the `format` command can turn numbers into strings!"
condition: |
try {
as base {has "2048"}
Expand All @@ -29,132 +24,130 @@ entities:
attr: gold
char: "#"
description:
- This is a one. Maybe you can combine it with other ones
somehow.
- This is a one. Maybe you can combine it with other ones somehow.
properties: [growable, portable, infinite]
- name: "2"
display:
attr: gold
char: "#"
description:
- This is a two. Maybe you can combine it with other twos
somehow.
- This is a two. Maybe you can combine it with other twos somehow.
properties: [portable]
- name: "4"
display:
attr: gold
char: "#"
description:
- This is a four. You get the idea.
- This is a four. You get the idea.
properties: [portable]
- name: "8"
display:
attr: gold
char: "#"
description:
- An eight.
- An eight.
properties: [portable]
- name: "16"
display:
attr: gold
char: "#"
description:
- A 16.
- A 16.
properties: [portable]
- name: "32"
display:
attr: gold
char: "#"
description:
- A 32.
- A 32.
properties: [portable]
- name: "64"
display:
attr: gold
char: "#"
description:
- A 64.
- A 64.
properties: [portable]
- name: "128"
display:
attr: gold
char: "#"
description:
- A 128.
- A 128.
properties: [portable]
- name: "256"
display:
attr: gold
char: "#"
description:
- A 256.
- A 256.
properties: [portable]
- name: "512"
display:
attr: gold
char: "#"
description:
- A 512.
- A 512.
properties: [portable]
- name: "1024"
display:
attr: gold
char: "#"
description:
- A 1024.
- A 1024.
properties: [portable]
- name: "2048"
display:
attr: gold
char: "#"
description:
- A 2048.
- A 2048.
properties: [portable]
recipes:
- in:
- [2, "1"]
- [2, "1"]
out:
- [1, "2"]
- [1, "2"]
- in:
- [2, "2"]
- [2, "2"]
out:
- [1, "4"]
- [1, "4"]
- in:
- [2, "4"]
- [2, "4"]
out:
- [1, "8"]
- [1, "8"]
- in:
- [2, "8"]
- [2, "8"]
out:
- [1, "16"]
- [1, "16"]
- in:
- [2, "16"]
- [2, "16"]
out:
- [1, "32"]
- [1, "32"]
- in:
- [2, "32"]
- [2, "32"]
out:
- [1, "64"]
- [1, "64"]
- in:
- [2, "64"]
- [2, "64"]
out:
- [1, "128"]
- [1, "128"]
- in:
- [2, "128"]
- [2, "128"]
out:
- [1, "256"]
- [1, "256"]
- in:
- [2, "256"]
- [2, "256"]
out:
- [1, "512"]
- [1, "512"]
- in:
- [2, "512"]
- [2, "512"]
out:
- [1, "1024"]
- [1, "1024"]
- in:
- [2, "1024"]
- [2, "1024"]
out:
- [1, "2048"]
- [1, "2048"]
robots:
- name: base
dir: east
Expand Down
24 changes: 12 additions & 12 deletions data/scenarios/Challenges/Mazes/easy_cave_maze.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ name: Cave shaped maze
author: Ondřej Šebek
description: A maze shaped like a cave. It only goes down or forward.
objectives:
- goal:
- You are at the top of a cave that gradually descends until reaching a dead end.
- At its bottom is a great treasure.
- Luckily, the cave does not branch out, so it is easy to find the path to the treasure.
- Send a robot to the the item marked as '**!**'. You win once the robot `grab`s it.
condition: |
j <- robotNamed "judge";
as j {has "goal"}
- goal:
- You are at the top of a cave that gradually descends until reaching a dead end.
- At its bottom is a great treasure.
- Luckily, the cave does not branch out, so it is easy to find the path to the treasure.
- Send a robot to the the item marked as '**!**'. You win once the robot `grab`s it.
condition: |
j <- robotNamed "judge";
as j {has "goal"}
solution: |
def until = \p. \c. b <- p; if b {} {c; until p c} end;
def fwd = until blocked move end;
Expand Down Expand Up @@ -42,7 +42,7 @@ robots:
- [50, grabber]
- [0, goal]
- name: judge
dir: [0,0]
dir: [0, 0]
system: true
program: |
def until = \c. b <- c; if b {} {until c} end;
Expand All @@ -55,14 +55,14 @@ entities:
char:
attr: rock
description:
- An impassable stone wall.
- An impassable stone 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.
- The place you're trying to reach! You win by executing `grab` on this item.
properties: [known, portable]
world:
dsl: |
Expand All @@ -73,7 +73,7 @@ world:
'~': [stone, water]
'': [stone, wall]
'!': [stone, goal, judge]
upperleft: [0,0]
upperleft: [0, 0]
map: |
██████████████████████████████
█Ω ████████ █████████████████
Expand Down
25 changes: 12 additions & 13 deletions data/scenarios/Challenges/Mazes/easy_spiral_maze.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ name: Spiral shaped maze
author: Ondřej Šebek
description: A maze shaped like a spiral, with a twist!
objectives:
- goal:
- You find yourself in the middle of a large maze.
- It's straightforward to get out, but the path is long and dull.
- You need to send a robot to the goal square, labelled with an exclamation mark;
you win by `grab`bing the `goal`{=entity}.
- Beware! The winding corridors are wider then they look!
condition: |
j <- robotNamed "judge";
as j {has "goal"}
- goal:
- You find yourself in the middle of a large maze.
- It's straightforward to get out, but the path is long and dull.
- You need to send a robot to the goal square, labelled with an exclamation mark; you win by `grab`bing the `goal`{=entity}.
- Beware! The winding corridors are wider then they look!
condition: |
j <- robotNamed "judge";
as j {has "goal"}
solution: |
def until = \p. \c. b <- p; if b {} {c; until p c} end;
def fwd = until blocked move end;
Expand Down Expand Up @@ -43,7 +42,7 @@ robots:
- [50, grabber]
- [0, goal]
- name: judge
dir: [0,0]
dir: [0, 0]
system: true
program: |
def until = \c. b <- c; if b {} {until c} end;
Expand All @@ -55,14 +54,14 @@ entities:
char:
attr: rock
description:
- An impassable stone wall.
- An impassable stone 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.
- The place you're trying to reach! You win by executing `grab` on this item.
properties: [known, portable]
world:
dsl: |
Expand All @@ -72,7 +71,7 @@ world:
' ': [stone, null]
'': [stone, wall]
'!': [stone, goal, judge]
upperleft: [0,0]
upperleft: [0, 0]
map: |
████████████████████████████████████
██ ██
Expand Down
31 changes: 13 additions & 18 deletions data/scenarios/Challenges/Mazes/invisible_maze.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
version: 1
name: Invisible 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?
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`{=entity}.
- In this challenge, it is guaranteed that the maze is a tree, that is,
there are no loops within the maze.
condition: |
try {
teleport self (27, -17);
b <- ishere "goal";
return (not b)
} { return false }
- 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`{=entity}.
- In this challenge, it is guaranteed that the maze is a tree, that is, there are no loops within the maze.
condition: |
try {
teleport self (27, -17);
b <- ishere "goal";
return (not b)
} { return false }
solution: |
def tL = turn left end;
def tR = turn right end;
Expand Down Expand Up @@ -55,14 +50,14 @@ entities:
display:
invisible: true
description:
- An invisible wall.
- 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.
- The place you're trying to reach! You win by executing `grab` on this item.
properties: [known, portable]
world:
dsl: |
Expand All @@ -73,7 +68,7 @@ world:
'x': [grass, wall]
'@': [grass, boulder]
'!': [grass, goal]
upperleft: [-1,1]
upperleft: [-1, 1]
map: |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@Ω........x...x..............@
Expand Down
Loading

0 comments on commit ab9f86e

Please sign in to comment.