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

use wall rendering #2153

Merged
merged 1 commit into from
Sep 23, 2024
Merged
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
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]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this one will probably look strange with connected walls, won't it?

Copy link
Member Author

@kostmo kostmo Sep 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't mind the aesthetic, but it does look a bit like random ladders/staircases, which could be misleading.
Maybe at some point I'll consider a more sophisticated renderer that eliminates interior boundaries.

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's an interesting challenge to specify how such a more sophisticated renderer should work. Like, I think I have an intuitive idea of what I think the result should look like (though it may not be the same as yours), but I think there is some interesting graph theory needed to compute the right drawing. I will see if I can give it some thought.

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~ ,
~~~ ~ ~ ~
Loading