Uppercase by Climbing Stars begins here. Include Text Capture by Eric Eve. Include (- [ Banner; BeginActivity(PRINTING_BANNER_TEXT_ACT); if (ForActivity(PRINTING_BANNER_TEXT_ACT) == false) { VM_Style(HEADER_VMSTY); print (string) Story; VM_Style(NORMAL_VMSTY); new_line; print (string) Headline; #ifdef Story_Author; print " BY ", (string) Story_Author; #endif; ! Story_Author new_line; VM_Describe_Release(); print " / INFORM 7 BUILD ", (string) NI_BUILD_COUNT, " "; print "(I6/V"; inversion; print " LIB ", (string) LibRelease, ") "; #Ifdef STRICT_MODE; print "S"; #Endif; ! STRICT_MODE #Ifdef DEBUG; print "D"; #Endif; ! DEBUG new_line; } EndActivity(PRINTING_BANNER_TEXT_ACT); ]; -) instead of "Banner" in "Printing.i6t". Include (- [ VM_Describe_Release i; print "RELEASE ", (HDR_GAMERELEASE-->0) & $03ff, " / SERIAL NUMBER "; for (i=0 : i<6 : i++) print (char) HDR_GAMESERIAL->i; ]; -) instead of "Release Number" in "ZMachine.i6t". Include (- [ VM_Describe_Release i; print "RELEASE "; @aloads ROM_GAMERELEASE 0 i; print i; print " / SERIAL NUMBER "; for (i=0 : i<6 : i++) print (char) ROM_GAMESERIAL->i; ]; -) instead of "Release Number" in "Glulx.i6t". Include (- Array LanguageNumbers table 'ONE' 1 'TWO' 2 'THREE' 3 'FOUR' 4 'FIVE' 5 'SIX' 6 'SEVEN' 7 'EIGHT' 8 'NINE' 9 'TEN' 10 'ELEVEN' 11 'TWELVE' 12 'THIRTEEN' 13 'FOURTEEN' 14 'FIFTEEN' 15 'SIXTEEN' 16 'SEVENTEEN' 17 'EIGHTEEN' 18 'NINETEEN' 19 'TWENTY' 20 'TWENTY-ONE' 21 'TWENTY-TWO' 22 'TWENTY-THREE' 23 'TWENTY-FOUR' 24 'TWENTY-FIVE' 25 'TWENTY-SIX' 26 'TWENTY-SEVEN' 27 'TWENTY-EIGHT' 28 'TWENTY-NINE' 29 'THIRTY' 30 ; [ LanguageNumber n f; if (n == 0) { print "ZERO"; rfalse; } if (n < 0) { print "MINUS "; n = -n; } #Iftrue (WORDSIZE == 4); if (n >= 1000000000) { if (f == 1) print ", "; print (LanguageNumber) n/1000000000, " BILLION"; n = n%1000000000; f = 1; } if (n >= 1000000) { if (f == 1) print ", "; print (LanguageNumber) n/1000000, " MILLION"; n = n%1000000; f = 1; } #Endif; if (n >= 1000) { if (f == 1) print ", "; print (LanguageNumber) n/1000, " THOUSAND"; n = n%1000; f = 1; } if (n >= 100) { if (f == 1) print ", "; print (LanguageNumber) n/100, " HUNDRED"; n = n%100; f = 1; } if (n == 0) rfalse; #Ifdef DIALECT_US; if (f == 1) print " "; #Ifnot; if (f == 1) print " AND "; #Endif; switch (n) { 1: print "ONE"; 2: print "TWO"; 3: print "THREE"; 4: print "FOUR"; 5: print "FIVE"; 6: print "SIX"; 7: print "SEVEN"; 8: print "EIGHT"; 9: print "NINE"; 10: print "TEN"; 11: print "ELEVEN"; 12: print "TWELVE"; 13: print "THIRTEEN"; 14: print "FOURTEEN"; 15: print "FIFTEEN"; 16: print "SIXTEEN"; 17: print "SEVENTEEN"; 18: print "EIGHTEEN"; 19: print "NINETEEN"; 20 to 99: switch (n/10) { 2: print "TWENTY"; 3: print "THIRTY"; 4: print "FORTY"; 5: print "FIFTY"; 6: print "SIXTY"; 7: print "SEVENTY"; 8: print "EIGHTY"; 9: print "NINETY"; } if (n%10 ~= 0) print "-", (LanguageNumber) n%10; } ]; -) instead of "Articles" in "Language.i6t". Include (- [ LanguageTimeOfDay hours mins i; i = hours%12; if (i == 0) i = 12; if (i < 10) print " "; print i, ":", mins/10, mins%10; if ((hours/12) > 0) print " PM"; else print " AM"; ]; -) instead of "Time" in "Language.i6t". Include (- Constant LanguageAnimateGender = male; Constant LanguageInanimateGender = neuter; Constant LanguageContractionForms = 2; ! English has two: ! 0 = starting with a consonant ! 1 = starting with a vowel [ LanguageContraction text; if (text->0 == 'a' or 'e' or 'i' or 'o' or 'u' or 'A' or 'E' or 'I' or 'O' or 'U') return 1; return 0; ]; Array LanguageArticles --> ! Contraction form 0: Contraction form 1: ! Cdef Def Indef Cdef Def Indef "THE " "THE " "A " "THE " "THE " "AN " ! Articles 0 "THE " "THE " "SOME " "THE " "THE " "SOME "; ! Articles 1 ! a i ! s p s p ! m f n m f n m f n m f n Array LanguageGNAsToArticles --> 0 0 0 1 1 1 0 0 0 1 1 1; -) instead of "Articles" in "Language.i6t". Include (- Constant NKEY__TX = "N = NEXT SUBJECT"; Constant PKEY__TX = "P = PREVIOUS"; Constant QKEY1__TX = " Q = RESUME GAME"; Constant QKEY2__TX = "Q = PREVIOUS MENU"; Constant RKEY__TX = "RETURN = READ SUBJECT"; Constant NKEY1__KY = 'N'; Constant NKEY2__KY = 'n'; Constant PKEY1__KY = 'P'; Constant PKEY2__KY = 'p'; Constant QKEY1__KY = 'Q'; Constant QKEY2__KY = 'q'; Constant SCORE__TX = "SCORE: "; Constant MOVES__TX = "MOVES: "; Constant TIME__TX = "TIME: "; Global CANTGO__TX = "YOU CAN'T GO THAT WAY."; Global FORMER__TX = "YOUR FORMER SELF"; Global YOURSELF__TX = "YOURSELF"; Constant YOU__TX = "YOU"; Constant DARKNESS__TX = "DARKNESS"; Constant THOSET__TX = "THOSE THINGS"; Constant THAT__TX = "THAT"; Constant OR__TX = " OR "; Constant NOTHING__TX = "NOTHING"; Constant NOTHING2__TX = "NOTHING"; Global IS__TX = " IS"; Global ARE__TX = " ARE"; Global IS2__TX = "IS "; Global ARE2__TX = "ARE "; Global IS3__TX = "IS"; Global ARE3__TX = "ARE"; Constant AND__TX = " AND "; #ifdef SERIAL_COMMA; Constant LISTAND__TX = ", AND "; Constant LISTAND2__TX = " AND "; #ifnot; Constant LISTAND__TX = " AND "; Constant LISTAND2__TX = " AND "; #endif; ! SERIAL_COMMA Constant WHOM__TX = "WHOM "; Constant WHICH__TX = "WHICH "; Constant COMMA__TX = ", "; -) instead of "Short Texts" in "Language.i6t". Include (- [ ThatorThose obj; ! Used in the accusative if (obj == player) { print "YOU"; return; } if (obj has pluralname) { print "THOSE"; return; } if (obj has animate) { if (obj has female) { print "HER"; return; } else if (obj hasnt neuter) { print "HIM"; return; } } print "THAT"; ]; [ ItorThem obj; if (obj == player) { print "YOURSELF"; return; } if (obj has pluralname) { print "THEM"; return; } if (obj has animate) { if (obj has female) { print "HER"; return; } else if (obj hasnt neuter) { print "HIM"; return; } } print "IT"; ]; [ IsorAre obj; if (obj has pluralname || obj == player) print "ARE"; else print "IS"; ]; [ HasorHave obj; if (obj has pluralname || obj == player) print "HAVE"; else print "HAS"; ]; [ CThatorThose obj; ! Used in the nominative if (obj == player) { print "YOU"; return; } if (obj has pluralname) { print "THOSE"; return; } if (obj has animate) { if (obj has female) { print "SHE"; return; } else if (obj hasnt neuter) { print "HE"; return; } } print "THAT"; ]; [ CTheyreorThats obj; if (obj == player) { print "YOU'RE"; return; } if (obj has pluralname) { print "THEY'RE"; return; } if (obj has animate) { if (obj has female) { print "SHE'S"; return; } else if (obj hasnt neuter) { print "HE'S"; return; } } print "THAT'S"; ]; [ HisHerTheir o; if (o has pluralname) { print "THEIR"; return; } if (o has female) { print "HER"; return; } if (o has neuter) { print "ITS"; return; } print "HIS"; ]; [ HimHerItself o; if (o has pluralname) { print "THEIRSELVES"; return; } if (o has female) { print "HERSELF"; return; } if (o has neuter) { print "ITSELF"; return; } print "HIMSELF"; ]; -) instead of "Printed Inflections" in "Language.i6t". Include (- [ LanguageLM n x1 x2; say__p = 1; Answer,Ask: "THERE IS NO REPLY."; ! Ask: see Answer Attack: "VIOLENCE ISN'T THE ANSWER TO THIS ONE."; Burn: "THIS DANGEROUS ACT WOULD ACHIEVE LITTLE."; Buy: "NOTHING IS ON SALE."; Climb: "I DON'T THINK MUCH IS TO BE ACHIEVED BY THAT."; Close: switch (n) { 1: print_ret (ctheyreorthats) x1, " NOT SOMETHING YOU CAN CLOSE."; 2: print_ret (ctheyreorthats) x1, " ALREADY CLOSED."; 3: "YOU CLOSE ", (the) x1, "."; 4: print (The) actor, " CLOSES ", (the) x1, ".^"; 5: print (The) x1, " CLOSE"; if (x1 hasnt pluralname) print "S"; print ".^"; } Consult: switch (n) { 1: "YOU DISCOVER NOTHING OF INTEREST IN ", (the) x1, "."; 2: print (The) actor, " LOOKS AT ", (the) x1, ".^"; } Cut: "CUTTING ", (thatorthose) x1, " UP WOULD ACHIEVE LITTLE."; Disrobe: switch (n) { 1: "YOU'RE NOT WEARING ", (thatorthose) x1, "."; 2: "YOU TAKE OFF ", (the) x1, "."; 3: print (The) actor, " TAKES OFF ", (the) x1, ".^"; } Drink: "THERE'S NOTHING SUITABLE TO DRINK HERE."; Drop: switch (n) { 1: if (x1 has pluralname) print (The) x1, " ARE "; else print (The) x1, " IS "; "ALREADY HERE."; 2: "YOU HAVEN'T GOT ", (thatorthose) x1, "."; 3: print "(FIRST TAKING ", (the) x1, " OFF)^"; say__p = 0; return; 4: "DROPPED."; 5: "THERE IS NO MORE ROOM ON ", (the) x1, "."; 6: "THERE IS NO MORE ROOM IN ", (the) x1, "."; 7: print (The) actor, " PUTS DOWN ", (the) x1, ".^"; } Eat: switch (n) { 1: print_ret (ctheyreorthats) x1, " PLAINLY INEDIBLE."; 2: "YOU EAT ", (the) x1, ". NOT BAD."; 3: print (The) actor, " EATS ", (the) x1, ".^"; } Enter: switch (n) { 1: print "BUT YOU'RE ALREADY "; if (x1 has supporter) print "ON "; else print "IN "; print_ret (the) x1, "."; 2: if (x1 has pluralname) print "THEY'RE"; else print "THAT'S"; print " NOT SOMETHING YOU CAN "; switch (verb_word) { 'stand': "STAND ON."; 'sit': "SIT DOWN ON."; 'lie': "LIE DOWN ON."; default: "ENTER."; } 3: "YOU CAN'T GET INTO THE CLOSED ", (name) x1, "."; 4: "YOU CAN ONLY GET INTO SOMETHING FREE-STANDING."; 5: print "YOU GET "; if (x1 has supporter) print "ONTO "; else print "INTO "; print_ret (the) x1, "."; 6: print "(GETTING "; if (x1 has supporter) print "OFF "; else print "OUT OF "; print (the) x1; print ")^"; say__p = 0; return; 7: ! say__p = 0; if (x1 has supporter) "(GETTING ONTO ", (the) x1, ")"; if (x1 has container) "(GETTING INTO ", (the) x1, ")"; "(ENTERING ", (the) x1, ")"; 8: print (The) actor, " GETS INTO ", (the) x1, ".^"; 9: print (The) actor, " GETS ONTO ", (the) x1, ".^"; } Examine: switch (n) { 1: "DARKNESS, NOUN. AN ABSENCE OF LIGHT TO SEE BY."; 2: "YOU SEE NOTHING SPECIAL ABOUT ", (the) x1, "."; 3: print (The) x1, " ", (isorare) x1, " CURRENTLY SWITCHED "; if (x1 has on) "ON."; else "OFF."; 4: print (The) actor, " LOOKS CLOSELY AT ", (the) x1, ".^"; 5: "YOU SEE NOTHING UNEXPECTED IN THAT DIRECTION."; } Exit: switch (n) { 1: "BUT YOU AREN'T IN ANYTHING AT THE MOMENT."; 2: "YOU CAN'T GET OUT OF THE CLOSED ", (name) x1, "."; 3: print "YOU GET "; if (x1 has supporter) print "OFF "; else print "OUT OF "; print_ret (the) x1, "."; 4: print "BUT YOU AREN'T "; if (x1 has supporter) print "ON "; else print "IN "; print_ret (the) x1, "."; 5: print (The) actor, " GETS OFF ", (the) x1, ".^"; 6: print (The) actor, " GETS OUT OF ", (the) x1, ".^"; } GetOff: "BUT YOU AREN'T ON ", (the) x1, " AT THE MOMENT."; Give: switch (n) { 1: "YOU AREN'T HOLDING ", (the) x1, "."; 2: "YOU JUGGLE ", (the) x1, " FOR A WHILE, BUT DON'T ACHIEVE MUCH."; 3: print (The) x1; if (x1 has pluralname) print " DON'T"; else print " DOESN'T"; " SEEM INTERESTED."; 4: print (The) x1; if (x1 has pluralname) print " AREN'T"; else print " ISN'T"; " ABLE TO RECEIVE THINGS."; 5: "YOU GIVE ", (the) x1, " TO ", (the) second, "."; 6: print (The) actor, " GIVES ", (the) x1, " TO YOU.^"; 7: print (The) actor, " GIVES ", (the) x1, " TO ", (the) second, ".^"; } Go: switch (n) { 1: print "YOU'LL HAVE TO GET "; if (x1 has supporter) print "OFF "; else print "OUT OF "; print_ret (the) x1, " FIRST."; 2: print_ret (string) CANTGO__TX; ! "YOU CAN'T GO THAT WAY." 6: print "YOU CAN'T, SINCE ", (the) x1; if (x1 has pluralname) " LEAD NOWHERE."; else " LEADS NOWHERE."; 7: "YOU'LL HAVE TO SAY WHICH COMPASS DIRECTION TO GO IN."; 8: print (The) actor, " GOES UP"; 9: print (The) actor, " GOES DOWN"; 10: print (The) actor, " GOES ", (name) x1; 11: print (The) actor, " ARRIVES FROM ABOVE"; 12: print (The) actor, " ARRIVES FROM BELOW"; 13: print (The) actor, " ARRIVES FROM THE ", (name) x1; 14: print (The) actor, " ARRIVES"; 15: print (The) actor, " ARRIVES AT ", (the) x1, " FROM ABOVE"; 16: print (The) actor, " ARRIVES AT ", (the) x1, " FROM BELOW"; 17: print (The) actor, " ARRIVES AT ", (the) x1, " FROM THE ", (name) x2; 18: print (The) actor, " GOES THROUGH ", (the) x1; 19: print (The) actor, " ARRIVES FROM ", (the) x1; 20: print "ON ", (the) x1; 21: print "IN ", (the) x1; 22: print ", PUSHING ", (the) x1, " IN FRONT, AND YOU ALONG TOO"; 23: print ", PUSHING ", (the) x1, " IN FRONT"; 24: print ", PUSHING ", (the) x1, " AWAY"; 25: print ", PUSHING ", (the) x1, " IN"; 26: print ", TAKING YOU ALONG"; 27: print "(FIRST GETTING OFF ", (the) x1, ")^"; say__p = 0; return; 28: print "(FIRST OPENING ", (the) x1, ")^"; say__p = 0; return; } Insert: switch (n) { 1: "YOU NEED TO BE HOLDING ", (the) x1, " BEFORE YOU CAN PUT ", (itorthem) x1, " INTO SOMETHING ELSE."; 2: print_ret (Cthatorthose) x1, " CAN'T CONTAIN THINGS."; 3: print_ret (The) x1, " ", (isorare) x1, " CLOSED."; 4: "YOU'LL NEED TO TAKE ", (itorthem) x1, " OFF FIRST."; 5: "YOU CAN'T PUT SOMETHING INSIDE ITSELF."; 6: print "(FIRST TAKING ", (itorthem) x1, " OFF)^"; say__p = 0; return; 7: "THERE IS NO MORE ROOM IN ", (the) x1, "."; 8: "DONE."; 9: "YOU PUT ", (the) x1, " INTO ", (the) second, "."; 10: print (The) actor, " PUTS ", (the) x1, " INTO ", (the) second, ".^"; } Inv: switch (n) { 1: "YOU ARE CARRYING NOTHING."; 2: print "YOU ARE CARRYING"; 3: print ":^"; 4: print ".^"; 5: print (The) x1, " LOOKS THROUGH ", (HisHerTheir) x1, " POSSESSIONS.^"; } Jump: "YOU JUMP ON THE SPOT, FRUITLESSLY."; Kiss: "KEEP YOUR MIND ON THE GAME."; Listen: "YOU HEAR NOTHING UNEXPECTED."; ListMiscellany: switch (n) { 1: print " (PROVIDING LIGHT)"; 2: print " (CLOSED)"; 4: print " (EMPTY)"; 6: print " (CLOSED AND EMPTY)"; 3: print " (CLOSED AND PROVIDING LIGHT)"; 5: print " (EMPTY AND PROVIDING LIGHT)"; 7: #ifdef SERIAL_COMMA; print " (CLOSED, EMPTY, AND PROVIDING LIGHT)"; #ifnot; print " (CLOSED, EMPTY AND PROVIDING LIGHT)"; #endif; 8: print " (PROVIDING LIGHT AND BEING WORN"; 9: print " (PROVIDING LIGHT"; 10: print " (BEING WORN"; 11: print " ("; 12: print "OPEN"; 13: print "OPEN BUT EMPTY"; 14: print "CLOSED"; 15: print "CLOSED AND LOCKED"; 16: print " AND EMPTY"; 17: print " (EMPTY)"; 18: print " CONTAINING "; 19: print " (ON "; 20: print ", ON TOP OF "; 21: print " (IN "; 22: print ", INSIDE "; } LMode1: " IS NOW IN ITS ~BRIEF~ PRINTING MODE, WHICH GIVES LONG DESCRIPTIONS OF PLACES NEVER BEFORE VISITED AND SHORT DESCRIPTIONS OTHERWISE."; LMode2: " IS NOW IN ITS ~VERBOSE~ MODE, WHICH ALWAYS GIVES LONG DESCRIPTIONS OF LOCATIONS (EVEN IF YOU'VE BEEN THERE BEFORE)."; LMode3: " IS NOW IN ITS ~SUPERBRIEF~ MODE, WHICH ALWAYS GIVES SHORT DESCRIPTIONS OF LOCATIONS (EVEN IF YOU HAVEN'T BEEN THERE BEFORE)."; Lock: switch (n) { 1: if (x1 has pluralname) print "THEY DON'T "; else print "THAT DOESN'T "; "SEEM TO BE SOMETHING YOU CAN LOCK."; 2: print_ret (ctheyreorthats) x1, " LOCKED AT THE MOMENT."; 3: "FIRST YOU'LL HAVE TO CLOSE ", (the) x1, "."; 4: if (x1 has pluralname) print "THOSE DON'T "; else print "THAT DOESN'T "; "SEEM TO FIT THE LOCK."; 5: "YOU LOCK ", (the) x1, "."; 6: print (The) actor, " LOCKS ", (the) x1, ".^"; } Look: switch (n) { 1: print " (ON ", (the) x1, ")"; 2: print " (IN ", (the) x1, ")"; 3: print " (AS ", (object) x1, ")"; 4: print "ON ", (the) x1, " "; WriteListFrom(child(x1), ENGLISH_BIT+RECURSE_BIT+PARTINV_BIT+TERSE_BIT+CONCEAL_BIT+ISARE_BIT); "."; 5,6: if (x1 ~= location) { if (x1 has supporter) print "ON "; else print "IN "; print (the) x1, " YOU"; } else print "YOU"; print " CAN "; if (n == 5) print "ALSO "; print "SEE "; WriteListFrom(child(x1), ENGLISH_BIT+RECURSE_BIT+PARTINV_BIT+TERSE_BIT+CONCEAL_BIT+WORKFLAG_BIT); if (x1 ~= location) "."; else " HERE."; 7: "YOU SEE NOTHING UNEXPECTED IN THAT DIRECTION."; 8: if (x1 has supporter) print " (ON "; else print " (IN "; print (the) x1, ")"; 9: print (The) actor, " LOOKS AROUND.^"; } LookUnder: switch (n) { 1: "BUT IT'S DARK."; 2: "YOU FIND NOTHING OF INTEREST."; 3: print (The) actor, " LOOKS UNDER ", (the) x1, ".^"; } Mild: "QUITE."; Miscellany: switch (n) { 1: "(CONSIDERING THE FIRST SIXTEEN OBJECTS ONLY)^"; 2: "NOTHING TO DO!"; 3: print " YOU HAVE DIED "; 4: print " YOU HAVE WON "; 5: print "^WOULD YOU LIKE TO RESTART, RESTORE A SAVED GAME"; #Ifdef DEATH_MENTION_UNDO; print ", UNDO YOUR LAST MOVE"; #Endif; #ifdef SERIAL_COMMA; print ","; #endif; " OR QUIT?"; 6: "[YOUR INTERPRETER DOES NOT PROVIDE ~UNDO~. SORRY!]"; #Ifdef TARGET_ZCODE; 7: "~UNDO~ FAILED. [NOT ALL INTERPRETERS PROVIDE IT.]"; #Ifnot; ! TARGET_GLULX 7: "[YOU CANNOT ~UNDO~ ANY FURTHER.]"; #Endif; ! TARGET_ 8: "PLEASE GIVE ONE OF THE ANSWERS ABOVE."; 9: "IT IS NOW PITCH DARK IN HERE!"; 10: "I BEG YOUR PARDON?"; 11: "[YOU CAN'T ~UNDO~ WHAT HASN'T BEEN DONE!]"; 12: "[CAN'T ~UNDO~ TWICE IN SUCCESSION. SORRY!]"; 13: "[PREVIOUS TURN UNDONE.]"; 14: "SORRY, THAT CAN'T BE CORRECTED."; 15: "THINK NOTHING OF IT."; 16: "~OOPS~ CAN ONLY CORRECT A SINGLE WORD."; 17: "IT IS PITCH DARK, AND YOU CAN'T SEE A THING."; 18: print "YOURSELF"; 19: "AS GOOD-LOOKING AS EVER."; 20: "TO REPEAT A COMMAND LIKE ~FROG, JUMP~, JUST SAY ~AGAIN~, NOT ~FROG, AGAIN~."; 21: "YOU CAN HARDLY REPEAT THAT."; 22: "YOU CAN'T BEGIN WITH A COMMA."; 23: "YOU SEEM TO WANT TO TALK TO SOMEONE, BUT I CAN'T SEE WHOM."; 24: "YOU CAN'T TALK TO ", (the) x1, "."; 25: "TO TALK TO SOMEONE, TRY ~SOMEONE, HELLO~ OR SOME SUCH."; 26: "(FIRST TAKING ", (the) x1, ")"; 27: "I DIDN'T UNDERSTAND THAT SENTENCE."; 28: print "I ONLY UNDERSTOOD YOU AS FAR AS WANTING TO "; 29: "I DIDN'T UNDERSTAND THAT NUMBER."; 30: "YOU CAN'T SEE ANY SUCH THING."; 31: "YOU SEEM TO HAVE SAID TOO LITTLE!"; 32: "YOU AREN'T HOLDING THAT!"; 33: "YOU CAN'T USE MULTIPLE OBJECTS WITH THAT VERB."; 34: "YOU CAN ONLY USE MULTIPLE OBJECTS ONCE ON A LINE."; 35: "I'M NOT SURE WHAT ~", pronoun_word, "~ REFERS TO."; 36: "YOU EXCEPTED SOMETHING NOT INCLUDED ANYWAY!"; 37: "YOU CAN ONLY DO THAT TO SOMETHING ANIMATE."; #Ifdef DIALECT_US; 38: "THAT'S NOT A VERB I RECOGNIZE."; #Ifnot; 38: "THAT'S NOT A VERB I RECOGNISE."; #Endif; 39: "THAT'S NOT SOMETHING YOU NEED TO REFER TO IN THE COURSE OF THIS GAME."; 40: "YOU CAN'T SEE ~", pronoun_word, "~ (", (the) pronoun_obj, ") AT THE MOMENT."; 41: "I DIDN'T UNDERSTAND THE WAY THAT FINISHED."; 42: if (x1 == 0) print "NONE"; else print "ONLY ", (number) x1; print " OF THOSE "; if (x1 == 1) print "IS"; else print "ARE"; " AVAILABLE."; 43: "NOTHING TO DO!"; 44: "THERE ARE NONE AT ALL AVAILABLE!"; 45: print "WHO DO YOU MEAN, "; 46: print "WHICH DO YOU MEAN, "; 47: "SORRY, YOU CAN ONLY HAVE ONE ITEM HERE. WHICH EXACTLY?"; 48: print "WHOM DO YOU WANT"; if (actor ~= player) print " ", (the) actor; print " TO "; PrintCommand(); print "?^"; 49: print "WHAT DO YOU WANT"; if (actor ~= player) print " ", (the) actor; print " TO "; PrintCommand(); print "?^"; 50: print "YOUR SCORE HAS JUST GONE "; if (x1 > 0) print "UP"; else { x1 = -x1; print "DOWN"; } print " BY ", (number) x1, " POINT"; if (x1 > 1) print "S"; 51: "(SINCE SOMETHING DRAMATIC HAS HAPPENED, YOUR LIST OF COMMANDS HAS BEEN CUT SHORT.)"; 52: "^TYPE A NUMBER FROM 1 TO ", x1, ", 0 TO REDISPLAY OR PRESS ENTER."; 53: "^[PLEASE PRESS SPACE.]"; 54: "[COMMENT RECORDED.]"; 55: "[COMMENT NOT RECORDED.]"; 56: print ".^"; 57: print "?^"; 58: print (The) actor, " ", (IsOrAre) actor, " UNABLE TO DO THAT.^"; 59: "YOU MUST SUPPLY A NOUN."; 60: "YOU MAY NOT SUPPLY A NOUN."; 61: "YOU MUST NAME AN OBJECT."; 62: "YOU MAY NOT NAME AN OBJECT."; 63: "YOU MUST NAME A SECOND OBJECT."; 64: "YOU MAY NOT NAME A SECOND OBJECT."; 65: "YOU MUST SUPPLY A SECOND NOUN."; 66: "YOU MAY NOT SUPPLY A SECOND NOUN."; 67: "YOU MUST NAME SOMETHING MORE SUBSTANTIAL."; 68: print "(", (The) actor, " FIRST TAKING ", (the) x1, ")^"; 69: "(FIRST TAKING ", (the) x1, ")"; 70: "THE USE OF UNDO IS FORBIDDEN IN THIS GAME."; 71: print (string) DARKNESS__TX; 72: print (The) x1; if (x1 has pluralname) print " HAVE"; else print " HAS"; " BETTER THINGS TO DO."; 73: "THAT NOUN DID NOT MAKE SENSE IN THIS CONTEXT."; 74: print "[THAT COMMAND ASKS TO DO SOMETHING OUTSIDE OF PLAY, SO IT CAN ONLY MAKE SENSE FROM YOU TO ME. ", (The) x1, " CANNOT BE ASKED TO DO THIS.]^"; 75: print " THE END "; } No,Yes: "THAT WAS A RHETORICAL QUESTION."; NotifyOff: "SCORE NOTIFICATION OFF."; NotifyOn: "SCORE NOTIFICATION ON."; Open: switch (n) { 1: print_ret (ctheyreorthats) x1, " NOT SOMETHING YOU CAN OPEN."; 2: if (x1 has pluralname) print "THEY SEEM "; else print "IT SEEMS "; "TO BE LOCKED."; 3: print_ret (ctheyreorthats) x1, " ALREADY OPEN."; 4: print "YOU OPEN ", (the) x1, ", REVEALING "; if (WriteListFrom(child(x1), ENGLISH_BIT+TERSE_BIT+CONCEAL_BIT) == 0) "NOTHING."; "."; 5: "YOU OPEN ", (the) x1, "."; 6: print (The) actor, " OPENS ", (the) x1, ".^"; 7: print (The) x1, " OPEN"; if (x1 hasnt pluralname) print "S"; print ".^"; } Pronouns: switch (n) { 1: print "AT THE MOMENT, "; 2: print "MEANS "; 3: print "IS UNSET"; 4: "NO PRONOUNS ARE KNOWN TO THE GAME."; 5: "."; } Pull,Push,Turn: switch (n) { 1: if (x1 has pluralname) print "THOSE ARE "; else print "IT IS "; "FIXED IN PLACE."; 2: "YOU ARE UNABLE TO."; 3: "NOTHING OBVIOUS HAPPENS."; 4: "THAT WOULD BE LESS THAN COURTEOUS."; 5: print (The) actor, " PULLS ", (the) x1, ".^"; 6: print (The) actor, " PUSHES ", (the) x1, ".^"; 7: print (The) actor, " TURNS ", (the) x1, ".^"; } ! Push: see Pull PushDir: switch (n) { 1: print (The) x1, " CANNOT BE PUSHED FROM PLACE TO PLACE.^"; 2: "THAT'S NOT A DIRECTION."; 3: "NOT THAT WAY YOU CAN'T."; } PutOn: switch (n) { 1: "YOU NEED TO BE HOLDING ", (the) x1, " BEFORE YOU CAN PUT ", (itorthem) x1, " ON TOP OF SOMETHING ELSE."; 2: "YOU CAN'T PUT SOMETHING ON TOP OF ITSELF."; 3: "PUTTING THINGS ON ", (the) x1, " WOULD ACHIEVE NOTHING."; 4: "YOU LACK THE DEXTERITY."; 5: print "(FIRST TAKING ", (itorthem) x1, " OFF)^"; say__p = 0; return; 6: "THERE IS NO MORE ROOM ON ", (the) x1, "."; 7: "DONE."; 8: "YOU PUT ", (the) x1, " ON ", (the) second, "."; 9: print (The) actor, " PUTS ", (the) x1, " ON ", (the) second, ".^"; } Quit: switch (n) { 1: print "PLEASE ANSWER YES OR NO."; 2: print "ARE YOU SURE YOU WANT TO QUIT? "; } Remove: switch (n) { 1: if (x1 has pluralname) print "THEY ARE"; else print "IT IS"; " UNFORTUNATELY CLOSED."; 2: if (x1 has pluralname) print "BUT THEY AREN'T"; else print "BUT IT ISN'T"; " THERE NOW."; 3: "REMOVED."; } Restart: switch (n) { 1: print "ARE YOU SURE YOU WANT TO RESTART? "; 2: "FAILED."; } Restore: switch (n) { 1: "RESTORE FAILED."; 2: "OK."; } Rub: "YOU ACHIEVE NOTHING BY THIS."; Save: switch (n) { 1: "SAVE FAILED."; 2: "OK."; } Score: switch (n) { 1: if (deadflag) print "IN THAT GAME YOU SCORED "; else print "YOU HAVE SO FAR SCORED "; print score, " OUT OF A POSSIBLE ", MAX_SCORE, ", IN ", turns, " TURN"; if (turns ~= 1) print "S"; return; 2: "THERE IS NO SCORE IN THIS STORY."; 3: print ", EARNING YOU THE RANK OF "; } ScriptOff: switch (n) { 1: "TRANSCRIPTING IS ALREADY OFF."; 2: "^END OF TRANSCRIPT."; 3: "ATTEMPT TO END TRANSCRIPT FAILED."; } ScriptOn: switch (n) { 1: "TRANSCRIPTING IS ALREADY ON."; 2: "START OF A TRANSCRIPT OF"; 3: "ATTEMPT TO BEGIN TRANSCRIPT FAILED."; } Search: switch (n) { 1: "BUT IT'S DARK."; 2: "THERE IS NOTHING ON ", (the) x1, "."; 3: print "ON ", (the) x1, " "; WriteListFrom(child(x1), ENGLISH_BIT+TERSE_BIT+CONCEAL_BIT+ISARE_BIT); "."; 4: "YOU FIND NOTHING OF INTEREST."; 5: "YOU CAN'T SEE INSIDE, SINCE ", (the) x1, " ", (isorare) x1, " CLOSED."; 6: print_ret (The) x1, " ", (isorare) x1, " EMPTY."; 7: print "IN ", (the) x1, " "; WriteListFrom(child(x1), ENGLISH_BIT+TERSE_BIT+CONCEAL_BIT+ISARE_BIT); "."; 8: print (The) actor, " SEARCHES ", (the) x1, ".^"; } SetTo: "NO, YOU CAN'T SET ", (thatorthose) x1, " TO ANYTHING."; Show: switch (n) { 1: "YOU AREN'T HOLDING ", (the) x1, "."; 2: print_ret (The) x1, " ", (isorare) x1, " UNIMPRESSED."; } Sing: "YOUR SINGING IS ABOMINABLE."; Sleep: "YOU AREN'T FEELING ESPECIALLY DROWSY."; Smell: "YOU SMELL NOTHING UNEXPECTED."; #Ifdef DIALECT_US; Sorry: "OH, DON'T APOLOGIZE."; #Ifnot; Sorry: "OH, DON'T APOLOGISE."; #Endif; Squeeze: switch (n) { 1: "KEEP YOUR HANDS TO YOURSELF."; 2: "YOU ACHIEVE NOTHING BY THIS."; 3: print (The) actor, " SQUEEZES ", (the) x1, ".^"; } Strong: "REAL ADVENTURERS DO NOT USE SUCH LANGUAGE."; Swing: "THERE'S NOTHING SENSIBLE TO SWING HERE."; SwitchOff: switch (n) { 1: print_ret (ctheyreorthats) x1, " NOT SOMETHING YOU CAN SWITCH."; 2: print_ret (ctheyreorthats) x1, " ALREADY OFF."; 3: "YOU SWITCH ", (the) x1, " OFF."; 4: print (The) actor, " SWITCHES ", (the) x1, " OFF.^"; } SwitchOn: switch (n) { 1: print_ret (ctheyreorthats) x1, " NOT SOMETHING YOU CAN SWITCH."; 2: print_ret (ctheyreorthats) x1, " ALREADY ON."; 3: "YOU SWITCH ", (the) x1, " ON."; 4: print (The) actor, " SWITCHES ", (the) x1, " ON.^"; } Take: switch (n) { 1: "TAKEN."; 2: "YOU ARE ALWAYS SELF-POSSESSED."; 3: "I DON'T SUPPOSE ", (the) x1, " WOULD CARE FOR THAT."; 4: print "YOU'D HAVE TO GET "; if (x1 has supporter) print "OFF "; else print "OUT OF "; print_ret (the) x1, " FIRST."; 5: "YOU ALREADY HAVE ", (thatorthose) x1, "."; 6: if (noun has pluralname) print "THOSE SEEM "; else print "THAT SEEMS "; "TO BELONG TO ", (the) x1, "."; 7: if (noun has pluralname) print "THOSE SEEM "; else print "THAT SEEMS "; "TO BE A PART OF ", (the) x1, "."; 8: print_ret (Cthatorthose) x1, " ", (isorare) x1, "N'T AVAILABLE."; 9: print_ret (The) x1, " ", (isorare) x1, "N'T OPEN."; 10: if (x1 has pluralname) print "THEY'RE "; else print "THAT'S "; "HARDLY PORTABLE."; 11: if (x1 has pluralname) print "THEY'RE "; else print "THAT'S "; "FIXED IN PLACE."; 12: "YOU'RE CARRYING TOO MANY THINGS ALREADY."; 13: print "(PUTTING ", (the) x1, " INTO ", (the) x2, " TO MAKE ROOM)^"; say__p = 0; return; 14: "YOU CAN'T REACH INTO ", (the) x1, "."; 15: "YOU CANNOT CARRY ", (the) x1, "."; 16: print (The) actor, " PICKS UP ", (the) x1, ".^"; } Taste: "YOU TASTE NOTHING UNEXPECTED."; Tell: switch (n) { 1: "YOU TALK TO YOURSELF A WHILE."; 2: "THIS PROVOKES NO REACTION."; } Think: "WHAT A GOOD IDEA."; ThrowAt: switch (n) { 1: "FUTILE."; 2: "YOU LACK THE NERVE WHEN IT COMES TO THE CRUCIAL MOMENT."; } Tie: "YOU WOULD ACHIEVE NOTHING BY THIS."; Touch: switch (n) { 1: "KEEP YOUR HANDS TO YOURSELF!"; 2: "YOU FEEL NOTHING UNEXPECTED."; 3: "IF YOU THINK THAT'LL HELP."; 4: print (The) actor, " TOUCHES ", (himheritself) x1, ".^"; 5: print (The) actor, " TOUCHES YOU.^"; 6: print (The) actor, " TOUCHES ", (the) x1, ".^"; } ! Turn: see Pull. Unlock: switch (n) { 1: if (x1 has pluralname) print "THEY DON'T "; else print "THAT DOESN'T "; "SEEM TO BE SOMETHING YOU CAN UNLOCK."; 2: print_ret (ctheyreorthats) x1, " UNLOCKED AT THE MOMENT."; 3: if (x1 has pluralname) print "THOSE DON'T "; else print "THAT DOESN'T "; "SEEM TO FIT THE LOCK."; 4: "YOU UNLOCK ", (the) x1, "."; 5: print (The) actor, " UNLOCKS ", (the) x1, ".^"; } Verify: switch (n) { 1: "THE GAME FILE HAS VERIFIED AS INTACT."; 2: "THE GAME FILE DID NOT VERIFY AS INTACT, AND MAY BE CORRUPT."; } Wait: switch (n) { 1: "TIME PASSES."; 2: print (The) actor, " WAITS.^"; } Wake: "THE DREADFUL TRUTH IS, THIS IS NOT A DREAM."; WakeOther:"THAT SEEMS UNNECESSARY."; Wave: switch (n) { 1: "BUT YOU AREN'T HOLDING ", (thatorthose) x1, "."; 2: "YOU LOOK RIDICULOUS WAVING ", (the) x1, "."; 3: print (The) actor, " WAVES ", (the) x1, ".^"; } WaveHands:"YOU WAVE, FEELING FOOLISH."; Wear: switch (n) { 1: "YOU CAN'T WEAR ", (thatorthose) x1, "!"; 2: "YOU'RE NOT HOLDING ", (thatorthose) x1, "!"; 3: "YOU'RE ALREADY WEARING ", (thatorthose) x1, "!"; 4: "YOU PUT ON ", (the) x1, "."; 5: print (The) actor, " PUTS ON ", (the) x1, ".^"; } ! Yes: see No. ]; -) instead of "Long Texts" in "Language.i6t". Include (- for (pcount=1 : : pcount++) { pattern-->pcount = PATTERN_NULL; scope_token = 0; token = line_token-->(pcount-1); lookahead = line_token-->pcount; #Ifdef DEBUG; if (parser_trace >= 2) print " [line ", line, " token ", pcount, " word ", wn, " : ", (DebugToken) token, "]^"; #Endif; ! DEBUG if (token ~= ENDIT_TOKEN) { scope_reason = PARSING_REASON; AnalyseToken(token); l = ParseToken(found_ttype, found_tdata, pcount-1, token); while ((l >= GPR_NOUN) && (l < -1)) l = ParseToken(ELEMENTARY_TT, l + 256); scope_reason = PARSING_REASON; if (l == GPR_PREPOSITION) { if (found_ttype~=PREPOSITION_TT && (found_ttype~=ELEMENTARY_TT || found_tdata~=TOPIC_TOKEN)) params_wanted--; l = true; } else if (l < 0) l = false; else if (l ~= GPR_REPARSE) { if (l == GPR_NUMBER) { if (nsns == 0) special_number1 = parsed_number; else special_number2 = parsed_number; nsns++; l = 1; } if (l == GPR_MULTIPLE) l = 0; parser_results-->(parameters+INP1_PRES) = l; parameters++; pattern-->pcount = l; l = true; } #Ifdef DEBUG; if (parser_trace >= 3) { print " [token resulted in "; if (l == REPARSE_CODE) print "re-parse request]^"; if (l == 0) print "failure with error type ", etype, "]^"; if (l == 1) print "success]^"; } #Endif; ! DEBUG if (l == REPARSE_CODE) jump ReParse; if (l == false) break; } else { ! If the player has entered enough already but there's still ! text to wade through: store the pattern away so as to be able to produce ! a decent error message if this turns out to be the best we ever manage, ! and in the mean time give up on this line ! However, if the superfluous text begins with a comma or "then" then ! take that to be the start of another instruction if (wn <= num_words) { l = NextWord(); if (l == THEN1__WD or THEN2__WD or THEN3__WD or comma_word) { held_back_mode = 1; hb_wn = wn-1; } else { for (m=0 : m<32 : m++) pattern2-->m = pattern-->m; pcount2 = pcount; etype = UPTO_PE; break; } } ! Now, we may need to revise the multiple object because of the single one ! we now know (but didn't when the list was drawn up). if (parameters >= 1 && parser_results-->INP1_PRES == 0) { l = ReviseMulti(parser_results-->INP2_PRES); if (l ~= 0) { etype = l; parser_results-->ACTION_PRES = action_to_be; break; } } if (parameters >= 2 && parser_results-->INP2_PRES == 0) { l = ReviseMulti(parser_results-->INP1_PRES); if (l ~= 0) { etype = l; break; } } ! To trap the case of "take all" inferring only "yourself" when absolutely ! nothing else is in the vicinity... if (take_all_rule == 2 && parser_results-->INP1_PRES == actor) { best_etype = NOTHING_PE; jump GiveError; } #Ifdef DEBUG; if (parser_trace >= 1) print "[Line successfully parsed]^"; #Endif; ! DEBUG ! The line has successfully matched the text. Declare the input error-free... oops_from = 0; ! ...explain any inferences made (using the pattern)... if (inferfrom ~= 0) { StartCapture(); PrintInferredCommand(inferfrom); EndCapture(); ProcessRulebook((+ the print upper case rule +), 0, true); ClearParagraphing(); } ! ...copy the action number, and the number of parameters... parser_results-->ACTION_PRES = action_to_be; parser_results-->NO_INPS_PRES = parameters; ! ...reverse first and second parameters if need be... if (action_reversed && parameters == 2) { i = parser_results-->INP1_PRES; parser_results-->INP1_PRES = parser_results-->INP2_PRES; parser_results-->INP2_PRES = i; if (nsns == 2) { i = special_number1; special_number1 = special_number2; special_number2 = i; } } ! ...and to reset "it"-style objects to the first of these parameters, if ! there is one (and it really is an object)... if (parameters > 0 && parser_results-->INP1_PRES >= 2) PronounNotice(parser_results-->INP1_PRES); ! ...and return from the parser altogether, having successfully matched ! a line. if (held_back_mode == 1) { wn=hb_wn; jump LookForMore; } rtrue; } ! end of if(token ~= ENDIT_TOKEN) else } ! end of for(pcount++) .LineFailed; ! The line has failed to match. ! We continue the outer "for" loop, trying the next line in the grammar. if (etype > best_etype) best_etype = etype; if (etype ~= ASKSCOPE_PE && etype > nextbest_etype) nextbest_etype = etype; ! ...unless the line was something like "take all" which failed because ! nothing matched the "all", in which case we stop and give an error now. if (take_all_rule == 2 && etype==NOTHING_PE) break; } ! end of for(line++) ! The grammar is exhausted: every line has failed to match. -) instead of "Parser Letter G" in "Parser.i6t". Include (- [ NounDomain domain1 domain2 context first_word i j k l answer_words marker; #Ifdef DEBUG; if (parser_trace >= 4) { print " [NounDomain called at word ", wn, "^"; print " "; if (indef_mode) { print "seeking indefinite object: "; if (indef_type & OTHER_BIT) print "other "; if (indef_type & MY_BIT) print "my "; if (indef_type & THAT_BIT) print "that "; if (indef_type & PLURAL_BIT) print "plural "; if (indef_type & LIT_BIT) print "lit "; if (indef_type & UNLIT_BIT) print "unlit "; if (indef_owner ~= 0) print "owner:", (name) indef_owner; new_line; print " number wanted: "; if (indef_wanted == INDEF_ALL_WANTED) print "all"; else print indef_wanted; new_line; print " most likely GNAs of names: ", indef_cases, "^"; } else print "seeking definite object^"; } #Endif; ! DEBUG match_length = 0; number_matched = 0; match_from = wn; SearchScope(domain1, domain2, context); #Ifdef DEBUG; if (parser_trace >= 4) print " [ND made ", number_matched, " matches]^"; #Endif; ! DEBUG wn = match_from+match_length; ! If nothing worked at all, leave with the word marker skipped past the ! first unmatched word... if (number_matched == 0) { wn++; rfalse; } ! Suppose that there really were some words being parsed (i.e., we did ! not just infer). If so, and if there was only one match, it must be ! right and we return it... if (match_from <= num_words) { if (number_matched == 1) { i=match_list-->0; return i; } ! ...now suppose that there was more typing to come, i.e. suppose that ! the user entered something beyond this noun. If nothing ought to follow, ! then there must be a mistake, (unless what does follow is just a full ! stop, and or comma) if (wn <= num_words) { i = NextWord(); wn--; if (i ~= AND1__WD or AND2__WD or AND3__WD or comma_word or THEN1__WD or THEN2__WD or THEN3__WD or BUT1__WD or BUT2__WD or BUT3__WD) { if (lookahead == ENDIT_TOKEN) rfalse; } } } ! Now look for a good choice, if there's more than one choice... number_of_classes = 0; if (number_matched == 1) i = match_list-->0; if (number_matched > 1) { i = true; if (number_matched > 1) for (j=0 : jj, match_list-->(j+1)) == false) i = false; if (i) dont_infer = true; i = Adjudicate(context); if (i == -1) rfalse; if (i == 1) rtrue; ! Adjudicate has made a multiple ! object, and we pass it on } ! If i is non-zero here, one of two things is happening: either ! (a) an inference has been successfully made that object i is ! the intended one from the user's specification, or ! (b) the user finished typing some time ago, but we've decided ! on i because it's the only possible choice. ! In either case we have to keep the pattern up to date, ! note that an inference has been made and return. ! (Except, we don't note which of a pile of identical objects.) if (i ~= 0) { if (dont_infer) return i; if (inferfrom == 0) inferfrom=pcount; pattern-->pcount = i; return i; } ! If we get here, there was no obvious choice of object to make. If in ! fact we've already gone past the end of the player's typing (which ! means the match list must contain every object in scope, regardless ! of its name), then it's foolish to give an enormous list to choose ! from - instead we go and ask a more suitable question... if (match_from > num_words) jump Incomplete; ! Now we print up the question, using the equivalence classes as worked ! out by Adjudicate() so as not to repeat ourselves on plural objects... BeginActivity(ASKING_WHICH_DO_YOU_MEAN_ACT); if (ForActivity(ASKING_WHICH_DO_YOU_MEAN_ACT)) jump SkipWhichQuestion; j = 1; marker = 0; for (i=1 : i<=number_of_classes : i++) { while (((match_classes-->marker) ~= i) && ((match_classes-->marker) ~= -i)) marker++; if (match_list-->marker hasnt animate) j = 0; } if (j) L__M(##Miscellany, 45); else L__M(##Miscellany, 46); j = number_of_classes; marker = 0; for (i=1 : i<=number_of_classes : i++) { while (((match_classes-->marker) ~= i) && ((match_classes-->marker) ~= -i)) marker++; k = match_list-->marker; if (match_classes-->marker > 0) print (the) k; else print (a) k; if (i < j-1) print (string) COMMA__TX; if (i == j-1) { #Ifdef SERIAL_COMMA; if (j ~= 2) print ","; #Endif; ! SERIAL_COMMA print (string) OR__TX; } } L__M(##Miscellany, 57); .SkipWhichQuestion; EndActivity(ASKING_WHICH_DO_YOU_MEAN_ACT); ! ...and get an answer: .WhichOne; #Ifdef TARGET_ZCODE; for (i=2 : ii = ' '; #Endif; ! TARGET_ZCODE answer_words=Keyboard(buffer2, parse2); ! Conveniently, parse2-->1 is the first word in both ZCODE and GLULX. first_word = (parse2-->1); ! Take care of "all", because that does something too clever here to do ! later on: if (first_word == ALL1__WD or ALL2__WD or ALL3__WD or ALL4__WD or ALL5__WD) { if (context == MULTI_TOKEN or MULTIHELD_TOKEN or MULTIEXCEPT_TOKEN or MULTIINSIDE_TOKEN) { l = multiple_object-->0; for (i=0 : ii; multiple_object-->(i+1+l) = k; } multiple_object-->0 = i+l; rtrue; } L__M(##Miscellany, 47); jump WhichOne; } ! Look for a comma, and interpret this as a fresh conversation command ! if so: for (i=1 : i<=answer_words : i++) if (WordFrom(i, parse2) == comma_word) { VM_CopyBuffer(buffer, buffer2); jump RECONSTRUCT_INPUT; } ! If the first word of the reply can be interpreted as a verb, then ! assume that the player has ignored the question and given a new ! command altogether. ! (This is one time when it's convenient that the directions are ! not themselves verbs - thus, "north" as a reply to "Which, the north ! or south door" is not treated as a fresh command but as an answer.) #Ifdef LanguageIsVerb; if (first_word == 0) { j = wn; first_word = LanguageIsVerb(buffer2, parse2, 1); wn = j; } #Endif; ! LanguageIsVerb if (first_word ~= 0) { j = first_word->#dict_par1; if ((0 ~= j&1) && ~~LanguageVerbMayBeName(first_word)) { VM_CopyBuffer(buffer, buffer2); jump RECONSTRUCT_INPUT; } } ! Now we insert the answer into the original typed command, as ! words additionally describing the same object ! (eg, > take red button ! Which one, ... ! > music ! becomes "take music red button". The parser will thus have three ! words to work from next time, not two.) #Ifdef TARGET_ZCODE; k = WordAddress(match_from) - buffer; l=buffer2->1+1; for (j=buffer + buffer->0 - 1 : j>=buffer+k+l : j-- ) j->0 = 0->(j-l); for (i=0 : i(k+i) = buffer2->(2+i); buffer->(k+l-1) = ' '; buffer->1 = buffer->1 + l; if (buffer->1 >= (buffer->0 - 1)) buffer->1 = buffer->0; #Ifnot; ! TARGET_GLULX k = WordAddress(match_from) - buffer; l = (buffer2-->0) + 1; for (j=buffer+INPUT_BUFFER_LEN-1 : j>=buffer+k+l : j-- ) j->0 = j->(-l); for (i=0 : i(k+i) = buffer2->(WORDSIZE+i); buffer->(k+l-1) = ' '; buffer-->0 = buffer-->0 + l; if (buffer-->0 > (INPUT_BUFFER_LEN-WORDSIZE)) buffer-->0 = (INPUT_BUFFER_LEN-WORDSIZE); #Endif; ! TARGET_ ! Having reconstructed the input, we warn the parser accordingly ! and get out. .RECONSTRUCT_INPUT; num_words = WordCount(); wn = 1; #Ifdef LanguageToInformese; LanguageToInformese(); ! Re-tokenise: VM_Tokenise(buffer,parse); #Endif; ! LanguageToInformese num_words = WordCount(); players_command = 100 + WordCount(); actors_location = ScopeCeiling(player); FollowRulebook(Activity_after_rulebooks-->READING_A_COMMAND_ACT, true); return REPARSE_CODE; ! Now we come to the question asked when the input has run out ! and can't easily be guessed (eg, the player typed "take" and there ! were plenty of things which might have been meant). .Incomplete; StartCapture(); if (context == CREATURE_TOKEN) L__M(##Miscellany, 48); else L__M(##Miscellany, 49); EndCapture(); ProcessRulebook((+ the print upper case rule +), 0, true); #Ifdef TARGET_ZCODE; for (i=2 : ii=' '; #Endif; ! TARGET_ZCODE answer_words = Keyboard(buffer2, parse2); first_word=(parse2-->1); #Ifdef LanguageIsVerb; if (first_word==0) { j = wn; first_word=LanguageIsVerb(buffer2, parse2, 1); wn = j; } #Endif; ! LanguageIsVerb ! Once again, if the reply looks like a command, give it to the ! parser to get on with and forget about the question... if (first_word ~= 0) { j = first_word->#dict_par1; if (0 ~= j&1) { VM_CopyBuffer(buffer, buffer2); return REPARSE_CODE; } } ! ...but if we have a genuine answer, then: ! ! (1) we must glue in text suitable for anything that's been inferred. if (inferfrom ~= 0) { for (j=inferfrom : jj == PATTERN_NULL) continue; #Ifdef TARGET_ZCODE; i = 2+buffer->1; (buffer->1)++; buffer->(i++) = ' '; #Ifnot; ! TARGET_GLULX i = WORDSIZE + buffer-->0; (buffer-->0)++; buffer->(i++) = ' '; #Endif; ! TARGET_ #Ifdef DEBUG; if (parser_trace >= 5) print "[Gluing in inference with pattern code ", pattern-->j, "]^"; #Endif; ! DEBUG ! Conveniently, parse2-->1 is the first word in both ZCODE and GLULX. parse2-->1 = 0; ! An inferred object. Best we can do is glue in a pronoun. ! (This is imperfect, but it's very seldom needed anyway.) if (pattern-->j >= 2 && pattern-->j < REPARSE_CODE) { PronounNotice(pattern-->j); for (k=1 : k<=LanguagePronouns-->0 : k=k+3) if (pattern-->j == LanguagePronouns-->(k+2)) { parse2-->1 = LanguagePronouns-->k; #Ifdef DEBUG; if (parser_trace >= 5) print "[Using pronoun '", (address) parse2-->1, "']^"; #Endif; ! DEBUG break; } } else { ! An inferred preposition. parse2-->1 = VM_NumberToDictionaryAddress(pattern-->j - REPARSE_CODE); #Ifdef DEBUG; if (parser_trace >= 5) print "[Using preposition '", (address) parse2-->1, "']^"; #Endif; ! DEBUG } ! parse2-->1 now holds the dictionary address of the word to glue in. if (parse2-->1 ~= 0) { k = buffer + i; #Ifdef TARGET_ZCODE; @output_stream 3 k; print (address) parse2-->1; @output_stream -3; k = k-->0; for (l=i : ll = buffer->(l+2); i = i + k; buffer->1 = i-2; #Ifnot; ! TARGET_GLULX k = Glulx_PrintAnyToArray(buffer+i, INPUT_BUFFER_LEN-i, parse2-->1); i = i + k; buffer-->0 = i - WORDSIZE; #Endif; ! TARGET_ } } } ! (2) we must glue the newly-typed text onto the end. #Ifdef TARGET_ZCODE; i = 2+buffer->1; (buffer->1)++; buffer->(i++) = ' '; for (j=0 : j1 : i++,j++) { buffer->i = buffer2->(j+2); (buffer->1)++; if (buffer->1 == INPUT_BUFFER_LEN) break; } #Ifnot; ! TARGET_GLULX i = WORDSIZE + buffer-->0; (buffer-->0)++; buffer->(i++) = ' '; for (j=0 : j0 : i++,j++) { buffer->i = buffer2->(j+WORDSIZE); (buffer-->0)++; if (buffer-->0 == INPUT_BUFFER_LEN) break; } #Endif; ! TARGET_ ! (3) we fill up the buffer with spaces, which is unnecessary, but may ! help incorrectly-written interpreters to cope. #Ifdef TARGET_ZCODE; for (: ii = ' '; #Endif; ! TARGET_ZCODE return REPARSE_CODE; ]; ! end of NounDomain -) instead of "Noun Domain" in "Parser.i6t". This is the print upper case rule: say "[captured text]" in upper case. Before printing a parser error: start capturing text. After printing a parser error: stop capturing text; say "[captured text]" in upper case. Carry out requesting the pronoun meanings (this is the capitalised announce the pronoun meanings rule): start capturing text; consider the announce the pronoun meanings rule; stop capturing text; say "[captured text]" in upper case. The announce the pronoun meanings rule is listed instead of the announce the pronoun meanings rule in the carry out requesting the pronoun meanings rulebook. Rule for listing nondescript items: let the domain be the location of the player; if the domain is a room begin; if the domain is the location begin; say "YOU "; otherwise; say "IN [the domain] YOU "; end if; otherwise if the domain is a supporter; say "ON [the domain] YOU "; otherwise if the domain is an animal; say "ON [the domain] YOU "; otherwise; say "IN [the domain] YOU "; end if; say "CAN [if the locale paragraph count is greater than 0]ALSO [end if]SEE "; let the common holder be nothing; let contents form of list be true; repeat with list item running through marked for listing things begin; if the holder of the list item is not the common holder begin; if the common holder is nothing begin; now the common holder is the holder of the list item; otherwise; now contents form of list is false; end if; end if; if the list item is mentioned, now the list item is not marked for listing; end repeat; filter list recursion to unmentioned things; if contents form of list is true and the common holder is not nothing begin; list the contents of the common holder, as a sentence, including contents, giving brief inventory information, tersely, not listing concealed items, listing marked items only; otherwise; say "[a list of marked for listing things including contents]"; end if; if the domain is the location, say " HERE"; say ".[paragraph break]"; unfilter list recursion. For printing a locale paragraph about a thing (called the item) (this is the capitalised use initial appearance in room descriptions rule): if the item is not mentioned begin; if the item provides the property initial appearance and the item is not handled and the initial appearance of the item is not "" begin; increase the locale paragraph count by 1; say "[initial appearance of the item]"; say "[paragraph break]"; if a locale-supportable thing is on the item begin; repeat with possibility running through things on the item begin; now the possibility is marked for listing; if the possibility is mentioned begin; now the possibility is not marked for listing; end if; end repeat; say "ON [the item] "; list the contents of the item, as a sentence, including contents, giving brief inventory information, tersely, not listing concealed items, prefacing with is/are, listing marked items only; say ".[paragraph break]"; end if; now the item is mentioned; end if; end if; continue the activity. The capitalised use initial appearance in room descriptions rule is listed instead of the use initial appearance in room descriptions rule in the for printing a locale paragraph about rulebook. Definition: a thing (called the item) is locale-supportable if the item is not scenery and the item is not mentioned and the item is not undescribed. For printing a locale paragraph about a thing (called the item) (this is the capitalised describe what's on scenery supporters in room descriptions rule): if the item is [not undescribed and the item is] scenery and the item does not enclose the player begin; if a locale-supportable thing is on the item begin; set pronouns from the item; repeat with possibility running through things on the item begin; now the possibility is marked for listing; if the possibility is mentioned begin; now the possibility is not marked for listing; end if; end repeat; increase the locale paragraph count by 1; say "ON [the item] "; list the contents of the item, as a sentence, including contents, giving brief inventory information, tersely, not listing concealed items, prefacing with is/are, listing marked items only; say ".[paragraph break]"; end if; end if; continue the activity. The capitalised describe what's on scenery supporters in room descriptions rule is listed instead of the describe what's on scenery supporters in room descriptions rule in the for printing a locale paragraph about rulebook. Rule for printing the name of something (called the chosen item): say the printed name of the chosen item in upper case. Rule for printing the plural name of something (called the chosen item): say the printed name of the chosen item in upper case. Rule for printing the name of a room (called the chosen room): say the printed name of the chosen room in upper case. Rule for printing the plural name of a room (called the chosen room): say the printed name of the chosen room in upper case. Uppercase ends here. ---- DOCUMENTATION ---- This extension changes all the text to uppercase.