Overall, this looks pretty complicated as something to start with. However, defining original-position shouldn’t be too awful. You can say “Every pawn has a position called current-position” and also “Every pawn has a position called original-position”; that way, you can write a routine that sets the current-position of all the pawns to their original-positions, and invoke it whenever you need to.
I wasn’t quite sure about what you said about referring to “black b2 pawn” etc. in the source, but if you just write “on the board is a black b2 pawn” etc., you won’t actually create a pawn (let alone one with color black and position b2); you’ll just create a thing called “black b2 pawn.” At least that’s what happened when I tried to type it in. To avoid giving myself the screaming heebie-jeebies, I’d define the pieces with a table, as in section 15.16. Even then, many pitfalls await.
I put a semi-working thingy under the spoiler tag. If you want to try it out, hit the “quote” button as if you were replying to this post, then copy-paste the code out of that box; that’ll preserve the all-important tab stops.
[spoiler][code]Position is a kind of value. The positions are a1, a2, a3, a4, a5, a6, a7, a8, b1, b2, b3, b4, b5, b6, b7, b8, c1, c2, c3, c4, c5, c6, c7, c8, d1, d2, d3, d4, d5, d6, d7, d8, e1, e2, e3, e4, e5, e6, e7, e8, f1, f2, f3, f4, f5, f6, f7, f8, g1, g2, g3, g4, g5, g6, g7, g8, h1, h2, h3, h4, h5, h6, h7, and h8.
Color is a kind of value. The colors are black and white.
A pawn is a kind of thing. A pawn has a color. A pawn has a position called current-position. A pawn has a position called original-position.
[Note that the pawn has two different positions associated with it; this is legal.]
The printed name of a pawn is “[color of the item described] [current-position of the item described] pawn”.
[This means that, whenever the game talks about the pawn, it’ll say “white a5 pawn” or whatever instead of using the goofy names defined in the table.]
Chess club is a room. A board is a supporter in chess club.
Some pawns are defined by the table of chessfolk. [Unfortunately the compiler barfs if you say “table of pawns.” Hence this dumb name.]
Table of chessfolk
pawn color original-position
white-a pawn white a2
white-b pawn white b2
white-c pawn white c2
black-a pawn black a7
black-b pawn black b7
black-c pawn black c7 [Also, unfortunately, the compiler barfs if you name pawns things like “white b pawn” without the hyphen. Apparently, it then interprets “white” in the color column as referring to the white b pawn thing, instead of the color “white.” There may be a way around this namespace clash, but I just put in a hyphen.]
To reset the pawns: [This is the rule for restoring things to the original position. Alice is just a temporary variable name.]
repeat with Alice running through pawns:
now Alice is on the board; [this was the easiest way I could think of to put all the pawns on the board]
now the current-position of Alice is the original-position of Alice.
When play begins: reset the pawns. [This way we don’t actually have to specify the starting current-position in the table.]
[Now let’s implement some moves.]
Moving it to is an action applying to one thing and one position.
Understand “move [something] to [position]” as moving it to.
Check moving it to: if the noun is not a pawn, say “You can only move pawns.” instead. [You could also write rules restricting the moves to legal positions. Better you than me, I fear.]
Carry out moving it to:
now the current-position of the noun is the position understood.
Report moving it to:
say “You move the pawn to [current-position of the noun].” [If we were being really stylish, we’d save the old current-position so we could say which square you were moving it from as well. We’re not being really stylish.]
Understand the current-position property as describing a pawn. Understand the color property as describing a pawn. [This means that commands like “move black pawn” and “move a5 pawn” will be understood. I’m not sure, but I think “pawn” may be understood only because all the pawns have “pawn” in their names. There’s a better way to make that happen but I came down with a case of the fails and couldn’t find it. “white-a pawn” will probably also be understood, but there’s no risk of the player actually trying it.]
Moving it wrong is an action applying to one thing and one topic. Understand “move [something] to [text]” as moving it wrong. [This just catches cases where the player types in an invalid position.]
Instead of moving something wrong: say “You can’t move something to [topic understood]; you can only move things to positions on the board.”
Resigning is an action applying to nothing. Understand “resign” as resigning.
Carry out resigning: reset the pawns.
Report resigning: say “You move the pawns back to their original places.”[/code][/spoiler]