1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-05-04 01:59:41 +03:00

Documented IE-0026 in a new chapter on Advanced Notation

This commit is contained in:
Graham Nelson 2024-04-09 16:36:47 +01:00
parent 8df93ad484
commit da863513d0
17 changed files with 1263 additions and 236 deletions

View file

@ -139,139 +139,139 @@ ph_degrees ph_sine ph_cosine ph_tangent ph_arcsine ph_arccosine ph_arctangent ph
PM_NegationForbidden PM_NegationInternal PM_LPEnumeration PM_LPBuiltInKOV PM_LPNotKOV _ WI_15_9 "15.9" "15.9. Units"
PM_DuplicateUnitSpec _ WI_15_10 "15.10" "15.10. Multiple notations"
PM_LPTooLittleAccuracy PM_LPCantScaleTwice PM_LPCantScaleYet _ WI_15_11 "15.11" "15.11. Scaling and equivalents"
PM_LPNotAllNamed PM_LPTooComplicated PM_LPTooManyElements PM_LPElementTooLarge PM_LPWithoutElement _ WI_15_15 "15.15" "15.15. Notations including more than one number"
PM_BadLPNameOption PM_BadLPPartOption PM_LPMultipleOptional PM_LPFirstOptional _ WI_15_16 "15.16" "15.16. The parts of a number specification"
PM_TotalTableColumn PM_TotalEitherOr ph_total _ WI_15_18 "15.18" "15.18. Totals"
PM_EquationSymbolWrongKOV PM_EquationSymbolMissing PM_EquationInsoluble PM_EquationBadTarget PM_EquationBadArithmetic PM_EquationDimensionPower PM_EquationIncomparable PM_EquationEquatesMultiply PM_EquationEquatesBadly PM_EquationDoesntEquate PM_EquationMispunctuated PM_EquationTooComplex PM_EquationOperatorUnrecognised PM_EquationLeadingZero PM_EquationTokenUnrecognised PM_EquationSymbolSpurious PM_EquationSymbolBadSub PM_EquationSymbolNonNumeric PM_EquationSymbolEqualsKOV PM_EquationSymbolNonValue PM_EquationSymbolVague PM_EquationSymbolMalformed PM_EquationSymbolMisdeclared PM_EquationMisnamed PM_EquationMisnumbered EQUATIONS ph_letequation _ WI_15_19 "15.19" "15.19. Equations"
ARITHMETIC PM_BadArithmetic PM_MultiplyingNonKOVs PM_BadLPOffset PM_BadLPEquivalent PM_DimensionsInconsistent PM_UnitSequenceOverflow PM_NonDimensional PM_DimensionNotBaseKOV PM_DimensionRedundant _ WI_15_21 "15.21" "15.21. Multiplication of units"
PM_TableRowFull PM_TableColumnBrackets PM_TableKindlessColumn PM_TableEntryGeneric PM_TableWithBlankNames PM_TableDefiningObject PM_TableOfExistingKind PM_TableOfBuiltInKind PM_TableOfQuantifiedKind PM_TableUndefined PM_TableWithoutRows PM_TableColumnAlready PM_TableColumnArticle PM_TableTooManyColumns PM_TableNameAmbiguous PM_TableNameDuplicate PM_TableMisnamed PM_TableIncompatibleEntry PM_TableUnknownEntry PM_TableDescriptionEntry PM_TableVariableEntry PM_TablePlayerEntry PM_TableColumnEmptyLists PM_TableCoincidesWithKind TABLES _ WI_16_1 "16.1" "16.1. Laying out tables"
ph_numrows _ WI_16_2 "16.2" "16.2. Looking up entries"
ph_showmetable phs_currenttablerow phs_tablerow phs_tablecolumn _ WI_16_4 "16.4" "16.4. Changing entries"
PM_NoRowSelected ph_chooserow ph_chooserowwith ph_chooserandomrow _ WI_16_5 "16.5" "16.5. Choosing rows"
ph_repeattable ph_repeattablereverse ph_repeattablecol ph_repeattablecolreverse _ WI_16_6 "16.6" "16.6. Repeating through tables"
ph_thereis ph_thereisno _ WI_16_7 "16.7" "16.7. Blank entries"
ph_chooseblankrow ph_numblank ph_numfilled ph_blankout ph_blankoutrow ph_blankoutcol ph_blankouttable _ WI_16_10 "16.10" "16.10. Adding and removing rows"
ph_sortrandom ph_sortcolumn ph_sortcolumnreverse ph_sorttablephrase _ WI_16_11 "16.11" "16.11. Sorting"
kind_tablename _ WI_16_15 "16.15" "16.15. Varying which table to look at"
PM_TableDefiningTheImpossible PM_TableDefiningNothing _ WI_16_16 "16.16" "16.16. Defining things with tables"
PM_TableNotContinuation _ WI_16_18 "16.18" "16.18. Table continuations"
PM_TableAmendmentMismatch PM_TableAmendmentMisfit _ WI_16_19 "16.19" "16.19. Table amendments"
UNDERSTANDING someone_token PM_TextTokenRestricted PM_OverComplexToken PM_BizarreToken PM_UnknownToken PM_UnparsableKind PM_UseThingNotObject PM_UseTextNotTopic PM_ObsoleteHeldTokens PM_UnderstandAsCompoundText PM_UnderstandCommaCommand PM_UnderstandEmptyText PM_LiteralPunctuation PM_UnderstandVague PM_UnderstandAsBadValue PM_UnderstandAsActivity PM_TextlessMistake PM_UnderstandMismatch PM_NontextualUnderstand PM_NotOldCommand PM_NotNewCommand PM_UnderstandCommandWhen PM_OldVerbUsage _ WI_17_1 "17.1" "17.1. Understand"
PM_GrammarIllFounded PM_TooManyGrammarLines PM_TooManyAliases PM_ThreeValuedLine _ WI_17_2 "17.2" "17.2. New commands for old grammar"
TOKENS things_token _ WI_17_4 "17.4" "17.4. Standard tokens of grammar"
text_token _ WI_17_6 "17.6" "17.6. The text token"
var_understood _ WI_17_10 "17.10" "17.10. Understanding kinds of value"
PM_UnderstandPluralValue PM_UnderstandAsQualified _ WI_17_12 "17.12" "17.12. Understanding values"
PM_SlashedCommand PM_OverAmbitiousSlash _ WI_17_13 "17.13" "17.13. This/that"
NEWTOKENS PM_TwoValuedToken PM_MixedOutcome _ WI_17_14 "17.14" "17.14. New tokens"
PM_UnknownUnpermittedProperty PM_BadReferringProperty PM_BadUnderstandPropertyAs PM_BadUnderstandProperty PM_UnknownUnderstandProperty _ WI_17_16 "17.16" "17.16. Understanding things by their properties"
PM_GrammarValueRelation PM_GrammarBadRelation PM_GrammarObjectlessRelation _ WI_17_17 "17.17" "17.17. Understanding things by their relations"
PM_BadWhen _ WI_17_18 "17.18" "17.18. Context: understanding when"
ph_setpronouns _ WI_17_19 "17.19" "17.19. Changing the meaning of pronouns"
rules_dtpm _ WI_17_20 "17.20" "17.20. Does the player mean..."
ph_multipleobjectlist ph_altermultipleobjectlist _ WI_17_21 "17.21" "17.21. Multiple action processing"
PM_BadActivityName kind_activity ACTIVITIES _ WI_18_1 "18.1" "18.1. What are activities?"
PM_BadWhenWhile _ WI_18_4 "18.4" "18.4. While clauses"
EXTACTIVITIES ph_carryout ph_carryoutwith ph_continueactivity _ WI_18_5 "18.5" "18.5. New activities"
PM_ActivityVarValue PM_ActivityVarUnknownKOV PM_ActivityVarOverspecific PM_ActivityVarAnd PM_ActivityVariableNameless _ WI_18_6 "18.6" "18.6. Activity variables"
ph_beginactivity ph_beginactivitywith ph_endactivity ph_endactivitywith ph_handlingactivity ph_handlingactivitywith ph_abandonactivity ph_abandonactivitywith _ WI_18_7 "18.7" "18.7. Beginning and ending activities manually"
var_particular act_con _ WI_18_9 "18.9" "18.9. Deciding the concealed possessions of something"
act_pn ph_omit _ WI_18_10 "18.10" "18.10. Printing the name of something"
act_ppn _ WI_18_11 "18.11" "18.11. Printing the plural name of something"
act_pan _ WI_18_12 "18.12" "18.12. Printing a number of something"
act_lc ph_group ph_groupart ph_grouptext _ WI_18_13 "18.13" "18.13. Listing contents of something"
act_gt _ WI_18_14 "18.14" "18.14. Grouping together something"
act_resp _ WI_18_15 "18.15" "18.15. Issuing the response text of something"
act_details _ WI_18_16 "18.16" "18.16. Printing room description details of something"
act_idetails _ WI_18_17 "18.17" "18.17. Printing inventory details of something"
act_toodark _ WI_18_18 "18.18" "18.18. Printing a refusal to act in the dark"
act_nowdark _ WI_18_19 "18.19" "18.19. Printing the announcement of darkness"
act_nowlight _ WI_18_20 "18.20" "18.20. Printing the announcement of light"
act_darkname _ WI_18_21 "18.21" "18.21. Printing the name of a dark room"
act_darkdesc _ WI_18_22 "18.22" "18.22. Printing the description of a dark room"
act_csl _ WI_18_23 "18.23" "18.23. Constructing the status line"
act_wpa _ WI_18_24 "18.24" "18.24. Writing a paragraph about"
act_lni _ WI_18_25 "18.25" "18.25. Listing nondescript items of something"
act_pld _ WI_18_26 "18.26" "18.26. Printing the locale description of something"
act_cnlo _ WI_18_27 "18.27" "18.27. Choosing notable locale objects for something"
act_plp _ WI_18_28 "18.28" "18.28. Printing a locale paragraph about"
act_ds ph_placeinscope ph_placecontentsinscope _ WI_18_29 "18.29" "18.29. Deciding the scope of something"
act_clarify _ WI_18_30 "18.30" "18.30. Clarifying the parser's choice of something"
act_which _ WI_18_31 "18.31" "18.31. Asking which do you mean"
act_smn _ WI_18_32 "18.32" "18.32. Supplying a missing noun/second noun"
kind_snippet var_command act_reading ph_snippetmatches ph_snippetdoesnotmatch ph_snippetincludes ph_snippetdoesnotinclude ph_rejectcommand ph_replacesnippet ph_cutsnippet ph_changecommand _ WI_18_33 "18.33" "18.33. Reading a command"
act_implicitly _ WI_18_34 "18.34" "18.34. Implicitly taking something"
act_parsererror _ WI_18_35 "18.35" "18.35. Printing a parser error"
act_all _ WI_18_36 "18.36" "18.36. Deciding whether all includes"
act_banner phs_banner _ WI_18_37 "18.37" "18.37. Printing the banner text"
act_obit _ WI_18_38 "18.38" "18.38. Printing the player's obituary"
act_amuse _ WI_18_39 "18.39" "18.39. Amusing a victorious player"
act_startvm _ WI_18_40 "18.40" "18.40. Starting the virtual machine"
PM_RulebookWithTo PM_RulebookWithDefinition PM_RulebookWithAt RULEBOOKS kind_rulebook kind_rule _ WI_19_1 "19.1" "19.1. On rules"
PM_RuleWithoutColon PM_RuleWithDefiniteArticle PM_BadRulePreamble PM_BadRulePreambleWhen _ WI_19_3 "19.3" "19.3. New rules"
PM_PlaceWithMissingRule PM_NoSuchRuleExists PM_UnspecifiedRulebookPlacement PM_BadRulePlacementNegation PM_ImproperRulePlacement RLISTING _ WI_19_4 "19.4" "19.4. Listing rules explicitly"
rules_proc _ WI_19_5 "19.5" "19.5. Changing the behaviour of rules"
NEWRULEBOOKS ph_follow _ WI_19_8 "19.8" "19.8. New rulebooks"
ph_followfor _ WI_19_9 "19.9" "19.9. Basis of a rulebook"
PM_RulebookVariableVague PM_RulebookVariableBadKind PM_RulebookVariableTooSpecific PM_RulebookVariableAnd _ WI_19_10 "19.10" "19.10. Rulebook variables"
PM_BadDefaultOutcome PM_DefaultOutcomeTwice ph_succeeds ph_fails ph_nodecision ph_succeeded ph_failed _ WI_19_11 "19.11" "19.11. Success and failure"
PM_NonOutcomeProperty PM_DuplicateOutcome PM_DefaultOutcomeAlready PM_DefaultNamedOutcomeTwice PM_BadOutcomeClarification PM_WrongEndToPhrase PM_MisplacedRulebookOutcome ph_rulebookoutcome _ WI_19_12 "19.12" "19.12. Named outcomes"
ph_succeedswith ph_producedby ph_producedbyfor _ WI_19_13 "19.13" "19.13. Rulebooks producing values"
ph_abide ph_abidefor ph_abideanon _ WI_19_14 "19.14" "19.14. Abide by"
rules_internal _ WI_19_15 "19.15" "19.15. The internal rulebooks which keep stories running"
ph_charnum ph_numchars ph_wordnum ph_numwords ph_pwordnum ph_numpwords ph_upwordnum ph_numupwords ph_linenum ph_numlines ph_paranum ph_numparas _ WI_20_2 "20.2" "20.2. Characters, words, punctuated words, unpunctuated words, lines, paragraphs"
ph_inlower ph_inupper ph_lowercase ph_uppercase ph_titlecase ph_sentencecase _ WI_20_3 "20.3" "20.3. Upper and lower case letters"
ph_matches ph_exactlymatches ph_textfirstindex ph_textlastindex ph_textlength ph_nummatches _ WI_20_4 "20.4" "20.4. Matching and exactly matching"
ph_matchesre ph_exactlymatchesre ph_nummatchesre ph_matchtext ph_subexpressiontext ph_refirstindex ph_relastindex ph_relength _ WI_20_5 "20.5" "20.5. Regular expression matching"
ph_subform _ WI_20_6 "20.6" "20.6. Making new text with text substitutions"
ph_replacechar ph_replaceword ph_replacepword ph_replaceupword ph_replaceline ph_replacepara ph_replace ph_replacewordin ph_replacepwordin ph_replacere _ WI_20_7 "20.7" "20.7. Replacements"
kind_listof _ WI_21_1 "21.1" "21.1. Lists and entries"
PM_IncompatibleConstantListEntry PM_NonconstantConstantListEntry PM_BadConstantListEntry PM_CantLetEmptyList _ WI_21_2 "21.2" "21.2. Constant lists"
phs_listbraced phs_listdef phs_listindef _ WI_21_3 "21.3" "21.3. Saying lists of values"
ph_islistedin ph_isnotlistedin ph_repeatlist _ WI_21_4 "21.4" "21.4. Testing and iterating over lists"
ph_addtolist ph_addlisttolist ph_addatentry ph_addlistatentry ph_remfromlist ph_remlistfromlist ph_rementry ph_rementries _ WI_21_5 "21.5" "21.5. Building lists"
ph_listofdesc _ WI_21_6 "21.6" "21.6. Lists of objects"
ph_reverselist ph_sortlist ph_sortlistreverse ph_sortlistphrase ph_sortlistrandom ph_sortlistproperty ph_sortlistpropertyreverse ph_rotatelist ph_rotatelistback _ WI_21_8 "21.8" "21.8. Sorting, reversing and rotating lists"
ph_numberentries _ WI_21_9 "21.9" "21.9. Accessing entries in a list"
ph_changelength ph_truncate ph_truncatefirst ph_truncatelast ph_extend _ WI_21_10 "21.10" "21.10. Lengthening or shortening a list"
kind_description ph_valuematch _ WI_22_2 "22.2" "22.2. Descriptions as values"
ph_applied0 ph_applied1 ph_applied2 ph_applied3 ph_apply0 ph_apply1 ph_apply2 ph_apply3 _ WI_22_3 "22.3" "22.3. Phrases as values"
ph_appliedlist ph_filter ph_reduction _ WI_22_5 "22.5" "22.5. Map, filter and reduce"
PM_UnknownVirtualMachine _ WI_23_3 "23.3" "23.3. Virtual machines and story file formats"
FIGURES kind_figurename _ WI_23_4 "23.4" "23.4. Gathering the figures"
PM_PictureNotTextual PM_PictureDuplicate _ WI_23_5 "23.5" "23.5. Declaring and previewing the figures"
ph_displayfigure _ WI_23_6 "23.6" "23.6. Displaying the figures"
SOUNDS kind_soundname _ WI_23_7 "23.7" "23.7. Recorded sounds"
PM_SoundNotTextual PM_SoundDuplicate ph_playsf _ WI_23_8 "23.8" "23.8. Declaring and playing back sounds"
ph_figureid ph_soundid _ WI_23_10 "23.10" "23.10. Some technicalities about figures and sounds"
EFILES _ WI_23_11 "23.11" "23.11. Files"
PM_FilenameUnsafe PM_FilenameNotTextual PM_FilenameDuplicate PM_BadFileOwner PM_BadFileIFID kind_externalfile _ WI_23_12 "23.12" "23.12. Declaring files"
ph_writetable ph_readtable ph_fileexists _ WI_23_13 "23.13" "23.13. Writing and reading tables to external files"
ph_writetext ph_appendtext ph_saytext _ WI_23_14 "23.14" "23.14. Writing, reading and appending text to files"
ph_fileready ph_markfileready ph_markfilenotready _ WI_23_15 "23.15" "23.15. Exchanging files with other programs"
PM_BadEpisode _ WI_25_2 "25.2" "25.2. Bibliographic data"
LCARDS _ WI_25_4 "25.4" "25.4. The Library Card"
IFIDS _ WI_25_5 "25.5" "25.5. The Treaty of Babel and the IFID"
release_files PM_NoSuchPublicRelease _ WI_25_6 "25.6" "25.6. The Release button and the Materials folder"
PM_ReleaseAlong _ WI_25_7 "25.7" "25.7. The Joy of Feelies"
release_cover _ WI_25_8 "25.8" "25.8. Cover art"
release_postcard release_booklet _ WI_25_9 "25.9" "25.9. An introductory booklet and postcard"
release_website _ WI_25_10 "25.10" "25.10. A website"
release_interpreter _ WI_25_11 "25.11" "25.11. A playable web page"
PM_RoomInIgnoredSource _ WI_25_15 "25.15" "25.15. Republishing existing works of IF"
release_solution _ WI_25_16 "25.16" "25.16. Walkthrough solutions"
release_card release_source _ WI_25_17 "25.17" "25.17. Releasing the source text"
PM_MapPlacementDirection PM_MapPlacement PM_MapDirectionClue PM_MapHintUnknown PM_MapSettingTypeFailed PM_MapSettingTooLong PM_MapSettingUnknown PM_MapSettingOfUnknown PM_MapBadRubric PM_MapUnknownOffsetBase PM_MapUnknownOffset PM_MapUnknownColour PM_MapNonLateral PM_MapToNonRoom PM_MapFromNonRoom MAPHINTS _ WI_25_18 "25.18" "25.18. Improving the index map"
EPSMAP _ WI_25_19 "25.19" "25.19. Producing an EPS format map"
EXTENSIONS _ WI_27_1 "27.1" "27.1. The status of extensions"
SRULES _ WI_27_2 "27.2" "27.2. The Standard Rules"
PM_ExtNoEndsHere PM_ExtNoBeginsHere PM_ExtMultipleEndsHere PM_ExtBeginsAfterEndsHere PM_ExtMultipleBeginsHere _ WI_27_5 "27.5" "27.5. A simple example extension"
PM_ExtVersionTooLow phs_extcredits phs_compextcredits _ WI_27_6 "27.6" "27.6. Version numbering"
PM_UnequalHeadingInPlaceOf PM_HeadingInPlaceOfUnknown PM_HeadingInPlaceOfUnincluded _ WI_27_9 "27.9" "27.9. Extensions can interact with other extensions"
PM_ImplicationValueProperty PM_ImplicationCertain _ WI_27_13 "27.13" "27.13. Implications"
PM_BadInlineTag PM_BadInlineExpansion PM_InlineRule PM_InlineTooLong PM_UnendingI6 _ WI_27_15 "27.15" "27.15. Defining phrases in Inform 6"
PM_BadObjectTranslation _ WI_27_21 "27.21" "27.21. Inform 6 objects and classes"
PM_QuantityTranslatedAlready PM_NonQuantityTranslated PM_NonPropertyTranslated PM_TranslatedToNonIdentifier PM_TranslatedUnknownCategory PM_TranslatedTwice PM_TranslatesActionAlready PM_TranslatesNonAction _ WI_27_22 "27.22" "27.22. Inform 6 variables, properties, actions, and attributes"
PM_GrammarTranslatedAlready _ WI_27_23 "27.23" "27.23. Inform 6 Understand tokens"
PM_IncludeInsteadOf PM_WhenDefiningUnknown PM_BeforeTheLibrary PM_BadI6Inclusion _ WI_27_25 "27.25" "27.25. Overriding definitions in kits"
PM_LabelNamespaceTooLong _ WI_27_28 "27.28" "27.28. Invocation labels, counters and storage"
PM_TotalTableColumn PM_TotalEitherOr ph_total _ WI_15_15 "15.15" "15.15. Totals"
PM_EquationSymbolWrongKOV PM_EquationSymbolMissing PM_EquationInsoluble PM_EquationBadTarget PM_EquationBadArithmetic PM_EquationDimensionPower PM_EquationIncomparable PM_EquationEquatesMultiply PM_EquationEquatesBadly PM_EquationDoesntEquate PM_EquationMispunctuated PM_EquationTooComplex PM_EquationOperatorUnrecognised PM_EquationLeadingZero PM_EquationTokenUnrecognised PM_EquationSymbolSpurious PM_EquationSymbolBadSub PM_EquationSymbolNonNumeric PM_EquationSymbolEqualsKOV PM_EquationSymbolNonValue PM_EquationSymbolVague PM_EquationSymbolMalformed PM_EquationSymbolMisdeclared PM_EquationMisnamed PM_EquationMisnumbered EQUATIONS ph_letequation _ WI_15_16 "15.16" "15.16. Equations"
ARITHMETIC PM_BadArithmetic PM_MultiplyingNonKOVs PM_BadLPOffset PM_BadLPEquivalent PM_DimensionsInconsistent PM_UnitSequenceOverflow PM_NonDimensional PM_DimensionNotBaseKOV PM_DimensionRedundant _ WI_15_18 "15.18" "15.18. Multiplication of units"
PM_LPNotAllNamed PM_LPTooComplicated PM_LPTooManyElements PM_LPElementTooLarge PM_LPWithoutElement _ WI_16_1 "16.1" "16.1. Notations with multiple parts"
PM_BadLPNameOption PM_BadLPPartOption PM_LPMultipleOptional PM_LPFirstOptional _ WI_16_2 "16.2" "16.2. The parts of a notation"
PM_TableRowFull PM_TableColumnBrackets PM_TableKindlessColumn PM_TableEntryGeneric PM_TableWithBlankNames PM_TableDefiningObject PM_TableOfExistingKind PM_TableOfBuiltInKind PM_TableOfQuantifiedKind PM_TableUndefined PM_TableWithoutRows PM_TableColumnAlready PM_TableColumnArticle PM_TableTooManyColumns PM_TableNameAmbiguous PM_TableNameDuplicate PM_TableMisnamed PM_TableIncompatibleEntry PM_TableUnknownEntry PM_TableDescriptionEntry PM_TableVariableEntry PM_TablePlayerEntry PM_TableColumnEmptyLists PM_TableCoincidesWithKind TABLES _ WI_17_1 "17.1" "17.1. Laying out tables"
ph_numrows _ WI_17_2 "17.2" "17.2. Looking up entries"
ph_showmetable phs_currenttablerow phs_tablerow phs_tablecolumn _ WI_17_4 "17.4" "17.4. Changing entries"
PM_NoRowSelected ph_chooserow ph_chooserowwith ph_chooserandomrow _ WI_17_5 "17.5" "17.5. Choosing rows"
ph_repeattable ph_repeattablereverse ph_repeattablecol ph_repeattablecolreverse _ WI_17_6 "17.6" "17.6. Repeating through tables"
ph_thereis ph_thereisno _ WI_17_7 "17.7" "17.7. Blank entries"
ph_chooseblankrow ph_numblank ph_numfilled ph_blankout ph_blankoutrow ph_blankoutcol ph_blankouttable _ WI_17_10 "17.10" "17.10. Adding and removing rows"
ph_sortrandom ph_sortcolumn ph_sortcolumnreverse ph_sorttablephrase _ WI_17_11 "17.11" "17.11. Sorting"
kind_tablename _ WI_17_15 "17.15" "17.15. Varying which table to look at"
PM_TableDefiningTheImpossible PM_TableDefiningNothing _ WI_17_16 "17.16" "17.16. Defining things with tables"
PM_TableNotContinuation _ WI_17_18 "17.18" "17.18. Table continuations"
PM_TableAmendmentMismatch PM_TableAmendmentMisfit _ WI_17_19 "17.19" "17.19. Table amendments"
UNDERSTANDING someone_token PM_TextTokenRestricted PM_OverComplexToken PM_BizarreToken PM_UnknownToken PM_UnparsableKind PM_UseThingNotObject PM_UseTextNotTopic PM_ObsoleteHeldTokens PM_UnderstandAsCompoundText PM_UnderstandCommaCommand PM_UnderstandEmptyText PM_LiteralPunctuation PM_UnderstandVague PM_UnderstandAsBadValue PM_UnderstandAsActivity PM_TextlessMistake PM_UnderstandMismatch PM_NontextualUnderstand PM_NotOldCommand PM_NotNewCommand PM_UnderstandCommandWhen PM_OldVerbUsage _ WI_18_1 "18.1" "18.1. Understand"
PM_GrammarIllFounded PM_TooManyGrammarLines PM_TooManyAliases PM_ThreeValuedLine _ WI_18_2 "18.2" "18.2. New commands for old grammar"
TOKENS things_token _ WI_18_4 "18.4" "18.4. Standard tokens of grammar"
text_token _ WI_18_6 "18.6" "18.6. The text token"
var_understood _ WI_18_10 "18.10" "18.10. Understanding kinds of value"
PM_UnderstandPluralValue PM_UnderstandAsQualified _ WI_18_12 "18.12" "18.12. Understanding values"
PM_SlashedCommand PM_OverAmbitiousSlash _ WI_18_13 "18.13" "18.13. This/that"
NEWTOKENS PM_TwoValuedToken PM_MixedOutcome _ WI_18_14 "18.14" "18.14. New tokens"
PM_UnknownUnpermittedProperty PM_BadReferringProperty PM_BadUnderstandPropertyAs PM_BadUnderstandProperty PM_UnknownUnderstandProperty _ WI_18_16 "18.16" "18.16. Understanding things by their properties"
PM_GrammarValueRelation PM_GrammarBadRelation PM_GrammarObjectlessRelation _ WI_18_17 "18.17" "18.17. Understanding things by their relations"
PM_BadWhen _ WI_18_18 "18.18" "18.18. Context: understanding when"
ph_setpronouns _ WI_18_19 "18.19" "18.19. Changing the meaning of pronouns"
rules_dtpm _ WI_18_20 "18.20" "18.20. Does the player mean..."
ph_multipleobjectlist ph_altermultipleobjectlist _ WI_18_21 "18.21" "18.21. Multiple action processing"
PM_BadActivityName kind_activity ACTIVITIES _ WI_19_1 "19.1" "19.1. What are activities?"
PM_BadWhenWhile _ WI_19_4 "19.4" "19.4. While clauses"
EXTACTIVITIES ph_carryout ph_carryoutwith ph_continueactivity _ WI_19_5 "19.5" "19.5. New activities"
PM_ActivityVarValue PM_ActivityVarUnknownKOV PM_ActivityVarOverspecific PM_ActivityVarAnd PM_ActivityVariableNameless _ WI_19_6 "19.6" "19.6. Activity variables"
ph_beginactivity ph_beginactivitywith ph_endactivity ph_endactivitywith ph_handlingactivity ph_handlingactivitywith ph_abandonactivity ph_abandonactivitywith _ WI_19_7 "19.7" "19.7. Beginning and ending activities manually"
var_particular act_con _ WI_19_9 "19.9" "19.9. Deciding the concealed possessions of something"
act_pn ph_omit _ WI_19_10 "19.10" "19.10. Printing the name of something"
act_ppn _ WI_19_11 "19.11" "19.11. Printing the plural name of something"
act_pan _ WI_19_12 "19.12" "19.12. Printing a number of something"
act_lc ph_group ph_groupart ph_grouptext _ WI_19_13 "19.13" "19.13. Listing contents of something"
act_gt _ WI_19_14 "19.14" "19.14. Grouping together something"
act_resp _ WI_19_15 "19.15" "19.15. Issuing the response text of something"
act_details _ WI_19_16 "19.16" "19.16. Printing room description details of something"
act_idetails _ WI_19_17 "19.17" "19.17. Printing inventory details of something"
act_toodark _ WI_19_18 "19.18" "19.18. Printing a refusal to act in the dark"
act_nowdark _ WI_19_19 "19.19" "19.19. Printing the announcement of darkness"
act_nowlight _ WI_19_20 "19.20" "19.20. Printing the announcement of light"
act_darkname _ WI_19_21 "19.21" "19.21. Printing the name of a dark room"
act_darkdesc _ WI_19_22 "19.22" "19.22. Printing the description of a dark room"
act_csl _ WI_19_23 "19.23" "19.23. Constructing the status line"
act_wpa _ WI_19_24 "19.24" "19.24. Writing a paragraph about"
act_lni _ WI_19_25 "19.25" "19.25. Listing nondescript items of something"
act_pld _ WI_19_26 "19.26" "19.26. Printing the locale description of something"
act_cnlo _ WI_19_27 "19.27" "19.27. Choosing notable locale objects for something"
act_plp _ WI_19_28 "19.28" "19.28. Printing a locale paragraph about"
act_ds ph_placeinscope ph_placecontentsinscope _ WI_19_29 "19.29" "19.29. Deciding the scope of something"
act_clarify _ WI_19_30 "19.30" "19.30. Clarifying the parser's choice of something"
act_which _ WI_19_31 "19.31" "19.31. Asking which do you mean"
act_smn _ WI_19_32 "19.32" "19.32. Supplying a missing noun/second noun"
kind_snippet var_command act_reading ph_snippetmatches ph_snippetdoesnotmatch ph_snippetincludes ph_snippetdoesnotinclude ph_rejectcommand ph_replacesnippet ph_cutsnippet ph_changecommand _ WI_19_33 "19.33" "19.33. Reading a command"
act_implicitly _ WI_19_34 "19.34" "19.34. Implicitly taking something"
act_parsererror _ WI_19_35 "19.35" "19.35. Printing a parser error"
act_all _ WI_19_36 "19.36" "19.36. Deciding whether all includes"
act_banner phs_banner _ WI_19_37 "19.37" "19.37. Printing the banner text"
act_obit _ WI_19_38 "19.38" "19.38. Printing the player's obituary"
act_amuse _ WI_19_39 "19.39" "19.39. Amusing a victorious player"
act_startvm _ WI_19_40 "19.40" "19.40. Starting the virtual machine"
PM_RulebookWithTo PM_RulebookWithDefinition PM_RulebookWithAt RULEBOOKS kind_rulebook kind_rule _ WI_20_1 "20.1" "20.1. On rules"
PM_RuleWithoutColon PM_RuleWithDefiniteArticle PM_BadRulePreamble PM_BadRulePreambleWhen _ WI_20_3 "20.3" "20.3. New rules"
PM_PlaceWithMissingRule PM_NoSuchRuleExists PM_UnspecifiedRulebookPlacement PM_BadRulePlacementNegation PM_ImproperRulePlacement RLISTING _ WI_20_4 "20.4" "20.4. Listing rules explicitly"
rules_proc _ WI_20_5 "20.5" "20.5. Changing the behaviour of rules"
NEWRULEBOOKS ph_follow _ WI_20_8 "20.8" "20.8. New rulebooks"
ph_followfor _ WI_20_9 "20.9" "20.9. Basis of a rulebook"
PM_RulebookVariableVague PM_RulebookVariableBadKind PM_RulebookVariableTooSpecific PM_RulebookVariableAnd _ WI_20_10 "20.10" "20.10. Rulebook variables"
PM_BadDefaultOutcome PM_DefaultOutcomeTwice ph_succeeds ph_fails ph_nodecision ph_succeeded ph_failed _ WI_20_11 "20.11" "20.11. Success and failure"
PM_NonOutcomeProperty PM_DuplicateOutcome PM_DefaultOutcomeAlready PM_DefaultNamedOutcomeTwice PM_BadOutcomeClarification PM_WrongEndToPhrase PM_MisplacedRulebookOutcome ph_rulebookoutcome _ WI_20_12 "20.12" "20.12. Named outcomes"
ph_succeedswith ph_producedby ph_producedbyfor _ WI_20_13 "20.13" "20.13. Rulebooks producing values"
ph_abide ph_abidefor ph_abideanon _ WI_20_14 "20.14" "20.14. Abide by"
rules_internal _ WI_20_15 "20.15" "20.15. The internal rulebooks which keep stories running"
ph_charnum ph_numchars ph_wordnum ph_numwords ph_pwordnum ph_numpwords ph_upwordnum ph_numupwords ph_linenum ph_numlines ph_paranum ph_numparas _ WI_21_2 "21.2" "21.2. Characters, words, punctuated words, unpunctuated words, lines, paragraphs"
ph_inlower ph_inupper ph_lowercase ph_uppercase ph_titlecase ph_sentencecase _ WI_21_3 "21.3" "21.3. Upper and lower case letters"
ph_matches ph_exactlymatches ph_textfirstindex ph_textlastindex ph_textlength ph_nummatches _ WI_21_4 "21.4" "21.4. Matching and exactly matching"
ph_matchesre ph_exactlymatchesre ph_nummatchesre ph_matchtext ph_subexpressiontext ph_refirstindex ph_relastindex ph_relength _ WI_21_5 "21.5" "21.5. Regular expression matching"
ph_subform _ WI_21_6 "21.6" "21.6. Making new text with text substitutions"
ph_replacechar ph_replaceword ph_replacepword ph_replaceupword ph_replaceline ph_replacepara ph_replace ph_replacewordin ph_replacepwordin ph_replacere _ WI_21_7 "21.7" "21.7. Replacements"
kind_listof _ WI_22_1 "22.1" "22.1. Lists and entries"
PM_IncompatibleConstantListEntry PM_NonconstantConstantListEntry PM_BadConstantListEntry PM_CantLetEmptyList _ WI_22_2 "22.2" "22.2. Constant lists"
phs_listbraced phs_listdef phs_listindef _ WI_22_3 "22.3" "22.3. Saying lists of values"
ph_islistedin ph_isnotlistedin ph_repeatlist _ WI_22_4 "22.4" "22.4. Testing and iterating over lists"
ph_addtolist ph_addlisttolist ph_addatentry ph_addlistatentry ph_remfromlist ph_remlistfromlist ph_rementry ph_rementries _ WI_22_5 "22.5" "22.5. Building lists"
ph_listofdesc _ WI_22_6 "22.6" "22.6. Lists of objects"
ph_reverselist ph_sortlist ph_sortlistreverse ph_sortlistphrase ph_sortlistrandom ph_sortlistproperty ph_sortlistpropertyreverse ph_rotatelist ph_rotatelistback _ WI_22_8 "22.8" "22.8. Sorting, reversing and rotating lists"
ph_numberentries _ WI_22_9 "22.9" "22.9. Accessing entries in a list"
ph_changelength ph_truncate ph_truncatefirst ph_truncatelast ph_extend _ WI_22_10 "22.10" "22.10. Lengthening or shortening a list"
kind_description ph_valuematch _ WI_23_2 "23.2" "23.2. Descriptions as values"
ph_applied0 ph_applied1 ph_applied2 ph_applied3 ph_apply0 ph_apply1 ph_apply2 ph_apply3 _ WI_23_3 "23.3" "23.3. Phrases as values"
ph_appliedlist ph_filter ph_reduction _ WI_23_5 "23.5" "23.5. Map, filter and reduce"
PM_UnknownVirtualMachine _ WI_24_3 "24.3" "24.3. Virtual machines and story file formats"
FIGURES kind_figurename _ WI_24_4 "24.4" "24.4. Gathering the figures"
PM_PictureNotTextual PM_PictureDuplicate _ WI_24_5 "24.5" "24.5. Declaring and previewing the figures"
ph_displayfigure _ WI_24_6 "24.6" "24.6. Displaying the figures"
SOUNDS kind_soundname _ WI_24_7 "24.7" "24.7. Recorded sounds"
PM_SoundNotTextual PM_SoundDuplicate ph_playsf _ WI_24_8 "24.8" "24.8. Declaring and playing back sounds"
ph_figureid ph_soundid _ WI_24_10 "24.10" "24.10. Some technicalities about figures and sounds"
EFILES _ WI_24_11 "24.11" "24.11. Files"
PM_FilenameUnsafe PM_FilenameNotTextual PM_FilenameDuplicate PM_BadFileOwner PM_BadFileIFID kind_externalfile _ WI_24_12 "24.12" "24.12. Declaring files"
ph_writetable ph_readtable ph_fileexists _ WI_24_13 "24.13" "24.13. Writing and reading tables to external files"
ph_writetext ph_appendtext ph_saytext _ WI_24_14 "24.14" "24.14. Writing, reading and appending text to files"
ph_fileready ph_markfileready ph_markfilenotready _ WI_24_15 "24.15" "24.15. Exchanging files with other programs"
PM_BadEpisode _ WI_26_2 "26.2" "26.2. Bibliographic data"
LCARDS _ WI_26_4 "26.4" "26.4. The Library Card"
IFIDS _ WI_26_5 "26.5" "26.5. The Treaty of Babel and the IFID"
release_files PM_NoSuchPublicRelease _ WI_26_6 "26.6" "26.6. The Release button and the Materials folder"
PM_ReleaseAlong _ WI_26_7 "26.7" "26.7. The Joy of Feelies"
release_cover _ WI_26_8 "26.8" "26.8. Cover art"
release_postcard release_booklet _ WI_26_9 "26.9" "26.9. An introductory booklet and postcard"
release_website _ WI_26_10 "26.10" "26.10. A website"
release_interpreter _ WI_26_11 "26.11" "26.11. A playable web page"
PM_RoomInIgnoredSource _ WI_26_15 "26.15" "26.15. Republishing existing works of IF"
release_solution _ WI_26_16 "26.16" "26.16. Walkthrough solutions"
release_card release_source _ WI_26_17 "26.17" "26.17. Releasing the source text"
PM_MapPlacementDirection PM_MapPlacement PM_MapDirectionClue PM_MapHintUnknown PM_MapSettingTypeFailed PM_MapSettingTooLong PM_MapSettingUnknown PM_MapSettingOfUnknown PM_MapBadRubric PM_MapUnknownOffsetBase PM_MapUnknownOffset PM_MapUnknownColour PM_MapNonLateral PM_MapToNonRoom PM_MapFromNonRoom MAPHINTS _ WI_26_18 "26.18" "26.18. Improving the index map"
EPSMAP _ WI_26_19 "26.19" "26.19. Producing an EPS format map"
EXTENSIONS _ WI_28_1 "28.1" "28.1. The status of extensions"
SRULES _ WI_28_2 "28.2" "28.2. The Standard Rules"
PM_ExtNoEndsHere PM_ExtNoBeginsHere PM_ExtMultipleEndsHere PM_ExtBeginsAfterEndsHere PM_ExtMultipleBeginsHere _ WI_28_5 "28.5" "28.5. A simple example extension"
PM_ExtVersionTooLow phs_extcredits phs_compextcredits _ WI_28_6 "28.6" "28.6. Version numbering"
PM_UnequalHeadingInPlaceOf PM_HeadingInPlaceOfUnknown PM_HeadingInPlaceOfUnincluded _ WI_28_9 "28.9" "28.9. Extensions can interact with other extensions"
PM_ImplicationValueProperty PM_ImplicationCertain _ WI_28_13 "28.13" "28.13. Implications"
PM_BadInlineTag PM_BadInlineExpansion PM_InlineRule PM_InlineTooLong PM_UnendingI6 _ WI_28_15 "28.15" "28.15. Defining phrases in Inform 6"
PM_BadObjectTranslation _ WI_28_21 "28.21" "28.21. Inform 6 objects and classes"
PM_QuantityTranslatedAlready PM_NonQuantityTranslated PM_NonPropertyTranslated PM_TranslatedToNonIdentifier PM_TranslatedUnknownCategory PM_TranslatedTwice PM_TranslatesActionAlready PM_TranslatesNonAction _ WI_28_22 "28.22" "28.22. Inform 6 variables, properties, actions, and attributes"
PM_GrammarTranslatedAlready _ WI_28_23 "28.23" "28.23. Inform 6 Understand tokens"
PM_IncludeInsteadOf PM_WhenDefiningUnknown PM_BeforeTheLibrary PM_BadI6Inclusion _ WI_28_25 "28.25" "28.25. Overriding definitions in kits"
PM_LabelNamespaceTooLong _ WI_28_28 "28.28" "28.28. Invocation labels, counters and storage"

View file

@ -0,0 +1,24 @@
Oval Office
America Stands Tall
An Interactive Fiction
Release 1 / Serial number 160428 / Inform 7 v10.2.0 / D
Oval Office
You can see Josh and Toby here.
> > Oval Office
(Testing.)
>[1] guess josh is 6 foot 3
No, Josh is shorter than that.
>[2] guess josh is 5 foot 9
No, Josh is shorter than that.
>[3] guess josh is 5 foot 3
No, Josh is taller than that.
>[4] guess josh is 5 foot 8
Spot on!
> >

View file

@ -0,0 +1,24 @@
Example: * America Stands Tall
Location: Notations with multiple parts
RecipeLocation: Volume, Height, Weight
Index: Feet and inches
Description: Describing height in feet and inches.
For: Z-Machine
{*}"America Stands Tall"
The Oval Office is a room. Josh and Toby are men in the Oval. A height is a kind of value. 5 foot 11 specifies a height. A person has a height. Josh is 5 foot 8. Toby is 5 foot 10.
Height guessing is an action applying to one thing and one height. Understand "guess [someone] is [height]" as height guessing.
Check height guessing:
if the noun is not a person, say "You can only guess the height of people." instead.
Carry out height guessing:
let the guess be the height understood;
let the true answer be the height of the noun;
if the guess is the true answer, say "Spot on!";
if the true answer is greater than the guess, say "No, [the noun] is taller than that.";
if the true answer is less than the guess, say "No, [the noun] is shorter than that."
Test me with "guess josh is 6 foot 3 / guess josh is 5 foot 9 / guess josh is 5 foot 3 / guess josh is 5 foot 8".

View file

@ -0,0 +1,26 @@
As The Crow Flies To Iffley Lock
An Interactive Fiction
Release 1 / Serial number 160428 / Inform 7 v10.2.0 / D
Radcliffe Camera
>(Testing.)
>[1] visit sp 51014 07322
You walk 1.04702km to SP 51014 07322, but there's nothing much there, so you sidle a further 467.87283m over to St Hugh's College instead, at SP 50825 07750.
St Hugh's College
>[2] visit sp 51735 06319
You walk 1.69584km to SP 51735 06319, which takes you neatly to...
Queen's Lane Coffee House
>[3] visit sp 51735 06319
You're there already, near enough.
>Are you sure you want to quit?

View file

@ -0,0 +1,93 @@
Example: *** As The Crow Flies To Iffley Lock
Location: Parts corresponding to kinds
RecipeLocation: Continuous Spaces and The Outdoors
Index: Grid references
Description: Calculated walking distances based on grid references at start and end of a walk.
For: Glulx
The Ordnance Survey National Grid reference system (OSGB) was developed in 1936 for the great retriangulation, which led to the building of many concrete pillars on British hilltops and to today's maps. The full range of values is enormous, since OSGB can specify any point in the British Isles to an accuracy of 1m. Fortunately, we only want to use positions in the town of Oxford, which sits fully inside a modest rectangular portion of square `SP`. So:
{*}"As The Crow Flies To Iffley Lock"
Length is a kind of value.
1.0m specifies a length.
1.0km specifies a length scaled up by 1000.
Area is a kind of value.
1.0 sq m specifies an area.
A length times a length specifies an area.
Grid reference is a kind of value.
SP <easting> <northing> specifies a grid reference with parts
easting (45000 to 54999, corresponding to lengths) and
northing (5 digits, 3000 to 8999, corresponding to lengths).
A room has a grid reference called map position.
Radcliffe Camera is a room with map position SP 51495 06392.
Queen's Lane Coffee House is a room with map position SP 51735 06319.
Iffley Lock is a room with map position SP 52460 03628.
Wytham Woods is a room with map position SP 46227 08076.
St Hugh's College is a room with map position SP 50825 07750.
In a reference like `SP 51495 06392`, the two five-digit numbers are called "easting" and "northing", and are in effect x- and y-coordinates measured in meters. (Note that these two parts of the notation are `corresponding to lengths`, and `length` uses real arithmetic, but the conversions are all automatic.) So we can perform some arithmetic:
{**}To decide what length is the grid distance from (GR1 - grid reference) to (GR2 - grid reference):
let 𝚫n be the northing part of GR1 minus the northing part of GR2;
let 𝚫e be the easting part of GR1 minus the easting part of GR2;
let D be the real square root of ((𝚫e times 𝚫e) plus (𝚫n times 𝚫n));
decide on D.
To decide what length is the distance as the crow flies from (R1 - room) to (R2 - room):
let GR1 be the map position of R1;
let GR2 be the map position of R2;
decide on the grid distance from GR1 to GR2.
And now, for example, `northing part of SP 51014 07322` is the length `7.322km`, while `distance as the crow flies from the Radcliffe Camera to Queen's Lane Coffee House` is `250.85654m`.
This accuracy is all a little spurious due to the curvature of the earth and the
difficulty of deciding which table at the Queen's Lane Coffee House defines its
position, and so on, but it's right to within, let's say, 5m.
{**}Visiting is an action applying to one grid reference.
Check visiting:
let X be the grid reference understood;
let D be the grid distance from the map position of the location of the player to X;
if D < 5m, say "You're there already, near enough." instead.
Carry out visiting:
let X be the grid reference understood;
let D be the grid distance from the map position of the location of the player to X;
say "You walk [D] to [X]";
let the closest room be a room;
let the closest approach be -1m;
repeat with R running through rooms which are not the location of the actor:
let D be the grid distance from the X to the map position of R;
if the closest approach < 0m or the closest approach > D:
now the closest approach is D;
now the closest room is R;
if the closest approach < 5m:
say ", which takes you neatly to...";
otherwise:
say ", but there's nothing much there, so you sidle a further [closest approach] over to [the closest room] instead, at [map position of the closest room].";
now the actor is in the closest room.
Understand "visit [grid reference]" as visiting.
Test me with "visit SP 51014 07322 / visit SP 51735 06319 / visit SP 51735 06319".
Which produces:
> VISIT SP 51014 07322
You walk 7.40594km to SP 51014 07322, but there's nothing much there, so you
sidle a further 467.87283m over to St Hugh's College instead, at SP 50825 07750.
St Hugh's College
> VISIT SP 51735 06319
You walk 1.69584km to SP 51735 06319, which takes you neatly to...
Queen's Lane Coffee House
> VISIT SP 51735 06319
You're there already, near enough.

View file

@ -0,0 +1,12 @@
Hello Shanwick
An Interactive Fiction
Release 1 / Serial number 160428 / Inform 7 v10.2.0 / D
Flight Deck
Douglas smoothly intones, "Hello Shanwick, this is Golf Echo Romeo Tango India."
>Are you sure you want to quit?

View file

@ -0,0 +1,47 @@
Example: ** Hello Shanwick
Location: Parts corresponding to kinds
RecipeLocation: The Passage Of Time
Index: International aviation alphabet
Description: Aircraft tail numbers using the international aviation alphabet.
For: Glulx
Since 1956, pilots have identified their aircraft over radio channels using a standard international alphabet, which has several names and numerous parent organisations. It goes like so:
{*}"Hello Shanwick"
The international aviation alphabet is a kind of value. Alpha, Bravo,
Charlie, Delta, Echo, Foxtrot, Golf, Hotel, India, Juliet, Kilo, Lima, Mike,
November, Oscar, Papa, Quebec, Romeo, Sierra, Tango, Uniform, Victor,
Whiskey, X-ray, Yankee, Zulu is the international aviation alphabet.
(Some people spell `Alfa` and `Juliett`. Those people need help.) European civil aircraft are normally given "tail numbers" like this:
{**}A tail number is a kind of value.
<country>-<first><second><third><fourth> specifies a tail number
with parts
country (values "A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z",
corresponding to the international aviation alphabet),
first (values "A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z",
corresponding to the international aviation alphabet),
second (values "A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z",
corresponding to the international aviation alphabet),
third (values "A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z",
corresponding to the international aviation alphabet),
fourth (values "A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z",
corresponding to the international aviation alphabet).
To say callsign of (T - tail number):
say "[country part of T] [first part of T] [second part of T] [third part of T] [fourth part of T]".
This is all a little clumsy and repetitious, but no matter, because now we can write assertions like, say, `The Mont Blanc rescue helicopter is always F-ZBQG.` Or:
{**}Flight Deck is a room.
"Douglas smoothly intones, 'Hello Shanwick, this is [callsign of G-ERTI].'"
which prints out as:
``` transcript
Douglas smoothly intones, "Hello Shanwick, this is Golf Echo Romeo Tango India".
```

View file

@ -1,5 +1,5 @@
Example: *** Snip
Location: Understanding specified numbers
Location: Notations with multiple parts
RecipeLocation: Ropes
Index: CUT and TIE for lengths of string
Description: A string which can be cut into arbitrary lengths, and then tied back together.

View file

@ -0,0 +1,15 @@
-17 = ลบ๑๗.
-2147483648 = ลบ๒๑๔๗๔๘๓๖๔๘.
90125 = ๙๐๑๒๕.
Sun Nueng Song Sam
An Interactive Fiction
Release 1 / Serial number 160428 / Inform 7 v10.2.0 / D
Ritdha High School's Gifted Program
>Are you sure you want to quit?

View file

@ -0,0 +1,46 @@
Example: ** Sun Nueng Song Sam
Location: Unusual digits
RecipeLocation: Mathematics
Index: Thai numerals
Description: Printing signed decimal numbers in traditional Thai numerals.
For: Glulx
There's not really a scenario here, but interested readers are referred to the hit television series นักเรียนพลังกิฟต์ (2018), _Students With Special Powers_.
{*}"Sun Nueng Song Sam"
Ritdha High School's Gifted Program is a room.
A Thai number is a kind of value.
<value> specifies a Thai number with parts value (digits "๐๑๒๓๔๕๖๗๘๙").
Thai numerals use base 10, the digits being sun, nueng, song, sam, si, ha, hok, chet, paet, kao, sip.
The tricky part is how to handle negative numbers. The Thai equivalent of the minus sign is "ลบ", so we can basically get a negative number by printing this and then printing the negation of the original. In the same way, we could print ``-354`` by printing ``-`` and then printing 0 minus -354, which of course is 354.
But there's a wrinkle: because of the way numbers are stored internally, the number -2147483648 has to be a special case. The negation of that ought to be 2147483648, but no such `number` value exists. So we have to handle that one number differently.
{**}To say (N - -2147483648) in Thai digits:
say "ลบ";
say 214748364 in Thai digits;
say 8 in Thai digits;
To say (N - a negative number) in Thai digits:
say "ลบ";
say 0 minus N in Thai digits;
To say (N - a number) in Thai digits:
say the Thai number with value part N.
When play begins:
say "-17 = [-17 in Thai digits].";
say "-2147483648 = [-2147483648 in Thai digits].";
say "90125 = [90125 in Thai digits]."
And this produces:
``` transcript
-17 = ลบ๑๗.
-2147483648 = ลบ๒๑๔๗๔๘๓๖๔๘.
90125 = ๙๐๑๒๕.
```

View file

@ -0,0 +1,109 @@
Tonight Show Studio
The Game That Ties You Up In Knots
An Interactive Fiction
Release 1 / Serial number 160428 / Inform 7 v10.2.0 / D
Tonight Show Studio
It is May 3, 1966, and live from our studio in 30 Rock, Eva Gabor, star of the Hooterville-based farm sitcom Green Acres, is getting all chummy with America's hostest host, Johnny Carson.
You can see Eva Gabor and Johnny Carson here.
Eva Gabor is standing next to the Twister mat, eager to begin.
Johnny Carson is standing next to the Twister mat, eager to begin.
> > Tonight Show Studio
(Testing.)
>[1] spin
"SPIN!" the rapturous audience calls out. And so you spin the spinner. And when it stops...
"Okay, Eva Gabor, you have to put your left foot on a yellow disc."
Eva Gabor has left foot on a yellow disc.
>[2] spin
"SPIN!" the rapturous audience calls out. And so you spin the spinner. And when it stops...
"Okay, Johnny Carson, you have to put your right hand on a green disc."
Johnny Carson has right hand on a green disc.
>[3] spin
"SPIN!" the rapturous audience calls out. And so you spin the spinner. And when it stops...
"Okay, Eva Gabor, you have to put your left hand on a blue disc."
Eva Gabor has left foot on a yellow disc and left hand on a blue disc.
>[4] spin
"SPIN!" the rapturous audience calls out. And so you spin the spinner. And when it stops...
"Okay, Johnny Carson, you have to put your right hand on a green disc."
Johnny Carson has right hand on a green disc.
>[5] spin
"SPIN!" the rapturous audience calls out. And so you spin the spinner. And when it stops...
"Okay, Eva Gabor, you have to put your left foot on a green disc."
Eva Gabor has left foot on a green disc and left hand on a blue disc.
>[6] spin
"SPIN!" the rapturous audience calls out. And so you spin the spinner. And when it stops...
"Okay, Johnny Carson, you have to put your left hand on a green disc."
Johnny Carson has left hand on a green disc and right hand on a green disc.
>[7] spin
"SPIN!" the rapturous audience calls out. And so you spin the spinner. And when it stops...
"Okay, Eva Gabor, you have to put your left foot on a red disc."
Eva Gabor has left foot on a red disc and left hand on a blue disc.
>[8] spin
"SPIN!" the rapturous audience calls out. And so you spin the spinner. And when it stops...
"Okay, Johnny Carson, you have to put your left foot on a blue disc."
Johnny Carson has left foot on a blue disc, left hand on a green disc and right hand on a green disc.
>[9] spin
"SPIN!" the rapturous audience calls out. And so you spin the spinner. And when it stops...
"Okay, Eva Gabor, you have to put your left foot on a red disc."
Eva Gabor has left foot on a red disc and left hand on a blue disc.
>[10] spin
"SPIN!" the rapturous audience calls out. And so you spin the spinner. And when it stops...
"Okay, Johnny Carson, you have to put your right hand on a green disc."
Oh no, Johnny Carson falls and loses! The crowd goes wild, and the players step back for another bout, stretching ruefully.
>[11] spin
"SPIN!" the rapturous audience calls out. And so you spin the spinner. And when it stops...
"Okay, Eva Gabor, you have to put your left hand on a yellow disc."
Eva Gabor has left hand on a yellow disc.
>[12] spin
"SPIN!" the rapturous audience calls out. And so you spin the spinner. And when it stops...
"Okay, Johnny Carson, you have to put your right foot on a red disc."
Johnny Carson has right foot on a red disc.
>[13] spin
"SPIN!" the rapturous audience calls out. And so you spin the spinner. And when it stops...
"Okay, Eva Gabor, you have to put your right hand on a blue disc."
Eva Gabor has left hand on a yellow disc and right hand on a blue disc.
> >

View file

@ -0,0 +1,90 @@
Example: *** The Game That Ties You Up In Knots
Location: Parts corresponding to kinds
RecipeLocation: Dice and Playing Cards
Index: Twister
Description: A two-player game of Twister, in which each person has to place hands or feet on the coloured discs on a play-mat until one falls over.
For: Z-Machine
The evergreen children's game _Twister_ was devised in 1966 (when it was briefly called _Pretzel_) and became a hit following a memorable edition of the _Tonight Show_. Rather than a board, _Twister_ has a playmat on the floor, with sixteen discs arranged four by four, each row being a different colour. Each player in turn has to move one of their four limbs to some disc of a given colour: the first to fall over, or touch the mat, loses.
We will use two kinds of value for `limb` and `colour` respectively: each one has four possible values. A `Twister turn` then combines these, so that there are altogether sixteen possible turns.
{*}"The Game That Ties You Up In Knots"
The Tonight Show Studio is a room. "It is May 3, 1966, and live from our studio in 30 Rock, Eva Gabor, star of the Hooterville-based farm sitcom Green Acres, is getting all chummy with America's hostest host, Johnny Carson."
Eva Gabor and Johnny Carson are people in the Tonight Show Studio.
A limb is a kind of value. The limbs are left foot, right foot, left hand, and right hand.
A colour is a kind of value. The colours are red, yellow, green, and blue.
A Twister turn is a kind of value. <moved limb>-<target colour> specifies a Twister turn with parts moved limb (values "LF, RF, LH, RH", corresponding to limb) and target colour (values "R, Y, G, B", corresponding to colour).
Now, if we're going to play this game, we need some way to record the state of play. In this particular scenario there are only eight limbs, since Eva and Johnny have four apiece, but it seems neater to set things up so that we could easily add more players as required.
So, then, each person has four limbs which can each be either unassigned, or touching a disc of a given colour. An assignment like this is neatly handled by a `relation of limbs to colours`. Eva's left hand, say, can be either not related to a colour, in which case her hand is free, or can be related to, say, `blue`, which means her hand is resting on a blue disc.
However, there can't be just one relation: what's true of Eva's hand is not true of Johnny's. So the key idea is to give each person an independent relation of their own, and a property is perfect for this:
{**}A person has a relation of limbs to colours called predicament.
So now `predicament of Eva` is the relation showing where her hands and feet are placed, and similarly for `predicament of Johnny`. These are entirely different relations, and changing one does not affect the other.
So now we need some book-keeping. The phrase `clear the mat` will unassign everyone's limbs, that is, will simulate everyone getting up at the end of the game:
{**}To clear the mat:
repeat with L running through limbs:
repeat with C running through colours:
repeat with P running through people:
now the predicament of P does not relate L to C;
And this enables us to `position the left hand of Eva on blue`:
{**}To position the (L - limb) of (P - person) on (new colour - colour):
repeat with old colour running through colours:
now the predicament of the next player does not relate L to the old colour;
now the predicament of P relates L to the new colour.
Note that way we make sure Eva's hand is not on two colours at once.
The following produces text like ``Johnny Carson has left foot on a green disc, right foot on a red disc and right hand on a blue disc.``, and thus reports the state of play.
{**}Instead of examining a person (called the contestant):
say "[The contestant] ";
let postures be a list of texts;
repeat with L running through limbs:
repeat with C running through colours:
if the predicament of the next player relates L to C:
add "[L] on a [C] disc" to postures;
if postures is empty:
say "is standing next to the Twister mat, eager to begin.";
otherwise:
say "has [postures].";
After looking:
try examining Eva;
try examining Johnny.
And that just leaves the player as master of ceremonies, spinning the random selector for the moves they must each make in turn:
{**}The next player is initially Eva.
Spinning is an action applying to nothing. Understand "spin" as spinning.
Carry out spinning:
say "'SPIN!' the rapturous audience calls out. And so you spin the spinner. And when it stops...[paragraph break]";
let the move be a random Twister turn;
let L be the moved limb part of the move;
let C be the target colour part of the move;
say "'Okay, [next player], you have to put your [L] on a [C] disc.'[paragraph break]";
position the L of the next player on C;
if a random chance of 1 in 5 succeeds:
say "Oh no, [next player] falls and loses! The crowd goes wild, and the players step back for another bout, stretching ruefully.";
clear the mat;
otherwise:
try examining the next player;
if the next player is Eva:
now the next player is Johnny;
otherwise:
now the next player is Eva;
Test me with "spin / spin / spin / spin / spin / spin / spin / spin / spin / spin / spin / spin / spin".

View file

@ -0,0 +1,35 @@
stellar type: O00
stellar type: O0Ia
stellar type: K9Iab
"class part of K9Iab" = temperature class: K-type
"temperature part of K9Iab" = real number: 9.0
"luminosity part of K9Iab" = luminosity class: intermediate-size luminous supergiant
"stellar type with class part A-type temperature part 4.0 luminosity part subgiant" = stellar type: A4IV
Annie Jump Cannon classifies Beta Aquilae as G8IV. "Hm, yes - subgiant."
Annie Jump Cannon classifies Herschel's Garnet as M2Ia. "Hm, yes - luminous supergiant."
The Universe of Annie Jump Cannon
An Interactive Fiction
Release 1 / Serial number 160428 / Inform 7 v10.2.0 / D
Yerkes Observatory
>(Testing.)
>[1] observe k9iab
You observe a star of type K9Iab.
>[2] observe o00
You observe a star of type O00.
>[3] observe m9vii
You observe a star of type M9VII.
>[4] observe f2ia
You observe a star of type F2Ia.
>Are you sure you want to quit?

View file

@ -0,0 +1,109 @@
Example: *** The Universe of Annie Jump Cannon
Location: Parts corresponding to kinds
RecipeLocation: Passers-By, Weather and Astronomical Events
Index: Harvard star classifications
Description: Harvard star classifications such as A5Ib or G8IV.
For: Glulx
In 1866 the Italian priest Angelo Secchi, having determined for the first time that the Sun was indeed a star, found a way to sort stars by their spectra, that is, by the blend of colours of light with which they shone. He used:
A stellar type is a kind of value.
Secchi class <class> specifies a stellar type with parts
class (values "I, II, III, IV, V, VI, VII").
At Harvard, Henry Draper and, more particularly, Edward Pickering carried out a larger survey and subdivided Secchi's classes so that there were now letters `A` to `Q`, with `A` to `D` being versions of `Secchi class I`, and so on. Exasperatingly, they omitted `J` but included `O`. Antonia Maury, the first woman to be credited as an astronomical observer, decided that `A` and `B` were the wrong way round, and moved back to Roman numbers, `I` to `XXII`.
Annie Jump Cannon brokered a compromise between Maury and Pickering. She reverted to letters, but ordered them better by what was now understood to be surface temperature, and grouped them simply as `O` (hottest), `B`, `A`, `F`, `G`, `K`, `M` (coolest): the traditional mnemonic being "oh be a fine girl, kiss me". Each class was subdivided 0 to 9, so that `G2` was closer to `G` than `K`, while `G9` was very nearly K-type.
In 1943 the action moved to Wisconsin, where the University of Chicago's Yerkes Observatory found a way to sort stars not by temperature but by luminosity: these classes were `0` (brightest), `Ia`, `Iab`, `Ib`, `II`, `III`, `IV`, `V`, `VI`, `VII` (dimmest).
Modern stellar classification is a combination:
{*}"The Universe of Annie Jump Cannon"
The Yerkes Observatory is a room.
A temperature class is a kind of value. The temperature classes are O-type,
B-type, A-type, F-type, G-type, K-type and M-type.
A luminosity class is a kind of value. The luminosity classes are hypergiant,
luminous supergiant, intermediate-size luminous supergiant, less luminous
supergiant, bright giant, giant, subgiant, main-sequence, subdwarf and white
dwarf.
A stellar type is a kind of value. <class><temperature><luminosity> specifies a
stellar type with parts
class (values "O, B, A, F, G, K, M", corresponding to temperature classes),
temperature (1 decimal digit, corresponding to a real number) and
luminosity (values "0, Ia, Iab, Ib, II, III, IV, V, VI, VII", corresponding
to luminosity classes).
In fact this is still a simplification because people sometimes subdivide
the number further or add "peculiarity" suffixes like `He wk`, or add extreme
additional types for truly odd stars, but it'll do.
Between 1910 and 1940 Annie Jump Cannon was to classify 350,000 stars by hand,
reaching a speed of three spectra per minute, a feat unequalled before or since.
Here's a smaller survey:
{**}A star is a kind of thing. A star has a stellar type. Some stars are defined
by the Table of Astral Survey Work.
Table of Astral Survey Work
name stellar type
S Monocerotis O7V
Rigel B8Ia
Deneb A2Ia
Zeta Leonis F0III
Beta Aquilae G8IV
Epsilon Eridani K2V
Herschel's Garnet M2Ia
And stellar types, like other notations, can also be understood:
{**}Observing is an action applying to one stellar type.
Carry out observing: say "You observe a star of type [stellar type understood]."
Understand "observe [stellar type]" as observing.
Test me with "observe K9Iab / observe O00 / observe M9VII / observe F2Ia".
And to give this system a further workout:
{**}To classify (star in question - a star):
say "Annie Jump Cannon classifies [star in question] as [stellar type
of the star in question]. 'Hm, yes - [luminosity part of stellar
type of the star in question].'"
When play begins:
showme O00;
showme O0Ia;
showme K9Iab;
showme the class part of K9Iab;
showme the temperature part of K9Iab;
showme the luminosity part of K9Iab;
showme the stellar type with class part A-type temperature part 4.0 luminosity part subgiant;
classify Beta Aquilae;
classify Herschel's Garnet.
This all results in:
``` transcript
stellar type: O00
stellar type: O0Ia
stellar type: K9Iab
"class part of K9Iab" = temperature class: K-type
"temperature part of K9Iab" = real number: 9.0
"luminosity part of K9Iab" = luminosity class: intermediate-size luminous supergiant
"stellar type with class part A-type temperature part 4.0 luminosity part subgiant" = stellar type: A4IV
Annie Jump Cannon classifies Beta Aquilae as G8IV. "Hm, yes - subgiant."
Annie Jump Cannon classifies Herschel's Garnet as M2Ia. "Hm, yes - luminous supergiant."
Yerkes Observatory
> OBSERVE K9IAB
You observe a star of type K9Iab.
```
...and so on.

View file

@ -1,5 +1,5 @@
Example: *** Zqlran Era 8
Location: The parts of a number specification
Location: The parts of a notation
RecipeLocation: The Passage Of Time
Index: Time expressed in units other than minutes
Description: Creating an alternative system of time for our game, using new units.

View file

@ -422,6 +422,8 @@ Out of doors, nature is seldom still. Clouds scull by at random, as in [Weatheri
[Night and Day] and [Totality] each schedule celestial events to provide a changing display in the sky above, and this time running like clockwork rather than at random.
[The Universe of Annie Jump Cannon] gives a somewhat more technical way of itemising the stars in the sky.
### See Also
- [Scene Changes] for meteors and a moon-rise.
@ -1688,6 +1690,8 @@ This section covers vehicles whose interior consists of at least one entire room
On a very large, slowish craft such as a cruise liner, we are not so much travelling in a vehicle: it's more as if we are visiting a whole building, which becomes our world for the (probably long) duration of the journey. The liner steers around in long, slow curves, changing its orientation in the water, so that (if we think of "north" as a strictly magnetic matter, anyway) north is constantly rotating: something we don't notice on board because our own reference points, provided by the ship itself, stay fixed relative to ourselves. Because of this, some ships in IF are navigated using ``FORE``, ``AFT``, ``PORT`` and ``STARBOARD`` directions rather than ``NORTH``, ``EAST``, ``SOUTH`` and ``WEST``: see [Fore].
Aviation can be handled in much the same way, but it does have a technical language all its own: see [Hello Shanwick] for the aviation alphabet and for giving tail numbers to planes.
### See Also
- [Bicycles, Cars and Boats] for smaller conveyances.
@ -1861,6 +1865,8 @@ Drawing cards from a shuffled pack is only one source of randomness. Games of ch
Quick, but not very good. Most dice games involve rolling more than one die at a time, to get a more interesting distribution of outcomes: they may also involve special rules applying to doubles, for instance. See [Do Pass Go].
A different sort of randomness is used to play [The Game That Ties You Up In Knots], an implementation of Twister. Random moves are generated, with each move being a composite of a limb, such as "right leg", and a colour, such as "blue". This also demonstrates how to store quite a complicated set of information about whose limbs are currently where on the mat.
### See Also
- [Typography] for on-screen notations for chess and card games.
@ -2154,6 +2160,8 @@ It is uncommon, but not absolutely unheard-of, to need to do detailed mathematic
[Olympic Medals] shows a non-standard way to sort a table of data numerically.
[Sun Nueng Song Sam] doesn't do anything calculational as such, but does show how to print numbers in non-Western ways.
# Out Of World Actions and Effects
## Start-Up Features

View file

@ -1513,7 +1513,7 @@ These are the two ways in which writers size up the world, so Inform provides bo
And this, like `number`, has an enormous range of possible values.
Quantitative kinds like this are sometimes called "units", because as in this example they're often units in the sense of measuring things. Many Inform projects never need units, but they can still be very useful, and they're described in detail in the chapter on [Numbers and Equations].
Quantitative kinds like this are sometimes called "units", because as in this example they're often units in the sense of measuring things. Many Inform projects never need units, but they can still be very useful, and they're described in detail in the chapter on [Quantities and Equations].
## Abstract objects and concepts
@ -2241,11 +2241,11 @@ Sometimes it's good to pad numbers out so that they occupy a fixed number of dig
> phrase: {phs_indigits} say "[(number) in (number) digit/digits]"
>
> This text substitution writes out the number in decimal, with leading zeroes as needed so that it will not be shorter than the given number of digits. Example:
> This text substitution writes out the number in decimal, with leading zeros as needed so that it will not be shorter than the given number of digits. Example:
>
> "'Do stop flirting, [agent number in 3 digits],' says M."
>
> might render the number `7` as ``007`` not ``7``; `1860`, a lesser agent despite the larger number, would come out as ``1860``; and `0` as ``000``. Note that the number is printed _unsigned_, since minus signs don't really make sense when padding with zeroes. So `-5` is printed, perhaps unexpectedly, as ``4294967281`` (if the Glulx setting is used, as it is by default).
> might render the number `7` as ``007`` not ``7``; `1860`, a lesser agent despite the larger number, would come out as ``1860``; and `0` as ``000``. Note that the number is printed _unsigned_, since minus signs don't really make sense when padding with zeros. So `-5` is printed, perhaps unexpectedly, as ``4294967281`` (if the Glulx setting is used, as it is by default).
### See Also
@ -6046,7 +6046,7 @@ A point which has come up several times in recent chapters is that enumerated ki
Colour is a kind of value. The colours are red, orange, yellow, green, blue, indigo and violet.
...then we not only have seven possible values, we have put them into a sequence, in order of their naming. We can't perform arithmetic on colours, of course, but we can perform comparisons on them. Thus `red < yellow` is true, while `green >= violet` is not. (More on comparisons in the chapter on [Numbers and Equations], which also covers arithmetic.)
...then we not only have seven possible values, we have put them into a sequence, in order of their naming. We can't perform arithmetic on colours, of course, but we can perform comparisons on them. Thus `red < yellow` is true, while `green >= violet` is not. (More on comparisons in the chapter on [Quantities and Equations], which also covers arithmetic.)
It's also sometimes useful to get at the sequence directly. First, the two ends:
@ -8412,7 +8412,7 @@ In practice we can't change these responses unless we know what they're called.
and so on. This lists all of the responses, rule by rule, along with their current texts.
# Numbers and Equations
# Quantities and Equations
## How do we measure things?
@ -8481,7 +8481,7 @@ all produce `number` values, and are exactly equivalent to writing `5173548`, `9
2) Numbers in binary, octal or hexadecimal are read as _unsigned_. So `hexadecimal FFFFFFFF` is allowed, but produces the same number as `-1`; `hexadecimal FFFFFFFE` is equivalent to `-2`; and so on. In hexadecimal notation, our extreme `number` values of -2147483648 and 2147483647 are `hexadecimal 80000000` and `hexadecimal 7FFFFFFF`, respectively.
3) Leading zeroes are allowed in binary, octal or hexadecimal, so that `hexadecimal 01FF` is legal, even though the same trick in decimal (`0004`, say) is not.
3) Leading zeros are allowed in binary, octal or hexadecimal, so that `hexadecimal 01FF` is legal, even though the same trick in decimal (`0004`, say) is not.
We can also print back numbers in other number bases:
@ -8495,11 +8495,11 @@ We can also print back numbers in other number bases:
>
> If a project uses the Glulx setting, as is the default, then all numbers fit exactly into 8 hexadecimal digits, or 32 binary ones; with the Z-machine setting, numbers fit into 4 hexadecimal digits, or 16 binary ones.
These too can be padded with zeroes:
These too can be padded with zeros:
> phrase: {phs_inbaseindigits} say "[(number) in (number) (base) digit/digits]"
>
> This text substitution writes out the number in the given number base, which must be between 2 and 36, padding with initial zeroes to ensure that the result is at least the given number of digits in length. The number is printed unsigned, whatever the number base.
> This text substitution writes out the number in the given number base, which must be between 2 and 36, padding with initial zeros to ensure that the result is at least the given number of digits in length. The number is printed unsigned, whatever the number base.
>
> For example, `"[232 in 4 decimal digits]."` produces ``0232`` and `"[232 in 4 hexadecimal digits]."` produces ``00E8``.
@ -8507,7 +8507,7 @@ Lastly, for completeness, we also provide:
> phrase: {phs_inunsigneddecimaldigits} say "[(number) in (number) unsigned decimal digit/digits]"
>
> This text substitution writes out the number in unsigned decimal, in such a way that numbers normally considered decimal appear large, padding with initial zeroes to ensure that the result is at least the given number of digits in length.
> This text substitution writes out the number in unsigned decimal, in such a way that numbers normally considered decimal appear large, padding with initial zeros to ensure that the result is at least the given number of digits in length.
To reiterate, though: all these different notations for typing in, and for saying back, whole numbers are all to do with a single kind, `number`. Unlike some programming languages, Inform has no kind for "unsigned integer", nor for "integer which should always be written in binary".
@ -9150,96 +9150,9 @@ In addition we might want equivalents for the inch, the yard and the mile; and v
Fortunately the whole set is indeed available in a presentation box, and at no extra charge.
(a) The built-in extension `Metric Units by Graham Nelson` sets up a whole range of scientific units, with all the notations we are likely to want. Real numbers are used throughout, so large and small-scale calculations can be carried out quite accurately. Like the other built-in extensions, it has its own documentation and examples.
(a) The extension `Metric Units by Graham Nelson` sets up a whole range of scientific units, with all the notations we are likely to want. Real numbers are used throughout, so large and small-scale calculations can be carried out quite accurately. Like the other built-in extensions, it has its own documentation and examples.
(b) The built-in extension `Approximate Metric Units by Graham Nelson` does the same but using whole numbers, scaled about right for human situations. This won't be much use for extensive calculations, and won't be as accurate, but it will work reasonably well if real arithmetic isn't available.
## Notations including more than one number {PM_LPWithoutElement} {PM_LPElementTooLarge} {PM_LPTooManyElements} {PM_LPTooComplicated} {PM_LPNotAllNamed}
^^{units of measure: with multiple numeric components} ^^{units of measure: defining} ^^{defining: units of measure with parts} ^^{limits: of numeric values of units} ^^{numbers: limits of numeric values of units} ^^{Z-machine: numeric limits} ^^{Glulx: numeric limits} ^^{virtual machine: numeric limits} ^^{real numbers: limits of numeric values of units} ^^{punctuation: quotation marks: not usable in unit notations} ^^{|": not usable in unit notations}
We've seen quite enough scientific notation for the time being. There are plenty of other notations used in natural language, for everyday talk, where people don't use a tidy spread of powers of 10. Instead they use mixtures, with some sort of punctuation or text to divide them. For instance, the running time of a piece of music is easier to follow in minutes and seconds than in seconds alone: old-fashioned LP sleeves used to quote running times in the form 4'33.
A running time is a kind of value. 3'59 specifies a running time.
The choice of `3` here makes no difference, much as the choice of `10` in the weight examples was arbitrary. But the `59` is significant. Numbers after the first one are expected to range from 0 up to the value we quote so in this case, the number of seconds can be anything from 0 to 59. Or, for instance:
A height is a kind of value. 5 foot 11 specifies a height.
A specification can contain up to eight numbers like this, but once again we might need to worry about the maximum value which can be stored. For instance, using the 3'59 notation, we can only go up to 546'07 (if we're using the Z-machine format setting) a little over 9 hours, so the new Tori Amos album will not be a problem, but some of the more punishing German operas might break the bank.
In notations like this, only the first-appearing number part is allowed to be negative, and then only when declared with a minus sign:
A secret sign is a kind of value. -2x17 specifies a secret sign with parts mystery and enigma.
Here, the mystery can be negative, but not the enigma.
Notations must not contain double-quotation marks because, even though people did once use these to denote minutes of arc, they would simply confuse programs like Inform's user interface which have to keep track of what is quoted text and what is not. But other punctuation marks are fine *provided they occur between two digits*. For instance, in
A monetary value is a kind of value. $1.99 specifies a monetary value.
the full stop between the 1 and the 99 is not interpreted as a division of two sentences; and similarly for colons in examples such as
An aspect ratio is a kind of value. 16:9 specifies an aspect ratio.
## The parts of a number specification {PM_LPFirstOptional} {PM_LPMultipleOptional} {PM_BadLPPartOption} {PM_BadLPNameOption}
^^{units of measure: with multiple numeric components} ^^{units of measure: defining} ^^{defining: units of measure with parts} ^^{text substitutions: units of measure} ^^{units of measure: displaying} ^^{(preamble optional), when defining units+sourcepart+} ^^{(without leading zeroes), when defining units+sourcepart+} ^^{(leading zeroes), when defining units+sourcepart+} ^^{(part of), for units with multiple components+sourcepart+}
We often need to break up a number specification into its pieces. For instance, suppose we want to know the dollars part of $1.99? We can do this by naming the parts:
A monetary value is a kind of value. $1.99 specifies a monetary value with parts dollars and cents.
We can now find the relevant parts like so. Suppose that `sum` is a monetary value. Then:
dollars part of sum
cents part of sum
are both numbers, so for instance we can
say "Looks like around [dollars part of sum in words] dollar[s]."
We can also go the other way:
monetary value with dollars part 4 cents part 72
produces the monetary value $4.72. (Note the lack of commas or `and`s, and that the parts have to be given in the right order.) This is really intended to be useful when we manipulate such values in unusual ways:
An aspect ratio is a kind of value. 16:20 specifies an aspect ratio with parts width and height.
To decide which aspect ratio is the wider version of (AR - an aspect ratio):
let W be the width part of AR multiplied by 2;
let H be the height part of AR;
let the wider ratio be the aspect ratio with width part W height part H;
decide on the wider ratio.
Declaring the parts of a number specification individually also enables us to tack one or more options onto any of the parts:
A monetary value is a kind of value. $1.99 specifies a monetary value with parts dollars and cents (optional, preamble optional).
This declares that the `cents` part is optional it will be 0 if not specified and that if omitted, the non-numeric "preamble" before it should also be omitted. Thus `$3` is now valid and equivalent to `$3.00`: indeed it will be the preferred form when Inform prints out a monetary value which is an exact number of dollars. If we had said that `cents` was optional, but not said that the preamble was optional, then `$3.` would have been the form which is less satisfactory.
There is only one other option: `without leading zeros`, as in the following.
An aspect ratio is a kind of value. 16:20 specifies an aspect ratio with parts width and height (without leading zeros).
This ensures that when the ratio 4:3 is printed, it will be printed as `4:3` and not `4:03` as would otherwise happen.
## Understanding specified numbers
^^{units of measure: understanding} ^^{understanding: numbers with units}
It may be worth noting in passing that number specifications, like all other kinds of value, can be understood in typed commands. (See the chapter on [Understanding] for more on what can go in such square brackets.) For instance:
{*}"America Stands Tall"
The Oval Office is a room. Josh and Toby are men in the Oval. A height is a kind of value. 5 foot 11 specifies a height. A person has a height. Josh is 5 foot 8. Toby is 5 foot 10.
Height guessing is an action applying to one thing and one height. Understand "guess [someone] is [height]" as height guessing.
Check height guessing: if the noun is not a person, say "You can only guess the height of people." instead. Carry out height guessing: if the height of the noun is the height understood, say "Spot on!"; if the height of the noun is greater than the height understood, say "No, [the noun] is taller than that."; if the height of the noun is less than the height understood, say "No, [the noun] is shorter than that."
Test me with "guess josh is 6 foot 3 / guess josh is 5 foot 9 / guess josh is 5 foot 3 / guess josh is 5 foot 8".
(b) The extension `Approximate Metric Units by Graham Nelson` does the same but using whole numbers, scaled about right for human situations. This won't be much use for extensive calculations, and won't be as accurate, but it will work reasonably well if real arithmetic isn't available.
## Totals {PM_TotalEitherOr} {PM_TotalTableColumn}
@ -9441,6 +9354,482 @@ And having told Inform that lengths multiply to area, we could also divide an ar
The `Metric Units by Graham Nelson` extension includes all of the standard ways that physical quantities are multiplied, and a good way to see these is to try out one of the Metric Units examples and look at the Kinds index, which includes a table showing how all of this works.
# Advanced Notations
## Notations with multiple parts {PM_LPWithoutElement} {PM_LPElementTooLarge} {PM_LPTooManyElements} {PM_LPTooComplicated} {PM_LPNotAllNamed}
^^{units of measure: with multiple numeric components} ^^{units of measure: defining} ^^{defining: units of measure with parts} ^^{limits: of numeric values of units} ^^{numbers: limits of numeric values of units} ^^{Z-machine: numeric limits} ^^{Glulx: numeric limits} ^^{virtual machine: numeric limits} ^^{real numbers: limits of numeric values of units} ^^{punctuation: quotation marks: not usable in unit notations} ^^{|": not usable in unit notations}
^^{units of measure: understanding} ^^{understanding: numbers with units}
The chapter on [Quantities and Equations] featured many variations on specifications like this one:
A weight is a kind of value. 1.0 kg specifies a weight.
Such weights and measures were all ways to give _single_ values a new notation and significance. `12.5 kg` is not the same thing as `12.5` because it's not just an abstract number, it is a weight. All the same, the `weight` kind is really just a nice way to dress up what is basically a `real number` by giving it a particular purpose or meaning.
In this chapter, we go into notations which combine _multiple_ values together. Natural language does quite a lot, using mixtures of numbers with wording or punctuation to divide them. For instance, the running time of a piece of music is easier to follow in minutes and seconds than in seconds alone: old-fashioned LP sleeves used to quote running times in the form 4'33.
A running time is a kind of value. 3'59 specifies a running time.
The choice of `3` here makes no difference, much as the choice of `10` in the weight examples was arbitrary. But the `59` is significant. Numbers after the first one are expected to range from 0 up to the value we quote so in this case, the number of seconds can be anything from 0 to 59. Or, for instance:
A height is a kind of value. 5 foot 11 specifies a height.
Once again, kinds like `running time` and `height` can be written as constants:
let the clearance be 12 foot 6;
let Einstein On The Beach without an interval be 280'20;
And they can be said:
say "I hope this truck will fit under a [clearance] bridge. [clearance plus 1 foot 4] to be on the safe side.";
say "Oh my, this opera runs [Einstein On The Beach without an interval].";
And even understood in typed commands by the player:
Height guessing is an action applying to one thing and one height. Understand "guess [someone] is [height]" as height guessing.
See the example [America Stands Tall] for a full working-out of this.
The different number-like segments of a notation are called its _parts_. In the notation `1.0 kg`, there is just one part, but there are two in each of `3'59` and `5 foot 11`. In principle there can be as many as eight parts, though there are some practical limitations due to Inform's need to store the result efficiently during play. In practice, it's rare to need more than four.
In notations like this, only the first-appearing number part is allowed to be negative, and then only if it was declared with a minus sign:
A secret sign is a kind of value. -2x17 specifies a secret sign with parts mystery and enigma.
Note that the parts of a notation can optionally be given names, and that's what was done here. The `mystery` part can be negative, but not the `enigma` part.
Notations must not contain double-quotation marks because, even though people did once use these to denote minutes of arc, they would simply confuse programs like Inform's user interface which have to keep track of what is quoted text and what is not. But other punctuation marks are fine *provided they occur between two digits*. For instance, in
A monetary value is a kind of value. $1.99 specifies a monetary value.
the full stop between the 1 and the 99 is not interpreted as a division of two sentences; and similarly for colons in examples such as
An aspect ratio is a kind of value. 16:9 specifies an aspect ratio.
It is also possible to specify a number base to use:
CSS colour is a kind of value.
#FF_FF_FF specifies a CSS colour in hexadecimal.
The base can be `in binary`, `in octal`, `in decimal`, `in hexadecimal` or
`in base B` for any value of `B` from 2 to 36. Note that when looking for
"parts" in the specification, Inform then looks for digits of that number
base. Hexadecimal numbers use the sixteen digits `0`, `1`, ..., `9`,
`A`, `B`, `C`, `D`, `E`, `F`, and therefore `FF` is a two-digit number.
So Inform reads the notation `#FF_FF_FF` as having three number parts.
### See Also
- [Numbers, ranges, overflows, and number bases] for dealing with regular
`number` values in number bases other than 10.
## The parts of a notation {PM_LPFirstOptional} {PM_LPMultipleOptional} {PM_BadLPPartOption} {PM_BadLPNameOption}
^^{units of measure: with multiple numeric components} ^^{units of measure: defining} ^^{defining: units of measure with parts} ^^{text substitutions: units of measure} ^^{units of measure: displaying} ^^{(preamble optional), when defining units+sourcepart+} ^^{(without leading zeros), when defining units+sourcepart+} ^^{(leading zeros), when defining units+sourcepart+} ^^{(part of), for units with multiple components+sourcepart+}
If a value has been constructed out of multiple parts, we will sometimes want to extract those parts. For instance, suppose we want to know the dollars part of `$1.99`? We can do this provided the parts have names:
A monetary value is a kind of value. $1.99 specifies a monetary value with parts dollars and cents.
We can now find the relevant parts like so. Suppose that `sum` is a monetary value. Then:
dollars part of sum
cents part of sum
are both numbers, so for instance we can
say "Looks like around [dollars part of sum in words] dollar[s]."
We can also go the other way:
monetary value with dollars part 4 cents part 72
produces the monetary value `$4.72`. (Note the lack of commas or `and`s, and that the parts have to be given in the right order.) This is really intended to be useful when we manipulate such values in unusual ways:
An aspect ratio is a kind of value. 16:20 specifies an aspect ratio with parts width and height.
To decide which aspect ratio is the wider version of (AR - an aspect ratio):
let W be the width part of AR multiplied by 2;
let H be the height part of AR;
let the wider ratio be the aspect ratio with width part W height part H;
decide on the wider ratio.
Naming the parts is also very useful when we want to apply _options_ to them, which go in brackets after their names. For example:
An American map reference is a kind of value. 50° N 100° W specifies an American map reference with parts latitude (7 to 85) and longitude (20 to 179).
Here, the two parts are called `latitude` and `longitude`. The option `7 to 85` applied to `latitude` constrains it to lie in that range: so `6° N 100° W` would not be a valid `American map reference`, because 6 is not in the range 7 to 85 inclusive.
A part can have multiple options, in which case they are listed with commas in between, or none. There's quite a range of these, and some will take a little explaining.
Option | Summary | Documentation
------ | ------- | -------------
`optional` | set to 0 if omitted | see [Optional notation parts]
`preamble optional` | allow preamble text to be omitted too | see [Optional notation parts]
`with leading zeros` | write with zeros up front to pad out the digits | see [Range and number base of notation parts]
`without leading zeros` | or not | see [Range and number base of notation parts]
`in binary` | write in base 2 | see [Range and number base of notation parts]
`in octal` | write in base 8 | see [Range and number base of notation parts]
`in decimal` | write in base 10 | see [Range and number base of notation parts]
`in hexadecimal` | write in base 16 | see [Range and number base of notation parts]
`in base B` | write in base `B`, which must be 2 to 36 | see [Range and number base of notation parts]
`N to M` | fix this part to lie in the range `N` to `M` inclusive | see [Range and number base of notation parts]
`D digits` | require this to have exactly `D` digits, with leading zeros | see [Range and number base of notation parts]
`D BASE digit/digits` | ditto, but in the given number base | see [Range and number base of notation parts]
`up to D digit/digits` | require this to have up to `D` digits | see [Range and number base of notation parts]
`up to D BASE digit/digits` | ditto, but in the given number base | see [Range and number base of notation parts]
`digits "TEXT"` | use these special digit characters | see [Unusual digits]
`values "TEXT"` | use these special values | see [Parts which do not look like numbers]
`corresponding to KIND` | make this part a `KIND` | see [Parts corresponding to kinds]
Most of the time none of these options need to be set, because they are all automatically set to something sensible. For example:
$1.99 specifies a monetary value with parts dollars and cents.
is equivalent to:
$1.99 specifies a monetary value with parts
dollars (without leading zeros, in decimal, digits "0123456789") and
cents (0 to 99, with leading zeros, in decimal, digits "0123456789").
## Optional notation parts
If a part of a notation is specified as `optional` then it can be missed out, and the result will be as if 0 had been given. For example, if we want the pre-Euro currency of France:
French monetary value is a kind of value.
4F99 specifies a French monetary value with parts francs and centimes (optional).
This allows both `12F50` and `14F` to be valid; `14F` is exactly like typing `14F00`. Both forms will be understood correctly in typed commands. Inform will take the hint and prefer the shorter form when printing them back.
`preamble optional` further allows the non-numeric "preamble" to this part to omitted as well. For example:
A monetary value is a kind of value. $1.99 specifies a monetary value with parts dollars and cents (optional, preamble optional).
This declares not only that the `cents` part is optional it will be 0 if not specified but also that if it is omitted, the `.` should be left out as well. Thus `$3` is now valid and equivalent to `$3.00`: indeed, it will be the preferred form when Inform prints out a monetary value which is an exact number of dollars.
## Range and number base of notation parts
The _range_ of a part is the set of values it can hold. For example:
$1.99 specifies a monetary value with parts dollars and cents.
The `dollars` part can be 0, 1, 2, ... with no upper limit (except what will fit in the storage available for the data), but `cents` has the narrower range 0 to 99 inclusive.
In this notation, `$2.09` is legal but `$02.09` and `$2.9` are not. This is because the `cents` part has to be written with leading zeros so that it occupies exactly two digits. By default, the first part of a notation appears without leading zeros, and all subsequent parts with, but this is controllable. For example:
An aspect ratio is a kind of value. 16:20 specifies an aspect ratio with parts width and height (without leading zeros).
This ensures that `4:3` is a legal `aspect ratio`, and that `4:03` is not. The option `with leading zeros` is also provided, for completeness.
The option `N to M` overrides the default range for a part. The default is for the range to be unlimited on the first part and to be 0 up to whatever number is used to write the part, for the subsequent ones. In the `$1.99` notation, therefore, the `dollars` part is unlimited, but the `cents` part is `0 to 99`.
`N` is required to be a whole number which is at least 0, and `M` is required to be a whole number which is greater than `N`. For example:
An American map reference is a kind of value. 50° N 100° W specifies an American map reference with parts latitude (7 to 85) and longitude (20 to 179).
Note that with these options set, the `50` and `100` in the specification become unimportant — they are just example values now.
An alternative way to give the range is to write `D digits` or `up to D digits`. These are really just convenient synonyms for options we already have. `up to 4 digits` is the same thing as `0 to 9999`, while `4 digits` is the same thing as `0 to 9999, with leading zeros`, so that the possible values are `0000` to `9999`.
If a part uses both ways to give a range, e.g., `0 to 39, 2 digits`, then the explicit range, in this case 0 to 39, wins out. An impossible combination such as `0 to 199, 2 digits` is rejected with a problem message.
The _number base_ of a part is ordinarily 10, that is, it is written in decimal. This can be set with the options `in binary`, `in octal`, `in decimal`, `in hexadecimal` or `in base B`, where `B` can be anything from 2 to 36. Note that only one part is affected: see [Notations including more than one number] for how to set a number base for all the parts at once. If the base is greater than 10 then digits 10 to 35 are recognised as either `a` to `z` or `A` to `Z`, but print back as `A` to `Z`. So `2af` and `2AF` are both valid hexadecimal numbers to Inform, and are equal, but would be printed back as ``2AF``.
And we can combine the range and number base settings with the options `D BASE digit/digits` and `up to D BASE digit/digits`.
For example:
A DIP switch setting is a kind of value. _<dip>_ specifies a DIP switch setting with parts bitmap (5 binary digits).
is equivalent to:
A DIP switch setting is a kind of value. _<dip>_ specifies a DIP switch setting with parts bitmap (in binary, 0 to 31, with leading zeros).
and means that, for example, `_01101_` is a valid `DIP switch setting`.
## Angle-bracketed part names
In all the notations so far, the "parts" have been written in something resembling numerical form. For example:
An American map reference is a kind of value.
50° N 100° W specifies an American map reference with parts latitude (7 to 85) and longitude (20 to 179).
But this could also be written like so:
An American map reference is a kind of value.
<latitude>° N <longitude>° W specifies an American map reference with parts latitude (7 to 85) and longitude (20 to 179).
This specification `<latitude>° N <longitude>° W` contains two parts, and Inform then requires the rest of the sentence to explain what they are.
Angle brackets must _either_ contain a double-quoted piece of text to be taken literally, _or_ the name of one of the parts. For example:
An agent is a kind of value.
<"00">7 specifies an agent.
allows constants like `007` and `0011` to be used and printed back, with
the double-0 prefix having no numerical meaning but signalling that this is
an agent, not a number.
This makes it impossible to have a literal `"` character in a specification, but those are impossible for Inform to read anyway because they would be mistaken for text, so this is no loss. But literal angle brackets can be written, so that:
<"<">99<">">
allows `<99>` to be a value. Similarly:
A monetary value is a kind of value. $<dollars><"."><cents> specifies a monetary value with parts dollars and cents (optional, preamble optional).
Note that putting the full stop in quotation marks here prevents Inform from thinking that one sentence has ended and another one has begun.
We can also use the angle-bracket syntax to have two parts of a specification jammed directly next to each other, with nothing in between:
CSS colour is a kind of value.
#<red level><green level><blue level> specifies a CSS colour with parts
red level (2 hexadecimal digits),
green level (2 hexadecimal digits) and
blue level (2 hexadecimal digits).
This enables `CSS colour` to have values like `#4169E1`, royal blue.
The part names in the angle-bracket escapes have to exactly match those given
in the tail of the sentence, and in the same order: Inform will throw a problem message if not.
## Unusual digits
The parts option `digits "TEXT"` tells Inform to use the supplied digit characters in place of the regular ones.
The text must contain exactly the number of characters which equals the number base (2 for binary, 8 for octal, and so on), must have no repeats, and must not use spaces or square brackets.
For binary, the default is `digits "01"`, for decimal it is `digits "0123456789"`, for hexadecimal `digits "0123456789ABCDEF"` and so on.
For example, suppose we want to print hexadecimal numbers as if they were constants in the programming language C, and using lower-case letters for the digits 10 to 15. This would do it:
A C-style hex number is a kind of value.
<"0x"><value> specifies a C-style hex number with parts value (in hexadecimal, digits "0123456789abcdef").
To say (N - a number) C-style:
say the C-style hex number with value part N.
And then `"15786 = [15786 C-style]"` then substitutes to ``15786 = 0x3daa``.
Note that if non-standard digit sets are used, then numbers must be written
as unsigned, and are printed accordingly: but see the [Sun Nueng Song Sam] example for how to handle a signed form.
Throwing in emoji or other symbols can make some intriguing textual effects:
A tomb wall pattern is a kind of value.
<pattern number> specifies a tomb wall pattern with parts pattern number
(4 base 4 digits, digits "▙▛▜▟").
When play begins:
repeat with S running from ▙▙▙▙ to ▟▟▟▟:
say "[S] ";
say ".... is the full set."
prints all 256 possible wall carvings using a row of 4 shapes, each of which can be of 4 types.
## Parts which do not look like numbers
So far, all the parts of a specification have been basically numerical, if possibly with unusual digits. But we can break away from that completely with two more options supplied for parts.
`values "TEXT"` gives a comma-separated list of the text to use for the values. For example, `values "LF, RF, LH, RH"`, where there are exactly 4 possible values, and this is how they are written. Internally, these will be stored as the numbers 1 to 4 respectively. The individual values must be all different from each other, and must not include spaces, double-quotation marks, square brackets, or commas. At least two values must be provided.
If the `values "TEXT"` option is used on a part, then the various other options to do with digits, leading zeros and ranges are all forbidden, since the list we've given already defines the range exactly.
To see why this might be useful, let's work through a practical problem. In modern chess, the squares are written a1 to h8, where the letter represents
the "file" (or column) and the number represents the "rank" (or row). For example, White's leftmost pawn begins on a2, and is called the a-pawn; and Black's king spends the early game hiding on the 8th rank.
So, then, we will try to make an Inform kind whose values are exactly the 64 squares `a1` to `h8`. A devious option would be:
A chessboard square is a kind of value.
<file><rank> specifies a chessboard square with parts
file (1 octal digit, digits "abcdefgh") and
rank (1 to 8).
But this is not ideal. We would find that `file part of a1` was 0, whereas `rank part of a1` was 1: it seems clumsy to number files from 0 and ranks from 1. The following would fix that, but hardly seems elegant:
A chessboard square is a kind of value.
<file><rank> specifies a chessboard square with parts
file (1 to 8, digits "0abcdefgh9") and
rank (1 to 8).
where, of course, the digits `0` and `9` can never be needed for the file, because its range is constrained as `1 to 8`. But this is much clearer:
A chessboard square is a kind of value.
<file><rank> specifies a chessboard square with parts
file (values "a, b, c, d, e, f, g, h") and
rank (1 to 8).
The file part is automatically constrained as 1 to 8 because there are 8
notations in the text `"a, b, c, d, e, f, g, h"`.
The following little game works with any of the three definitions above:
{*}"Chess Fundamentals"
Capablanca's Dining Room is a room.
When play begins:
showme c4;
showme d7;
repeat with S running from a1 to h8:
say "[S] ";
say "...and that's all."
Square pressing is an action applying to one chessboard square.
Carry out square pressing: say "You press square [chessboard square understood]."
Understand "press [chessboard square]" as square pressing.
Test chess with "press a1 / press a0 / press h8 / press c3 / press i3".
Which all works as expected:
``` transcript
chessboard square: c4
chessboard square: d7
a1 a2 a3 a4 a5 a6 a7 a8 b1 b2 b3 b4 b5 b6 b7 b8 c1 c2 c3 c4 c5 c6 c7 c8
d1 d2 d3 d4 d5 d6 d7 d8 e1 e2 e3 e4 e5 e6 e7 e8 f1 f2 f3 f4 f5 f6 f7 f8
g1 g2 g3 g4 g5 g6 g7 g8 h1 h2 h3 h4 h5 h6 h7 h8 ...and that's all.
Capablanca's Dining Room
> PRESS A1
You press square a1.
> PRESS A0
You can't see any such thing.
> PRESS H8
You press square h8.
> PRESS C3
You press square c3.
> PRESS I3
You can't see any such thing.
```
The so-called English notation, which not even the English use any longer, would also be possible:
A chessboard square is a kind of value.
<file><rank> specifies a chessboard square with parts
file (values "QR, QN, QB, Q, K, KB, KN, KR") and
rank (1 to 8).
The trouble with this is that the square which White calls KB2 is the square Black calls KB7, and we cannot know who is asking.
## Parts corresponding to kinds
One last option available for parts of a specification is `corresponding to KIND`, which says that the part contains a value of the given `KIND`, which must be either numerical or an enumeration, rather than a `number`.
Let's return to chess notation. The best specification so far looks like this:
A chessboard square is a kind of value.
<file><rank> specifies a chessboard square with parts
file (values "a, b, c, d, e, f, g, h") and
rank (1 to 8).
With this specification, the two parts of a `chessboard square` value are each numbers from 1 to 8. For example, `rank part of e7` evaluates to the number 5.
That might be fine for performing calculations, but it's not the way chess players actually talk or write. Here is an alternative:
A chessboard file is a kind of value. The chessboard files are
the a-file, the b-file, the c-file, the d-file, the e-file, the f-file,
the g-file and the h-file.
A chessboard rank is a kind of value. The chessboard ranks are
the first rank, the second rank, the third rank, the fourth rank,
the fifth rank, the sixth rank, the seventh rank, the eighth rank.
A chessboard square is a kind of value.
<file><rank> specifies a chessboard square with parts
file (values "a, b, c, d, e, f, g, h",
corresponding to chessboard files) and
rank (1 to 8, corresponding to chessboard ranks).
We now find that, for example:
"chessboard square with file part the d-file rank part the sixth rank" = chessboard square: d6
"rank part of e7" = chessboard rank: seventh rank
What `corresponding to K`, where `K` is a kind, does is to tell Inform that
the numerical value internally stored to represent the meaning of a part should
be treated as a value of kind `K`. By default, `K` is `number`.
`K` can be set to any numerical kind, or to any enumeration with the right number of instances. `chessboard rank` above has 8 instances, which matches the range of 8 possible values for `rank`: if these numbers had not matched, a problem message would have been issued.
If `K` uses real arithmetic then automatic floating and rounding are used in order to convert from or to a whole-number part. Consider this example, which sneakily contains only a single part:
The GR10 is a room.
Distance is a kind of value. 1.0km specifies a distance.
A trail position is a kind of value. Kilometer 2000 specifies a trail position with parts depth (corresponding to distance).
When play begins:
showme Kilometer 230;
showme the depth part of Kilometer 230;
showme the trail position with depth part 67.51;
This produces:
``` transcript
trail position: Kilometer 230
"depth part of Kilometer 230" = distance: 230.0km
"trail position with depth part 67.51km" = trail position: Kilometer 68
```
Note that `67.51km` was rounded here to the nearest `number` value, 68.
## Counting and repeating through specified values
The final version of `chessboard square` which we reached was this:
A chessboard file is a kind of value. The chessboard files are
the a-file, the b-file, the c-file, the d-file, the e-file, the f-file,
the g-file and the h-file.
A chessboard rank is a kind of value. The chessboard ranks are
the first rank, the second rank, the third rank, the fourth rank,
the fifth rank, the sixth rank, the seventh rank, the eighth rank.
A chessboard square is a kind of value.
<file><rank> specifies a chessboard square with parts
file (values "a, b, c, d, e, f, g, h",
corresponding to chessboard files) and
rank (1 to 8, corresponding to chessboard ranks).
Something interesting to note about `chessboard square` is that its range of possible values is not unlimited. With only 8 possible files and 8 possible ranks, there are just 64 possible values. This contrasts with a specification like:
A monetary value is a kind of value. $1.99 specifies a monetary value with parts dollars and cents.
where the range is for practical purposes unlimited — well, in fact, `$21474836.47` is really the limit, but this is not an everyday amount to find in one's pocket. There are over two billion values, and it would be completely impractical to `repeat with M running through monetary values`. Inform will throw a problem message if we try.
But Inform _will_ allow us to repeat through `chessboard square` values, count them, take random values, and so on. Thus:
``` transcript
"number of chessboard squares" = number: 64
"list of chessboard squares" = list of chessboard squares: {a1, a2, a3, a4,
a5, a6, a7, a8, b1, b2, b3, b4, b5, b6, b7, b8, c1, c2, c3, c4, c5, c6, c7,
c8, d1, d2, d3, d4, d5, d6, d7, d8, e1, e2, e3, e4, e5, e6, e7, e8, f1, f2,
f3, f4, f5, f6, f7, f8, g1, g2, g3, g4, g5, g6, g7, g8, h1, h2, h3, h4, h5,
h6, h7, h8}
"a random chessboard square" = chessboard square: c7
```
Loops such as `repeat with S running through chessboard squares` are now possible, as are implicit loops which involve searching through values to look for matches against conditions. For example, given:
Definition: a chessboard square is white rather than black:
let F be the file part of it;
let file parity be whether or not F is the a-file or F is the c-file or F is the e-file or F is the g-file;
let R be the rank part of it;
let rank parity be whether or not R is the first rank or R is the third rank or R is the fifth rank or R is the seventh rank;
if file parity is rank parity, no;
yes.
...we can write, for example, `number of white chessboard squares`, which will of course calculate out to 32.
# Tables
## Laying out tables {TABLES} {PM_TableCoincidesWithKind} {PM_TableColumnEmptyLists} {PM_TablePlayerEntry} {PM_TableVariableEntry} {PM_TableDescriptionEntry} {PM_TableUnknownEntry} {PM_TableIncompatibleEntry} {PM_TableMisnamed} {PM_TableNameDuplicate} {PM_TableNameAmbiguous} {PM_TableTooManyColumns} {PM_TableColumnArticle} {PM_TableColumnAlready} {PM_TableWithoutRows} {PM_TableUndefined} {PM_TableOfQuantifiedKind} {PM_TableOfBuiltInKind} {PM_TableOfExistingKind} {PM_TableDefiningObject} {PM_TableWithBlankNames} {PM_TableEntryGeneric} {PM_TableKindlessColumn} {PM_TableColumnBrackets} {PM_TableRowFull}