Chord Version 1
Sign in
Subscribe
Over the last two weeks I have aligned Sharpee with a new parser-IF modeling language called Chord. This effort was not to adhere to one side or the other. It was a true alignment where both sides were required to maintain their "way", be elegant, and in their own way provide a path for an author to create parser-based IF that publishes to a browser. There were changes across the Sharpee packages to enable this alignment and Chord matured into what I consider a highly readable and usable interactive fiction modeling language.<br>Chord is a declarative pseudo-code styled language. It compiles to IR (intermediate representation) and can be deployed to a framework-less web application the same as a standard Sharpee story. It has the same features as the Sharpee Typescript API and a few additional wrinkles.<br>The details for Chord are on the Sharpee website. I posted the work-in-progress syntax last week and today it's a complete and working new IF language.<br>The GenAI created sample story is listed at the end and that hits all of the Sharpee capabilities. I use the Typescript version for regression testing changes to Sharpee and now this version will also be used to regression test Chord.<br>Full documentation for Chord is on the website and in the GitHub repository on main.<br>I call it a modeling language because it is not a programming language. It does not have if-then-else blocks or boolean flags. It asks the author to find the correct domain meaning and implement its parts accordingly.<br>As in Sharpee, Chord also adheres to the post-turn text emission process in Channel-IO. Every piece of text is within a definition or defined as a phrase. Phrases can be listed in named phrasebooks with predicates to differentiate when they apply to the world. A Chord story can be one .story file or a .story file with .chord imports (though a .chord cannot also import other .chord files).<br>An author can replace the index.html template and add their own components to be filled with additional custom channel data. The template still has to follow a contract for its named styles and required components like the command line.<br>The website also has a sandbox/playground where you can try Chord live. I encourage you to give it a try.<br>##<br>## The Folly at Fernhill — one winter night to find the deed.<br>##
story "The Folly at Fernhill" by "The Sharpee Project"<br>id: fernhill<br>version: 0.1.0<br>blurb: One winter night to find the deed that keeps Fernhill in the<br>family.<br>states: evening, midnight<br>use state-machines
on every turn while one chance in 12<br>phrase distant-bell<br>end on
## The estate exterior — the night begins here.
create the Grounds<br>a region<br>containing the Iron Gates, the Gravel Drive, the Fountain Court<br>containing the Greenhouse, the Boiler Shed, Folly Hill
on every turn while one chance in 6<br>phrase night-wind<br>end on
after entering it<br>phrase cold-returns<br>play ambient night-wind when client has sound<br>end after
after leaving it<br>stop ambient when client has sound<br>phrase out-of-the-wind<br>end after
create the House<br>a region<br>containing the Entrance Hall, the Study, the Pantry<br>containing the Kitchen, the Cellar Stairs and the Cellar
after entering it<br>phrase house-hush<br>end after
create the Iron Gates<br>a room<br>aka gates, gate<br>north to the Gravel Drive<br>south is blocked: long-road
after entering it while the player has the deed<br>play music dawn-theme when client has music<br>win fernhill-saved<br>end after
first time<br>The cab is already grinding away down the lane, its lamps swallowed<br>by the dark. An auction notice is nailed to the left-hand gate,<br>ruffling in the wind: FERNHILL HOUSE AND GROUNDS, BY ORDER OF THE<br>ESTATE, AT DAWN.
Wrought-iron gates stand open on one hinge apiece, rust freckling<br>the scrollwork. The gravel drive runs north toward the dark shape of<br>the house.
create the Gravel Drive<br>a room<br>aka drive<br>south to the Iron Gates<br>north to the Fountain Court
The drive curves between bare lime trees, gravel crunching underfoot.<br>The house looms ahead to the north; the gates are back south.
create the Fountain Court<br>a room<br>aka court, courtyard<br>south to the Gravel Drive<br>north to the Entrance Hall<br>west to the Greenhouse<br>east to the Boiler Shed
A paved court before the front door, holding a dry fountain crusted<br>with last summer's leaves. The greenhouse glimmers palely to the<br>west; a squat brick shed hunches to the east; the front door of the<br>house is north.
create the Greenhouse<br>a room<br>aka glasshouse<br>east to the Fountain Court<br>north to Folly Hill<br>north is blocked while the boiler is off: frost-sealed
Glass panes furred with frost on both sides. Staging benches run the<br>length of the house, and a door in the north wall — glass too — leads<br>up toward the folly, if it would open.
create the Boiler Shed<br>a room<br>aka shed<br>west to the Fountain Court
Brick, low, and bitter with old coal dust. The estate's boiler sits<br>cold as a tomb against the back wall, its pipes running off through<br>the earth toward the...