-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add robotNamed : string -> cmd robot * add chess knight challenge In challenges, it's impossible to access the robot by its assigned number. We do however name it. Seems reasonable to add a way to get robot by its name.
- Loading branch information
Showing
6 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Chess Knight | ||
description: In this quirky challenge, you move as the chess knight piece. Can you capture the enemy king? | ||
entities: | ||
- name: goal | ||
display: | ||
attr: device | ||
char: 'X' | ||
description: | ||
- | | ||
Robots can use the 'move' command to move. | ||
But they only 'turn' in cardinal directions. | ||
You are special. You are a knight. | ||
Go forth and capture the King! | ||
properties: [portable] | ||
- name: knownwater | ||
display: | ||
attr: water | ||
char: ' ' | ||
description: | ||
- An infinite ocean of water. | ||
properties: [known, portable, growable, liquid] | ||
growth: [0,0] | ||
win: | | ||
try { | ||
bloc <- as base {whereami}; | ||
king <- robotNamed "king"; | ||
kloc <- as king {whereami}; | ||
return (bloc == kloc) | ||
} { return false } | ||
robots: | ||
- name: horse | ||
loc: [0,0] | ||
dir: [2,-1] | ||
devices: | ||
- treads | ||
- logger | ||
inventory: | ||
- [1, goal] | ||
display: | ||
char: '♘' | ||
- name: king | ||
loc: [7,-6] | ||
dir: [0,0] | ||
display: | ||
char: '♚' | ||
world: | ||
default: [ice, knownwater] | ||
palette: | ||
'.': [grass, null] | ||
'#': [ice, null] | ||
'┌': [stone, upper left corner] | ||
'┐': [stone, upper right corner] | ||
'└': [stone, lower left corner] | ||
'┘': [stone, lower right corner] | ||
'─': [stone, horizontal wall] | ||
'│': [stone, vertical wall] | ||
upperleft: [-1, 1] | ||
map: | | ||
┌────────┐ | ||
│.#.#.#.#│ | ||
│#.#.#.#.│ | ||
│.#.#.#.#│ | ||
│#.#.#.#.│ | ||
│.#.#.#.#│ | ||
│#.#.#.#.│ | ||
│.#.#.#.#│ | ||
│#.#.#.#.│ | ||
└────────┘ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters