Sylladex — 4 of 5

Daniel Stelzer

Release 1

Section 3 - Sylladex

Table of Sylladex Entries

hashitem
0nothing
1nothing
2nothing
3nothing
4nothing
5nothing
6nothing
7nothing
8nothing
9nothing

To decide which number is the hash of (T - text):

let H be zero;

let T be T in lower case;

repeat with N running from 1 to the number of characters in T:

let C be character number N in T;

if C is non-alphabetic:

say "[green letters][C]";

next;

otherwise if C is a vowel:

say "[red letters][C in upper case]";

increase H by 1;

otherwise:

say "[blue letters][C in upper case]";

increase H by 2;

let H be the remainder after dividing H by 10;

say "[default letters] ([H])[line break]";

decide on H.

To decide whether (C - text) is non-alphabetic:

decide on whether or not C matches the regular expression "<\s\p>".

To decide whether (C - text) is a vowel:

decide on whether or not C matches the regular expression "<aeiouy>".

Rule for supplying a missing noun:

let H be the hash of the player's command;

let N be the item corresponding to a hash of H in the Table of Sylladex Entries;

if N is nothing:

say "Error: nothing in slot [H]!";

stop the action;

say "Slot [H] - [the N]";

now the noun is N.

Rule for supplying a missing second noun:

let H be the hash of the player's command;

let N be the item corresponding to a hash of H in the Table of Sylladex Entries;

if N is nothing:

say "Error: nothing in slot [H]!";

stop the action;

now the second noun is N.

First carry out taking inventory:

repeat through the Table of Sylladex Entries:

say "[hash entry]: [the item entry][line break]";

rule succeeds.

Before taking something carried: silently try dropping the noun.

After taking something:

let H be the hash of the player's command;

choose the row with hash of H in the Table of Sylladex Entries;

let N be the item entry;

now the item entry is the noun;

if N is not nothing:

say "[The N] [are] violently expelled from your sylladex as [the noun] [go] into slot [H].";

silently try dropping N;

otherwise:

say "[The noun] [go] into slot [H]."