You can use this engine to syntax highlight Inform code for web publishing.
Typing a URL in the URL text box overrides the File list.
Click here to learn more about creating custom style schemes. NOTE: Please don't link to this page to show a specific Inform file, since it bogs down the server.
Instead, syntax highlight the file the way you want it, press "Code Only", and save the resulting page.
- Fredrik Ramsberg
! PLEASE NOTE THAT THIS IS ONLY A TEST FILE FOR SYNTAX HIGHLIGHTING.
! IT CAN'T BE COMPILED, AND ISN'T INTENDED TO DO ANYTHING USEFUL AS A PROGRAM!!!
!
! Note: the verb "lock" is extended so that "lock padlock" allows you to
! lock the padlock (without the parser asking you what you want to lock it
! with).
!
Constant Story "TEST";
Constant Headline "^An Interactive Test^by ~Fredrik@@64W@:arlden.com~^";
Replace LookUnderSub;
Include "parser";
Include "verblib";
Include "grammar";
Attribute is_key;
Constant MAX_SCORE 100;
Array PowersOfTwo_GNA ! Not a useful array.
--> $$1000000000000000
$$0100000000000000
$$0010000000000000;
Array Xword --> 1 2 3;
Array Ybyte -> 1 2 3;
Array Zbyte -> 1 2 3;
Extend "lock" first * noun=PadlockTest -> PadlockLock;
Object Crossover "N/S and E/W Crossover"
with description
"You are at a crossover of a high N/S passage \
and a low E/W one.",
w_to At_East_End_Of_Long_Hall,
n_to Dead_End_7,
e_to In_West_Side_Chamber,
s_to At_West_End_Of_Long_Hall;
Object -> TheCrossover "crossover"
with description "You know as much as I do at this point.",
name "crossover" "over" "cross"
has scenery;
Object Chest1 "chest" Crossover
has container openable
with name "chest",
capacity 5,
before [ i;
Lock:
if (second == Padlock) {
if (Padlock has locked) "The padlock is locked shut.";
if (self has open) "The chest is open.";
i = parent(self);
remove self;
move padlock to Chest2;
move Chest2 to i;
give padlock locked;
"You snap the padlock shut on the chest.";
}
"The chest has no lock.";
];
[ Initialise k;
location = Dungeon1;
k=1;
if(Xword-->k || Ybyte->k>3 || k--) k=900;
! print "^^^^^What is @{9af0}in the @19box@a9 of @@1 or @@255 in @@1111?^^";
print "^^^^^What is @{9zf0}@{9afff}@{9af0}in the @19box@a9 of @@1 or \
@@255 in ", $ea, " @@1111?^^";
];
[ LookUnderSub;
if (location==thedark) return L__M(##LookUnder,1);
L__M(##LookUnder,2);
];
[ MyUnlockSub i j;
objectloop (i in player) { if (i has is_key) j = i; }
print "(with ", (the) j, ")^";
<<Unlock noun j>>;
];
[ DrawStatusLine i;
! Switch to status window and reverse it.
@split_window 3; @set_window 1; style reverse; font off;
@set_cursor 1 1; spaces (0->33)-1;
@set_cursor 2 1; spaces (0->33)-1;
@set_cursor 3 1; spaces (0->33)-1;
! And now print the directions of the location (if not dark). This is
! the interesting part (for me at least).
if (location ~= thedark) {
if (location.u_to ~= 0) { @set_cursor 1 U_POS; print "U"; }
if (location.nw_to ~= 0) { @set_cursor 1 W_POS; print "@@92"; }
if (location.n_to ~= 0) { @set_cursor 1 C_POS; print "|"; }
if (location.ne_to ~= 0) { @set_cursor 1 E_POS; print "/"; }
if (location.in_to ~= 0) { @set_cursor 1 IN_POS; print "I"; }
}
];
End;