Tabs as output in non-Z6 games

I found something on the margins of interesting in Zork recently. Tab (ZSCII 9) is not defined for output except in version 6, but Zork I prints out a tab character. When you read the guide book for FCD#3, the code is in part:

(TEXT
"\"»····Flood Control Dam #3|

(the »···· represents a tab).

This is present in all releases of Zork as far as I can tell (including Solid Gold), and looks to go back to the 1977 mainframe Zork:

<ADD-DESC <FIND-OBJ "GUIDE">
"\"»····»·······   Guide Book to
»·······»·······Flood Control Dam #3

  Flood Control Dam #3 (FCD#3) was constructed in year 783 of the
Great Underground Empire to harness the destructive power of the

I’ve excerpted enough here to show that the tabs were obviously used intentionally to “center” the title. Odds are mainframe Zork just passed tabs through and it worked. The single tab makes no sense in Z-machine Zork, so it’s likely a vestige from the mainframe version that nobody noticed. It wasn’t printed out as a tab by Infocom, at any rate:

I ran it on various Infocom interpreters as well as post-Infocom, and got varied outputs. The results for Infocom:

  • DOS: A is displayed, which is the character corresponding to 9 in CP-437
  • Apple II and C64: No output
  • Mac and Amiga: A single space

It’s clearly not intentional, or there’d be consensus among these interpreters, or at least the DOS version wouldn’t display that character.

And for post-Infocom:

  • Bocfel: (that’s the Unicode replacement character)
  • Frotz / Windows Frotz / Infuse: A single space
  • Fizmo & Rezrov: An literal tab but it’s converted to an appropriate number of spaces by curses on output
  • XZip: \011 (i.e. it escapes it since it’s invalid output)
  • Zoom: Three spaces, from what I can tell
  • Viola: No output, with the note “Warning: ZSCII character 9 undefined for output”
  • Filfre / Fweep: A literal tab
  • Nitfol: [9] (similar to XZip’s approach)
  • Lectrote (ZVM) / Zax: No output

None of these can be wrong since the behavior is undefined. Bocfel’s is probably the “least not wrong”, though, and I’m updating it in the next release to print out nothing, which is the best approach for Zork, as far as I’m concerned, although the outputs of various spaces will generally look just fine. The escaped outputs are reasonable since the code is wrong, and Viola’s use of a warning is reasonable, too.

I couldn’t find this anywhere else in the Infocom games’ source code after quickly grepping, which again points to an accidental usage in Zork. As I said, this is marginally interesting at best, but it was kind of fun to see how everything reacts to it.

3 Likes

The thing is, in ZILF, you’ll get an error if you try to compile a game. This is only a problem with compilers that did not call this out in build…

I feel like I once knew about Zork I outputting a tab character. It sounds familiar.

Looks like Zork has a couple of other instances:

"\t  !!!! 	FROBOZZ MAGIC BOAT COMPANY  !!!!| ...

"---> Frobozz Magic Gunk Company <---|\t  All-Purpose Gunk"

Suspended seems to have one too:

...critical level. \t       NOVA IMMINENT!

Tab occurring in Suspended would seem to rule out a leftover from mainframe Zork. :slight_smile:

Probably there was nothing to enforce which characters were “legal” at all and everything was simply done by convention.

It’s easy to forget Beyond Zork can output “illegal” Zscii with the correct Interpreter number when font 3 isn’t available - outputting IBM graphics characters.

Looks like my grep skills aren’t up to par! And even more of an incentive for me to ensure those replacement characters aren’t shown, here. Nice finds.

Hah, yeah, or at least makes it more likely that it was intentionally kept rather than inadvertently. Especially if they were using an interpreter that maintained the tabs. My vague recollection is that it’s likely they’d have been on the DEC interpreter, and I have no idea how that handled them.

A quick check of the XZip docs finds this:

In character set 2, 6 means that the ASCII value specified by the following two bytes, high-order byte first, should be used.

Which would indicate, in fact, that they expected tabs to be output as tabs. Basically, it feels kind of like “do the obviously-correct thing” was expected, even if the DOS interpreter didn’t quite follow that.

For Beyond Zork, in addition to IBM characters, it also outputs MouseText on Apple IIc. Things got a bit less portable as Infocom began relying on the interpreter number (especially in the version 6 games).

I suspect not, actually. It’s a tab in the middle of a string of spaces. The code has a newline without the normal | marker (which would generate a Z-code newline).

It looks more like someone just hit enter and got their normal code indentation but forgot that it was in the middle of a string literal.

2 Likes

Yeah, but unlike the IBM characters mousetext falls in the standard ascii (and zscii) range. So it might look weird but would not be invalid.