gwelks: Nigel Jayne's Interactive Fiction Site

Source Text for Sequitur

Book - phrases and Solitary Rules

Chapter - Deciding

[This is handy for converting snippets into text in reading a command rules.]

To decide which text is the/-- accessible text of the/-- (converted - a snippet):

let t be text;

let t be converted;

decide on converted.

To decide what action name is the action-to-be: (- action_to_be -).

To skip upcoming rulebook break: (- say__PC = say__PC | PARA_NORULEBOOKBREAKS; -).

To really decide on nothing: (- return nothing; -).

To decide which position is the last slot of the sequence:

let holding be the list of positions;

decide on entry (number of positions) in holding.

To decide whether the (snatched - a snippet) is Cochone-related:

if snatched matches "wait/z", yes;

if the accessible text of snatched matches the regular expression "^consult|^listen|^(look up)|^research|^eat\b|^talk\b|tell\b|^ask\b", yes;

if the accessible text of snatched matches the regular expression "(?i)^jenny|^jennifer|^kiss", yes;

no.

[Regular expressions can't be too long, so sometimes they need to be broken up.]

To decide whether (target - a number) slots is/are available starting at (starter - a number):

if target is greater than positions-plus minus starter, decide no;

repeat with counter running from starter to starter plus (target minus one) begin;

if entry counter in position list is not placeholder, decide no;

end repeat;

decide yes.

To decide if the short chain has interrupting placeholders:

let holding be position list;

remove placeholder from holding, if present;

if secondary chain is holding begin;

repeat with counter running from one to the number of entries in secondary chain minus one begin;

if entry counter in secondary chain is properly positioned beside entry (counter plus one) in secondary chain, next;

decide yes;

end repeat;

end if;

no.

To decide if (starter - a thing) and (ender - a thing) are intellectually connected:

now intellectual links is {};

if starter is a full position, now starter is a random track which is in the noun;

if ender is a full position, now ender is a random track which is in the second noun;

if (starter is story-important and ender is story-important) or (starter is not story-important and ender is not story-important) begin;

let trackers be primary chain;

if starter is not story-important, let trackers be secondary chain;

let starter number be position number of starter among trackers;

let ender number be position number of ender among trackers;

if starter number is greater than ender number begin;

let temp be starter number;

now starter number is ender number;

now ender number is temp;

end if;

repeat with selection running through trackers begin;

if position number of selection among trackers is within starter number and ender number begin;

if (intellectual links is {} and selection links an explained track) or (intellectual links is not {} and selection is explained),

add selection to intellectual links;

end if;

end repeat;

let difference be ender number minus starter number;

if the number of entries in intellectual links is (difference plus one), decide yes;

end if;

decide no.

To decide if (first track - a thing) is properly positioned beside (second track - a thing):

if (first track is a positioned story-important track and second track is a positioned story-important track) or (first track is a positioned not story-important track and second track is a positioned not story-important track) begin;

let originator be primary chain;

if first track is not story-important, now originator is secondary chain;

if (position number of first track among originator is position number of second track among originator minus one) and (the number-name of the holder of first track is number-name of holder of second track minus one), decide yes;

end if;

no.

To decide if (candidate - a number) is within (minimum - a number) and (maximum - a number):

if candidate is minimum or candidate is maximum, yes;

if candidate is greater than minimum and candidate is less than maximum, yes;

no.

To decide which list of numbers is the numbered track list for (transformers - a list of things):

let resultants be a list of numbers;

repeat with selection running through transformers begin;

unless selection is placeholder, add number-name of selection to resultants;

end repeat;

decide on resultants.

To decide which number is the position number of (signal - a track) among (noise - list of things):

let assignment be one;

repeat with selection running through noise begin;

if selection is signal,break;

increment assignment;

end repeat;

decide on assignment.

To decide which number is positions-plus:

decide on number of positions plus one.

To decide which list of things is the connected links for (targets - a list of things) starting at (starter - a number):

let reminders be a list of things;

if entry starter in targets links a track begin;

repeat with counter running from starter to the number of entries in targets begin;

let candidate be entry counter in targets;

if counter is not the number of entries in targets and candidate links an explained track begin;

add candidate to reminders;

otherwise;

unless reminders is {} begin;

add candidate to reminders;

break;

end unless;

end if;

end repeat;

end if;

decide on reminders.

To decide which number is the/-- nearest empty slot for the/-- (candidates - a list of things) starting at slot (anchor - a number):

now removal point is zero;

repeat with counter running from one to the number of entries in candidates begin;

let target be anchor plus counter;

if target is less than (number of entries in candidates plus one) and entry target in candidates is placeholder begin;

now removal point is target;

break;

end if;

now target is anchor minus counter;

if target is greater than zero and entry target in candidates is placeholder begin;

now removal point is target;

break;

end if;

end repeat;

decide on removal point.

Chapter - Saying

[We need to keep in mind that these substitutions don't produce line breaks when placed next to a period.] To say i -- beginning say_i -- running on:

(- style underline; -).

To say /i -- ending say_i -- running on:

(- style roman; -).

To say b -- beginning say_b -- running on: (- style bold; -).

To say /b -- ending say_b -- running on: (- style roman; -).

To say fiction title: say "[i][story title][/i]".

To say mdash: say unicode 8212.

To say lb: say line break.

To say pb: say paragraph break.

To say rpo: Say run paragraph on.

To say appropriate name for (item - a thing):

if the label of the item is "", say "[printed name of item]";

otherwise say "[label of item]".

To say relay an empty (target - a thing):

say "[if target is playlist]Your playlist[otherwise][The target][end if] [are] empty.".

To say seq:

unless already speaking is true begin;

say "*** [i]Sequitur[/i] is working ... ";

now already speaking is true;

end unless.

To say end seq:

say "*** [lb]";

now already speaking is false.

To say sequence listing:

now unquoting is true;

if every position is empty, say "The Sequence (slots A to J) is empty. ";

if exactly one track is positioned, say "[random full position]: [number-name of a random positioned track]. [random positioned track] ";

if exactly two tracks are positioned begin;

let holding be the list of full positions;

let target be entry one in holding;

let second target be entry two in holding;

now target is a random track which is in target;

now second target is a random track which is in second target;

say "Slot [holder of target] has Track [number-name of target], [target], and Slot [holder of second target] has Track [number-name of second target], [second target]. The remaining slots are empty. ";

end if;

if the number of full positions is greater than two begin;

repeat with slot running through positions begin;

say "[if slot is E or slot is I][lb][end if][slot]: ";

say "[slotted in (slot)] ";

end repeat;

end if;

now unquoting is true.

To say slotted in (chosen - a position):

let target be placeholder;

if chosen is full, now target is a random track which is in chosen;

say "[if chosen is full][number-name of target]. [target] [otherwise]empty[end if]".

To say track listing:

now unquoting is true;

let holding be a list of objects;

unless examining begin;

repeat with selection running through track list begin;

if selection is unpositioned, add selection to holding;

end repeat;

otherwise;

now holding is track list;

end unless;

let counter be one;

repeat with selection running through holding begin;

say "[if counter is five or counter is 9 or counter is 13][lb][otherwise] [end if][number-name of selection]. [selection] ";

increment counter;

end repeat;

now unquoting is false.

To say play listing:

repeat with selection running through favorites list begin;

say "[number-name of selection]. [appropriate name for (selection)] ";

end repeat.

Interjection needed is initially false.

[We can't use the "if interjection needed is true" state here (i.e., we need to specify this before calling the phrase), because once this phrase is called a line break is produced.]

To say interjection:

say "[one of]'So the guy shows me his ID,' some guy says from outside the office. 'And it was true. His name really was Baba O'Riley.' His partner laughs[or][one of]A couple of cops walk down the hall, chatting[or]A door bangs closed[or]Some men laugh from down the hall[or]A woman answers a phone[or]Phones ring from outside Jenny's office[purely at random][stopping].";

now interjection needed is false.

[Interjections are useful when we aren't sure if a paragraph should continuen on or not, but Inform will insert a paragraph break all the time. The interjection introduces an unrelated action - usually something happening outside the office - justifies this break. The truth state is used to prevent two interjections from being printed consecutively.]

To say correct article for (target - a thing):

say "[if (target replicates a track and one track which replicates target is examined) or target is examined]the[otherwise]a[end if] ".

To say cap-it:

now capitalization is true.

Section - Action Phrases

To build a/-- list for (starter - a number) to (ender - a number) from (target - a list of things):

let temp be zero;

if starter is greater than ender begin;

now temp is starter;

now starter is ender;

now ender is temp;

end if;

repeat with counter running from starter to ender begin;

unless entry counter in target is placeholder, add entry counter in target to temporary playlist;

end repeat;

unless temp is zero, reverse temporary playlist.

To fill (starter - a number) to (ender - a number) with blanks:

repeat with counter running from starter to ender begin;

now entry counter in position list is placeholder;

end repeat.

To recount (target - a list of objects):

now unquoting is true;

say seq;

repeat with selection running through target begin;

say "[number-name of selection]: [appropriate name for selection] ";

end repeat;

say "[pb][end seq] [lb]";

now unquoting is false.

To switch (first item - a thing) for (second item - a thing):

let temp be the first item;

now the noun is the second item;

now the second noun is temp.

[We can't use the "the list of ... " phrase, because we want to place the comma inside the quotation marks when printing the name of the track.]

To watch for (tracker - a list of things):

let counter be one;

let ander be the number of entries in tracker minus one;

repeat with selection running through tracker begin;

say " '[appropriate name for (selection)][unless counter is the number of entries in tracker],'[end unless]";

if counter is ander, say " and";

increment counter;

end repeat;

say ".'[roman type] [lb]".

Section - Image Centering Replacement

Table of User Styles (continued)

style nameJustification
special-style-1center-justified

To display (chosen figure - a figure-name) centered:

say "[first custom style]";

say " ";

display chosen figure inline;

say " [lb]";

say "[roman type]";

To display (chosen figure - a figure-name) inline:

(- DrawInline({chosen figure}); -)

Include (-

[ DrawInline N;

glk_image_draw(gg_mainwin, ResourceIDsOfFigures-->N, imagealign_InlineUp, 0);

];

-)

Chapter - Solitary Rules

This is the play the music rule:

repeat with selection running through temporary playlist begin;

let target be selection;

if selection is a position, now target is a random track which is in selection;

try examining target;

unless the number of entries in temporary playlist is one or entry (number of entries in temporary playlist) in temporary playlist is selection begin;

say "Press a key to continue.";

wait for any key;

end unless;

end repeat;

now temporary playlist is {}.

This is the put tracks in positions rule:

truncate position list to ten entries; [This is a safety net; hopefully it will never happen.]

if the number of entries in position list is less than ten begin; [This is a safety net; hopefully it will never happen.]

let target be the number of entries in position list plus one;

extend position list to ten entries;

fill target to ten with blanks;

end if;

let placement be the list of positions;

repeat with selection running through position list begin;

unless selection is placeholder, now entry one in placement contains the selection;

remove entry one from placement;

end repeat;

repeat with selection running through positioned tracks begin;

unless selection is listed in position list, move selection to location;

end repeat.

This is the crediting rule:

say "[fiction title] is a product of Tin Foil Jenny Technology. Nigel Jayne supervised the production team, and Jennifer Lincks developed the software, with help from Inform 7 extensions written by Eric Eve, Stephen Granade, Massimo Stella, Erik Temple, and Emily Short. Chris Elkjar designed and created the cover art. The song 'The Heckler' is by While Whales Sleep ([fixed letter spacing]http://whilewhalessleep.bandcamp.com/releases[variable letter spacing]) and used with permission. Sound effects were by soundbytez and downloaded from Freesound.org ([fixed letter spacing]http://www.freesound.org/people/soundbytez/[variable letter spacing]). Stephen Cochone, Gráinne Ryan, Caelyn Sandel, Sean M. Shore, Lucian Smith, and Carolyn VanEseltine conducted beta testing. Tin Foil Jenny thanks everyone for their critiques and suggestions. Your comments and transcripts are welcome, too. Send them to Nigel, nigelsjayne@gmail.com. The latest versions of all of Nigel's interactive fiction, along with source codes, are available at [fixed letter spacing]http://www.nigeljayne.ca[variable letter spacing][unless the story has ended finally]. For more about Nigel Jayne, type AUTHOR[end unless]. The program was implemented using Inform 7 ([fixed letter spacing]http://inform7.com/[variable letter spacing]), created by Graham Nelson with help from Emily Short and many others[if the story has ended finally]. [pb][description of about author] [pb][otherwise]. [end if] [pb][fiction title] was entered in the 2014 ShuffleComp, a competition for interactive fiction in which entrants were given a list of eight songs and asked to create a game inspired by at least one of them. It begins with Tin Foil Jenny, who was the pseudonymous author of the original game, offering the protagonist an opportunity to choose a song from the eight I received in my playlist.".