
Chord is a language for writing parser-based interactive fiction. A Chord story is a plain text file. It says what rooms there are and what is in them, who the people are and what they will talk about, what happens when the player does this or that, and how the story ends. The Sharpee platform reads that file and turns it into a game that plays in a terminal and in a web browser.
Chord was made for writers. Its lines read as sentences about a world, and none of them is program code in the usual sense. Nothing in it asks you to know how the platform underneath is built, and nothing in this book does either.
This book teaches Chord by building one story, The Relighting, from an empty file to a finished game with sound, a picture, a page of its own, a suite of tests and a release. The story is set in a school of magic that has stood shut for thirty years, on the morning a former student comes back to it. It grows by one idea a chapter, and at the end of every chapter it is a complete story that compiles and plays.
Every example in these pages was compiled, and every line of story output was copied from a real play of the story at the end of its chapter. A companion folder holds the story as it stands at the end of each chapter, with a test that replays the chapter’s commands and checks what the story said.
Where a part of the language could not be shown working, the chapter leaves it out. A manual that describes what a language is supposed to do is easy to write and teaches people things that are not so. This one describes what the language did when it was asked.
This edition is pinned to Chord 4.1.0, as shipped in Sharpee 5.7.0. The language will go on changing, and a later edition will follow it. If your copy of the tools reports a later version, most of this book will still hold, and the release notes will tell you what does not.
Some readers of this book have never written interactive fiction. The main text is written for them, and it assumes nothing but a text editor and patience.
Other readers have written a good deal of it, in Inform or in TADS, and want to know how Chord differs from what they know. There are short boxed notes for them throughout. The next page explains how the two kinds of note are marked, and which you can skip.