Troy

An interactive fiction by Adam Smith (2007) - the Inform 7 source text

Home page

Contents
Previous
Next

Complete text
Chapter 2 - A Web Browser

Include Basic Screen Effects by Emily Short.
Use no scoring.

Table of Status Lines
left   central   right
""   "[title of current page]"   ""

Rule for constructing the status line:
    fill status bar with Table of Status Lines;
    rule succeeds.

Instead of taking something: say "Even when your cursor does look like a little white hand, it is hardly capable of taking anything.".
Instead of dropping something (called the topic), say "In [italic type]trying[roman type] to forget it, [the topic] becomes more strongly rooted in your memory."
Before going: say "Your cursor is constrained to the display in front of you."; stop the action.
Before exiting: end the game saying "GAME OVER".
Instead of examining yourself: say "You don't have a webcam."

A page is a kind of room. A page has a text called the url. A page has a text called the title.
An anchor is a kind of thing. An anchor has a page called the destination.

The current page is a page that varies.

Things are usually scenery.

Table of Browser History
page
the blank page
with 32 blank rows

Loading is an action applying to one thing.
Instead of loading a page (called p):
    move the player to p;
    change the current page to p.

Backing up is an action applying to nothing.
Understand "back" or "b" as backing up.

Instead of backing up:
    let n be the number of filled rows in The Table of Browser History;
    choose row n in the Table of Browser History;
    let p be the page entry;
    blank out the whole row;
    silently try loading p.

Linking is an action applying to nothing.
Understand "links" or "ls" as linking.
Instead of linking:
    say "Links[line break]";
    say "[italic type][list of anchors in the current page][roman type]".

Historizing is an action applying to nothing.
Understand "history" or "hist" or "h" as historizing.

Instead of historizing:
    say "Browser History[line break]";
    say "[italic type][title of current page][roman type] (current page)[line break]";
    repeat through the Table of Browser History in reverse order begin;
        let the p be the page entry;
        say "[italic type][title of p][roman type][line break]";
    end repeat.

Clicking is an action applying to one thing.
Understand "click [an anchor]" or "c [an anchor]" or "[an anchor]" as clicking.

Instead of clicking an anchor (called the link):
    choose a blank row in the Table of Browser History;
    change the page entry to the location of the player;
    let p be the destination of the link;
    say "Loading [fixed letter spacing][the url of p][variable letter spacing].";
    silently try loading p.
Instead of clicking something: say "Impossible.".

The printed name of a page is "[the title]".
The description of an anchor is "[fixed letter spacing][the url of the destination][variable letter spacing]".