Computer Chess with IF Authoring Systems

Very off topic from IF, I’ve just posted this in the ZIL group on Facebook but I’ll post here in case anyone wants to chip in more generally… :slightly_smiling_face:

I wonder how far you could program the Z-Machine or other IF “machine” (using ZIL, Inform, TADS, whatever) to play Chess? You’d have to keep an actual Chess board next to you for visualisation obviously, but that’s no different to the Computer Chess tournaments of old. Would you have each space on the Chess board as a room, or use tables, or both?

Tagging in @aschultz since he released two Inform chess games last year (one, two) – the implementations used smaller boards and a limited set of pieces to support more focused puzzles, rather than just doing a regular chess game, but I’m guessing it wouldn’t be hard to adapt to the plain-vanilla version. I think he used both rooms and tables but that’s just a guess! Oh, and he also included an ascii visualization of the board, no need to have a physical one handy.

(The games are really fun too, and I think didn’t get the amount of attention they deserved).

3 Likes

In 4X4Q he used rooms, no tables.
I still had to get my board out even though the ASCII board was really useful, because that’s the way my brains work.

2 Likes
4 Likes

In I6, I would write some wrapper functions to simulate 2-D array access on an I6 array. And in I7, I would… use I6 to write some wrapper functions to simulate 2-D array access on an I6 array. The real limit on how well one could do this is the Z-machine’s memory limits, which would eventually impose a practical limit on how much possibility-space the chess program could explore. But my guess is that you’d hit a pain point with speed before you hit the pain point with memory.

And you wouldn’t need a physical chessboard: a 24 x 80 grid is plenty of space for a viable ASCII representation!

(GlkChess is I6 targeting Glulx.)

1 Like

Microchess is only 1K on Sinclair.

All you have to do is create an array 64xN. Represent the board with string. Generate subsequent positions according to legal moves. Recurse into positions with good evaluation score. Repeat until memory/time runs out. Use MinMax algorithm.

That’s about it. Of course, it can be complex, such as iterative deepening, hash, or sophisticated evaluation functions.

2 Likes

Fantastic! I’ll check them out, thanks for the links!

Adam :+1:

1 Like

To use the parlance of today’s kids… GlkChess just handed my ass to me! Impressive. :sweat_smile:

Well, now I’m more than a little embarrassed as FDE was entered into ParserComp! Sadly as many know I had to step away due to bereavement (on top of an already rubbish year) and so I have to admit that I didn’t even get to play many of the games.

You’re right though, this looks like a cool little gem of a game! As I’m in a chess mood I’ll give it a good play!

1 Like

I’m also thinking it would be fun to see different Chess games pitched against each other in a gritty winner-takes-all! The final showdown between Inform and TADS - the battle of the ages! :smiley:

5 Likes

I played a quick glkchess game on level one. It was really potent. I had to take back a couple moves. Turns out it’s based on Marcel Simple Chess Program. Yeah, that’s really potent. Good luck beating it, even on level 1!

I did manage to win a knight and proceeded to win the game via forced trading. It plays a bad endgame, but since it was level one, that’s understandable.

1 Like

Oooh, what about a Jam about implementing any boardgame in a parser system, including chess? Call it the “>ROLL DICE Jam” !

3 Likes

It’s definitely different, interesting and fun! If I hadn’t just handed over the reigns for ParserComp due to health fears I’d be all over it! It wouldn’t take too much effort for someone to run… Here’s hoping someone may take up the mantle. :slightly_smiling_face::crossed_fingers:

MAGIC: The Text Adventure Gathering

> ENTER STORE
The shopkeeper at the cash register awaits your purchase.

> EXAMINE SEALED DECK
Ooooh ... Three hundred cards, and a Cyclonic Rift on top!

> OPEN WALLET
Moths flutter out.  A lonely fifty-dollar bill sits inside, folded in
half for a rainy day.

> BUY DECK
It's yours!  And your wallet is mercifully empty now.

> UNSEAL DECK
The Cyclonic Rift card falls into a storm drain and is flushed away.  The
remaining 299 cards are either Gnomish Stand-up Comic or Tulips of Garish Colour.
5 Likes

What sparked this off was my watching Computer Chess for the 10th time, it’s a weird little indie film - a sort of mock documentary - that’s set circa 80-82 (by my rough estimates). Definitely worth watching but a little weird.

For board games, I think Point and Click is better fit.

Just want to pipe up here and say some of us have been working on board games authored with non-parser tools for a while now.

Just this month, Choice of Games published my version of Senet (also goes by other names like The Royal Game of Ur), the oldest known board game in the world. Even Tutankhamun had one in his tomb :palm_tree:

Senet’s probably the most fun board game I’ve ever played, but I definitely wouldn’t recommend using ChoiceScript to author a chess simulator :rofl::rofl::rofl:

5 Likes

You have four stats: diagnol, straight, jumping, and castle…

2 Likes

The star of Computer Chess, Wiley Wiggins, was an occasional visitor to rec.arts.int.fiction. He’s written some short games: Wiley Wiggins / Interactive Text

2 Likes

Only peripherally related, but I did this for a April Fool’s joke a few years back: Announcing LcZ, the world's first neural net based chess engine and interactive fiction amalgamation. - Leela Chess Zero

1 Like