Skip to content

Commit

Permalink
use wall rendering (#2153)
Browse files Browse the repository at this point in the history
Makes use of #1285 to simplify wall rendering in several scenarios.
  • Loading branch information
kostmo authored Sep 23, 2024
1 parent 99ab1ce commit 5c485ad
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 68 deletions.
19 changes: 10 additions & 9 deletions data/scenarios/Challenges/2048.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ entities:
description:
- A 2048.
properties: [pickable]
- name: wall
display:
char: '#'
description:
- Unmovable barrier
properties: [known, unwalkable, boundary]
recipes:
- in:
- [2, "1"]
Expand Down Expand Up @@ -176,14 +182,9 @@ world:
{stone}
palette:
"Ω": [grass, null, base]
"": [stone, upper left corner]
"": [stone, upper right corner]
"": [stone, lower left corner]
"": [stone, lower right corner]
"": [stone, horizontal wall]
"": [stone, vertical wall]
'w': [stone, wall]
upperleft: [-1, 3]
map: |
┌─┐
│Ω│
└─┘
www
wΩw
www
2 changes: 1 addition & 1 deletion data/scenarios/Challenges/Sokoban/foresight.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ entities:
char: '#'
description:
- Unmovable barrier
properties: [known, unwalkable]
properties: [known, unwalkable, boundary]
known: [mountain, water, 3D printer, flower]
world:
dsl: |
Expand Down
20 changes: 12 additions & 8 deletions data/scenarios/Challenges/bucket-brigade.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ entities:
description:
- Kit that can be unpacked into everything a robot needs to reproduce.
properties: [known, pickable]
- name: wall
display:
char: '#'
description:
- Unmovable barrier
properties: [known, unwalkable, boundary]
recipes:
- in:
- [1, repro kit]
Expand Down Expand Up @@ -185,13 +191,11 @@ world:
'H': [stone, null, hauler]
'Z': [stone, null, powerplant]
'w': [grass]
'x': [stone, wall]
's': [stone]
'A': [stone, boulder]
'': [stone, upper left corner]
'': [stone, upper right corner]
'': [stone, lower left corner]
'': [stone, lower right corner]
'': [stone, horizontal wall]
'': [stone, vertical wall]
upperleft: [0, 0]
map: |-
Expand All @@ -203,11 +207,11 @@ world:
..AA......................
...A..A...............┌┐..
..A.................┌┐││..
.....A.............┌────┐.
...................│sZss│.
.A.................└────┘.
.....A.............xxxxxx.
...................xsZssx.
.A.................xxxxxx.
.....A......B==========H=.
..........................
.............┌┐.┌──────┐..
w......A.....└┘.└──────┘..
.............xx.xxxxxxxx..
w......A.....xx.xxxxxxxx..
ww........................
34 changes: 18 additions & 16 deletions data/scenarios/Challenges/chess_horse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,30 @@ robots:
dir: [0, 0]
display:
char: ''
entities:
- name: wall
display:
char: '#'
description:
- Unmovable barrier
properties: [known, unwalkable, boundary]
known: [water]
world:
dsl: |
{ice, water}
palette:
'.': [grass, erase]
'#': [ice, erase]
'': [stone, upper left corner]
'': [stone, upper right corner]
'': [stone, lower left corner]
'': [stone, lower right corner]
'': [stone, horizontal wall]
'': [stone, vertical wall]
'w': [stone, wall]
upperleft: [-1, 1]
map: |
┌────────┐
.#.#.#.#
#.#.#.#.
.#.#.#.#
#.#.#.#.
.#.#.#.#
#.#.#.#.
.#.#.#.#
#.#.#.#.
└────────┘
wwwwwwwwww
w.#.#.#.#w
w#.#.#.#.w
w.#.#.#.#w
w#.#.#.#.w
w.#.#.#.#w
w#.#.#.#.w
w.#.#.#.#w
w#.#.#.#.w
wwwwwwwwww
13 changes: 12 additions & 1 deletion data/scenarios/Challenges/dimsum.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ objectives:
}
solution: |
run "scenarios/Challenges/_dimsum/solution.sw"
attrs:
- name: barrier
fg: "#222222"
bg: "#111111"
robots:
- name: base
dir: [1, 0]
Expand Down Expand Up @@ -73,6 +77,13 @@ robots:
program: |
run "scenarios/Challenges/_dimsum/patron.sw"
entities:
- name: wall
display:
attr: barrier
char: '#'
description:
- Unmovable barrier
properties: [known, unwalkable, boundary]
- name: table
display:
attr: wood
Expand Down Expand Up @@ -134,7 +145,7 @@ world:
'B': [grass, erase, base]
'.': [grass, erase]
'S': [dirt, erase]
'@': [grass, boulder]
'@': [grass, wall]
'd': [grass, table]
'k': [grass, table, cook]
'p': [grass, table, patron]
Expand Down
26 changes: 13 additions & 13 deletions data/scenarios/Challenges/hanoi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ entities:
attr: gold
description:
- This entity signals that the column is sorted.
- name: wall
display:
char: '#'
description:
- Unmovable barrier
properties: [known, unwalkable, boundary]
known:
- bottom tee
- OK
Expand All @@ -159,26 +165,20 @@ world:
',': [grass]
'_': [stone]
'v': [stone, null, base]
'': [stone, upper left corner]
'': [stone, upper right corner]
'': [stone, lower left corner]
'': [stone, lower right corner]
'': [stone, horizontal wall]
'': [stone, vertical wall]
'': [stone, bottom tee]
'1': [stone, one, invariant]
'2': [stone, blocked two, invariant]
'3': [stone, blocked three, invariant]
'.': [stone, null, invariant]
'^': [grass, null, increasing]
'X': [grass, three, count]
'w': [stone, wall]
upperleft: [-3, 1]
map: |
┌─────┐
│__v__│
│1│.│.│
│2│.│.│
│3│.│.│
└─┴─┴─┘
wwwwwww
w__v__w
w1w.w.w
w2w.w.w
w3w.w.w
wwwwwww
,^,^,^,
,,,X,,,
19 changes: 10 additions & 9 deletions data/scenarios/Challenges/ice-cream.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,12 @@ entities:
description:
- Decoration
properties: [known]
- name: wall
display:
char: '#'
description:
- Unmovable barrier
properties: [known, unwalkable, boundary]
recipes:
- in:
- [1, egg]
Expand All @@ -220,12 +226,7 @@ world:
X: [stone, null, customer]
'y': [stone, awning1]
'z': [stone, awning2]
'': [stone, upper left corner]
'': [stone, upper right corner]
'': [stone, lower left corner]
'': [stone, lower right corner]
'': [stone, horizontal wall]
'': [stone, vertical wall]
'w': [stone, wall]
'\': [stone, cone left]
'/': [stone, cone right]
'Z': [stone, cone inside]
Expand All @@ -239,6 +240,6 @@ world:
...:..........
...:.......OO.
yzy:yzyz..OOOO
┌─┐x┌──┐..^^^^
│B:Ω:V6│..\ZZ/
└──────┘...\/.
wwwxwwww..^^^^
wB:Ω:V6w..\ZZ/
wwwwwwww...\/.
24 changes: 13 additions & 11 deletions data/scenarios/Challenges/teleport.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ robots:
basePos <- as base {whereami};
if (myPos == basePos) {teleport base destPos} {};
);
entities:
- name: wall
display:
char: '#'
description:
- Unmovable barrier
properties: [known, unwalkable, boundary]
known: [water, wavy water, flower, tree]
world:
dsl: |
Expand All @@ -66,19 +73,14 @@ world:
'T': [grass, tree]
'.': [grass, erase]
'_': [stone, erase]
'': [stone, upper left corner]
'': [stone, upper right corner]
'': [stone, lower left corner]
'': [stone, lower right corner]
'': [stone, horizontal wall]
'': [stone, vertical wall]
'λ': [grass, lambda]
'x': [stone, wall]
upperleft: [-1, 3]
map: |
~~ ~ ~ ~
~┌─────┐~ ┌─────┐~ ,
┌┘.....└───┘T...*└┐ ~
│_....._ _..λ.._│ ,
└┐.....┌───┐*...T┌┘ ~
~└─────┘ ~~└─────┘~ ,
~xxxxxxx~ xxxxxxx~ ,
xx.....xxxxxT...*xx ~
x_....._ _..λ.._x ,
xx.....xxxxx*...Txx ~
~xxxxxxx ~~xxxxxxx~ ,
~~~ ~ ~ ~

0 comments on commit 5c485ad

Please sign in to comment.