From 5c485ad5cd9f15e251d7f9e3aa497667dd4090fb Mon Sep 17 00:00:00 2001 From: Karl Ostmo Date: Mon, 23 Sep 2024 08:44:24 -0700 Subject: [PATCH] use wall rendering (#2153) Makes use of #1285 to simplify wall rendering in several scenarios. --- data/scenarios/Challenges/2048.yaml | 19 ++++++----- .../Challenges/Sokoban/foresight.yaml | 2 +- data/scenarios/Challenges/bucket-brigade.yaml | 20 ++++++----- data/scenarios/Challenges/chess_horse.yaml | 34 ++++++++++--------- data/scenarios/Challenges/dimsum.yaml | 13 ++++++- data/scenarios/Challenges/hanoi.yaml | 26 +++++++------- data/scenarios/Challenges/ice-cream.yaml | 19 ++++++----- data/scenarios/Challenges/teleport.yaml | 24 +++++++------ 8 files changed, 89 insertions(+), 68 deletions(-) diff --git a/data/scenarios/Challenges/2048.yaml b/data/scenarios/Challenges/2048.yaml index bc1de2016..592c88e5b 100644 --- a/data/scenarios/Challenges/2048.yaml +++ b/data/scenarios/Challenges/2048.yaml @@ -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"] @@ -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 diff --git a/data/scenarios/Challenges/Sokoban/foresight.yaml b/data/scenarios/Challenges/Sokoban/foresight.yaml index bb5d7d632..4c3751d59 100644 --- a/data/scenarios/Challenges/Sokoban/foresight.yaml +++ b/data/scenarios/Challenges/Sokoban/foresight.yaml @@ -92,7 +92,7 @@ entities: char: '#' description: - Unmovable barrier - properties: [known, unwalkable] + properties: [known, unwalkable, boundary] known: [mountain, water, 3D printer, flower] world: dsl: | diff --git a/data/scenarios/Challenges/bucket-brigade.yaml b/data/scenarios/Challenges/bucket-brigade.yaml index 5e76ad00e..25962432c 100644 --- a/data/scenarios/Challenges/bucket-brigade.yaml +++ b/data/scenarios/Challenges/bucket-brigade.yaml @@ -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] @@ -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: |- @@ -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........................ diff --git a/data/scenarios/Challenges/chess_horse.yaml b/data/scenarios/Challenges/chess_horse.yaml index 90dcd8c71..e77ae2d68 100644 --- a/data/scenarios/Challenges/chess_horse.yaml +++ b/data/scenarios/Challenges/chess_horse.yaml @@ -31,6 +31,13 @@ robots: dir: [0, 0] display: char: '♚' +entities: + - name: wall + display: + char: '#' + description: + - Unmovable barrier + properties: [known, unwalkable, boundary] known: [water] world: dsl: | @@ -38,21 +45,16 @@ world: 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 diff --git a/data/scenarios/Challenges/dimsum.yaml b/data/scenarios/Challenges/dimsum.yaml index ffeac0c90..00d1cdae4 100644 --- a/data/scenarios/Challenges/dimsum.yaml +++ b/data/scenarios/Challenges/dimsum.yaml @@ -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] @@ -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 @@ -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] diff --git a/data/scenarios/Challenges/hanoi.yaml b/data/scenarios/Challenges/hanoi.yaml index bbb99ff9a..300302f19 100644 --- a/data/scenarios/Challenges/hanoi.yaml +++ b/data/scenarios/Challenges/hanoi.yaml @@ -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 @@ -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,,, diff --git a/data/scenarios/Challenges/ice-cream.yaml b/data/scenarios/Challenges/ice-cream.yaml index b2c9ae253..45ed04e42 100644 --- a/data/scenarios/Challenges/ice-cream.yaml +++ b/data/scenarios/Challenges/ice-cream.yaml @@ -195,6 +195,12 @@ entities: description: - Decoration properties: [known] + - name: wall + display: + char: '#' + description: + - Unmovable barrier + properties: [known, unwalkable, boundary] recipes: - in: - [1, egg] @@ -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] @@ -239,6 +240,6 @@ world: ...:.......... ...:.......OO. yzy:yzyz..OOOO - ┌─┐x┌──┐..^^^^ - │B:Ω:V6│..\ZZ/ - └──────┘...\/. + wwwxwwww..^^^^ + wB:Ω:V6w..\ZZ/ + wwwwwwww...\/. diff --git a/data/scenarios/Challenges/teleport.yaml b/data/scenarios/Challenges/teleport.yaml index 736d8f074..3e0b049e4 100644 --- a/data/scenarios/Challenges/teleport.yaml +++ b/data/scenarios/Challenges/teleport.yaml @@ -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: | @@ -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~ , ~~~ ~ ~ ~