!The following is a little piece of code I use to make the file !executable in Unix: #IfTrue 0; eval 'exec Inform615 \(Comp.set\) $* Comp99 $argv:q' #EndIf; Constant Story "Competition '99"; Constant Headline "^An Interactive Guide^ Copyright (c) 1999 by Lucian Smith.^"; Release 3; Constant MAX_GAMES 72; Global total_games; !Set in the 'initialize' routine Global the_year = 99; Replace DrawStatusLine; Replace ReviseMulti; Include "Parser"; Include "Verblib"; Attribute standalone_DOS; [ Initialise x; location = Room; total_games = children(unsorted); remove rules98; remove rules97; objectloop (x ofclass Game) { if (x in unsorted) x.year = 99; if (x in bin98) x.year = 98; if (x in bin97) x.year = 97; if (x in bin96) x.year = 96; if (x in bin95) x.year = 95; if (x in bin06) x.year = 6; } objectloop(x in unsorted) { if (x ofclass Inform_Game) move i_switch to switches; if (x ofclass TADS_Game) move t_switch to switches; if (x ofclass Hugo_Game) move h_switch to switches; if (x ofclass ALAN_Game) move al_switch to switches; if (x ofclass AGT_Game) move ag_switch to switches; if (x ofclass JACL_Game) move j_switch to switches; if (x ofclass REXX_Game) move r_switch to switches; if (x ofclass DOS_Game) move d_switch to switches; if (x ofclass HTML_Game) move htm_switch to switches; if (x ofclass Erasma_Game) move era_switch to switches; if (x ofclass RAIF_Game) move raif_switch to switches; } "^^^^^Days of searching, days of endless hacking through the levels of the I-F archive, but at last your patience is rewarded. A contest! As you arrive, you see technicians adding blurbs to the backs of some of the games.^^"; ]; [ChooseObjects obj code; switch(code) { 1: if ((obj ofclass Game) && (action_to_be == ##SwitchOn or ##SwitchOff)) return 2; 2: if (obj ofclass Game) return 4; if (obj == next_game) return 5; if (obj == d_switch) return 7; if (obj ofclass Switch) return 6; if (obj == switches) return 8; if (obj in Compass) return 1; return 3; 3, 4: switch (action_to_be) { ##Take: if (parent(obj) has scenery || parent(obj) has static) return 1; rfalse; } } rfalse; ]; [ ReviseMulti second_p i low; #ifdef DEBUG; if (parser_trace>=4) print " Revising multiple object list of size ", multiple_object-->0, " with 2nd ", (name) second_p, "^"; #endif; if (multi_context==MULTIEXCEPT_TOKEN or MULTIINSIDE_TOKEN) { for (i=1, low=0:i<=multiple_object-->0:i++) { if ( (multi_context==MULTIEXCEPT_TOKEN && multiple_object-->i ~= second_p) || (multi_context==MULTIINSIDE_TOKEN && multiple_object-->i in second_p)) { if (ChooseObjects(multiple_object-->i,4,second_p)~=2) { low++; multiple_object-->low = multiple_object-->i; } } else { if (ChooseObjects(multiple_object-->i,3,second_p)==1) { low++; multiple_object-->low = multiple_object-->i; } } } multiple_object-->0 = low; } if (multi_context==MULTI_TOKEN && action_to_be == ##Take) { for (i=1, low=0:i<=multiple_object-->0:i++) if (parent(multiple_object-->i)==parent(actor)) low++; #ifdef DEBUG; if (parser_trace>=4) print " Token 2 plural case: number with actor ", low, "^"; #endif; if (take_all_rule==2 || low>0) { for (i=1, low=0:i<=multiple_object-->0:i++) { if (parent(multiple_object-->i)==parent(actor)) { if (ChooseObjects(multiple_object-->i,4,second_p)~=2) { low++; multiple_object-->low = multiple_object-->i; } } else { if (ChooseObjects(multiple_object-->i,3,second_p)==1) { low++; multiple_object-->low = multiple_object-->i; } } } multiple_object-->0 = low; } } i=multiple_object-->0; #ifdef DEBUG; if (parser_trace>=4) print " Done: new size ", i, "^"; #endif; if (i==0) return NOTHING_PE; return 0; ]; [ DrawStatusLine width posa posb x; @split_window 1; @set_window 1; @set_cursor 1 1; style reverse; width = 0->33; posa = width-26; posb = width-13; spaces (width); @set_cursor 1 2; PrintShortName(location); if (game_rack in location) { sline1=0; sline2=children(game_rack); objectloop(x in game_rack) { if (x.rating~=0) sline1++; } if (width > 76) { @set_cursor 1 posa; print "Games Rated: ", sline1, "/", sline2; } if (width > 63 && width <= 76) { @set_cursor 1 posb; print sline1, "/", sline2; } } @set_cursor 1 1; style roman; @set_window 0; ]; Class Game with name "game" "games//p", description [; style bold; print "~", (string) self.short_name; if (self provides subtitle) print ": ", (string) self.subtitle; print "~"; style roman; print " (", (string) self.filename, (string) self.ext, "), is ", (string) self.article, " ", (string) self.game_type, " game by ", (string) self.author; if (self provides email) print " (", (string) self.email, ")"; print ". It can be found in the directory:^^ ftp://ftp.gmd.de/if-archive/games/competition"; switch(the_year) { 0: print "00"; 1 to 9: print "0", the_year; default: print the_year; } print "/", (string) self.subdirname; if (self provides directory) print (string) self.directory; else print (string) self.filename, "/"; print (string) self.filename; if (self provides ext) print (string) self.ext; if (self provides other_files) print "^^along with the file(s) ", (string) self.other_files, ", which provide extra information or hints.^^"; else print "^^"; if (self provides blurb) { print "A short note from the author is printed on the back, reading:^^~", (string) self.blurb, "~^^"; } print "You have"; if (self.rating==0) print "n't rated this game yet."; else if (self.rating==8) print " given this game an eight."; else print " given this game a ", (number) self.rating, "."; ""; ], before [; Waylay: self.rating=0; "Attempting to sabotage ", (the) self, "'s chances of winning, you give it a zero! Unfortunately, this primitive program thinks that the game is now simply unranked. Curses!"; Consult, Read: <>; ], rating 0, ranking 0, year 99, list_together "games of various types", has proper; Class Inform_Game class Game with name 'Inform' 'DOS' 'Windows' 'IBM' 'OS2' 'OS/2' 'linux' 'unix' 'amiga' 'mac' 'macintosh' 'acorn' 'bebox' 'atari' 'apple' 'iigs', game_type "Inform", ext ".z5", article "an", list_together "Inform games", subdirname "inform/", interp_directory "ftp://ftp.gmd.de/if-archive/interpreters-infocom-zcode/frotz/^--and--^ ftp://ftp.gmd.de/if-archive/interpreters-infocom-zcode/zip/^ (as well as in other subdirectories under ../interpreters/)", DOS_interp "DosFrotz232Std10.zip or frotzpl3.zip (frotz), or jzpc201g.zip or zip200.zip (zip)", Win_interp "WinFrotzR53.zip (frotz) (Win95/98/NT), or winf_05.zip or wzip21.zip (zip)", Mac_interp "MaxZip-177.hqx, MultiAventures1.8.3.hqx, or ZIP_141_68k.cpt (zip)", OS2_interp "frotz201_std02_os2b7.zip (frotz), or zip4os2 or zip4warp (zip)", Lnx_interp "frotz-2.32-4.src.rpm (frotz) ziplinux.patch (source code)", Unix_interp "UnixFrotz232R2Std10.tar.gz (frotz), jzip202beta-std10-unix-052798.tgz, zip.sh.Z (zip source code), zip-sgi.tar.gz (zip IRIX), or xzip181.tar.Z (X-Windows)", Amg_interp "Frotz232Std02Amiga8.lha (frotz) or AmigaZIP_V8.lha (zip)", Other_interp "Acorn_Zip2000_133_Std1.0.spk (Acorn Archimedes), atarizip.zoo (Atari ST), BeOSFrotz232.zip or jzip.bebox.tar.gz (BeBox), jzipstb3.zip (Atari 16/32 bit), zipgs1.0a1.sea (Apple IIGS), FrotzCE12a.zip (Windows CE), FrotzS5r13.zip (Psion series 5)"; Class TADS_Game class Game with name 'TADS' 'DOS' 'IBM' 'OS2' 'OS/2' 'linux' 'unix' 'amiga' 'mac' 'macintosh' 'acorn' 'atari', ext ".gam", game_type "TADS", subdirname "tads/", list_together "TADS games", interp_directory "ftp://ftp.gmd.de/if-archive/interpreters-other/tads/executables/", DOS_interp "pc-go32.tads2exe.zip or tads2exe.zip", Win_interp "htads_playkit_251.exe (HTML-TADS capable), or WinTADS-130.zip (both for Windows 95/NT)", Mac_interp "HyperTADS-111.sit.bin (HTML-TADS capable), or MaxTADS-115.hqx", OS2_interp "tadsos2.zip", Lnx_interp "tadslinux-240.tar.gz", Unix_interp "../source/daves-tads-src.tar.gz (you must build it yourself)", Amg_interp "AmigaTADS250.lha", Other_interp "AcornTADSruntime.spk (Acorn), atari.tads2exe.arc (Atari ST/TT/Falcon)"; Class Hugo_Game class Game with name 'hugo' 'DOS' 'IBM' 'OS2' 'OS/2' 'linux' 'unix' 'amiga' 'acorn', ext ".hex", subdirname "hugo/", list_together "Hugo games", game_type "Hugo", interp_directory "ftp://ftp.gmd.de/if-archive/interpreters-other/hugo/executables/", DOS_interp "hugov25_16bit.zip or hugov25_32bit.zip or (16 and 32-bit, respectively, both include graphical engine.)", Win_interp "hugov25_win32.zip (Win95/NT)", OS2_interp "hugov25_os2.zip", Mac_interp "hugov25_macglk.hqx", Lnx_interp "hugo24Clinux.tar.gz", Amg_interp "Hugo24Amiga.lha", Other_interp "HugoRiscOS (Acorn)"; Class ALAN_Game class Game with name "alan" "DOS" "IBM" "Amiga" "Mac" "macintosh" "Linux" "Unix" 'solaris', game_type "ALAN", subdirname "alan/", article "an", list_together "ALAN games", interp_directory "ftp://ftp.gmd.de/if-archive/interpreters-other/alan/executables/", ext ".acd", DOS_interp "arun281dos.zip", Win_interp "arun286bwin.zip", Lnx_interp "arun281linux.tar.Z", Amg_interp "arun286amiga.lha", Unix_interp "arun280solaris1.tar.Z or arun280solaris2.tar.Z (Solaris)"; Class AGT_Game class Game with name 'AGT' 'DOS' 'IBM' 'Mac' 'Macintosh' 'linux' 'amiga' 'unix', ext ".agx", game_type "AGT", subdirname "agt/", article "an", list_together "AGT games", interp_directory "ftp://ftp.gmd.de/if-archive/interpreters-other/agt/agility/", DOS_interp "agil086dos.zip", Win_interp "AGiliTy086Win.zip (Win95/NT)", Mac_interp "Agility-08-Mac.hqx or ../MultiAventures1.8.3.hqx", Lnx_interp "agil086linux.tgz", Amg_interp "AGiliTy086Amiga.lha", Unix_interp "UnixWare202_agility.tar.gz", Other_interp "agil08src.zip (ANSI C source code)"; Class JACL_Game class Game with name "jacl" "DOS" "IBM" "Linux" "dos-only", ext ".jac", game_type "JACL", subdirname "jacl/", list_together "JACL games", interp_directory "ftp://ftp.gmd.de/if-archive/games/competition97/jacl/", DOS_interp "jacl.exe (provided)", Lnx_interp "jacl.elf (provided)", has standalone_DOS; Class REXX_Game class Game with name "OS/2" "OS2" "OS_2" "REXX" "Adventure" "REXX-Adventure", game_type "REXX Adventure", subdirname "rexx/", list_together "REXX Adventure games", ext ".rad", interp_directory "ftp://ftp.gmd.de/if-archive/interpreters-other/rexx-adventure/", OS2_interp "RADF100.ZIP"; Class DOS_Game class Game with name 'dos' 'dos-only' 'msdos', subdirname "msdos/", game_type "standalone DOS", list_together "DOS-based games"; Class HTML_Game class Game with name 'html' 'java' 'javascript' 'web' 'web-based', subdirname "web/", list_together "HTML games", game_type "web-based", ext ".htm", description [; style bold; print "~", (string) self.short_name; if (self provides subtitle) print ": ", (string) self.subtitle; print "~"; style roman; print " (", (string) self.filename, (string) self.ext, "), is ", (string) self.article, " ", (string) self.game_type, " game by ", (string) self.author; if (self provides email) print " (", (string) self.email, ")"; print ". A pointer file can be found at GMD at:^^ ftp://ftp.gmd.de/if-archive/games/competition"; switch (the_year) { 1 to 9: print "0", the_year; 0: print "00"; default: print the_year; } print "/", (string) self.subdirname; if (self provides directory) print (string) self.directory; else print (string) self.filename, "/"; print (string) self.filename; if (self provides ext) print (string) self.ext; if (self provides other_files) print "^^along with the file(s) ", (string) self.other_files, ", which provide extra information or hints.^^"; else print "^^"; if (self provides website) { print "The game itself is located at the web site:^^", (string) self.website, "^^"; } if (self provides blurb) { print "A short note from the author is printed on the back, reading:^^~", (string) self.blurb, "~^^"; } print "You have"; if (self.rating==0) print "n't rated this game yet."; else if (self.rating==8) print " given this game an eight."; else print " given this game a ", (number) self.rating, "."; ""; ]; Class Erasma_Game class Game with name 'erasmaganza' 'erasmatron', game_type "Erasmatron", article "an", subdirname "erasma", list_together "Erasmatron Adventure", ext ".era", interp_directory "ftp://ftp.gmd.de/if-archive/interpreters-other/erasmatron/", OS2_interp "erasma.zip", Mac_interp "erasmaganza.hqx", ; Class RAIF_Game class Game with name 'raif' 'pool' 'raif-pool', game_type "RAIF-POOL", subdirname "raif-pool", list_together "RAIF-POOL game", ext ".rfp", interp_directory "ftp://ftp.gmd.de/if-archive/interpreters-other/raif-pool/", DOS_interp "everything.zip", Win_interp "everything.zip", Mac_interp "everything.zip", OS2_interp "everything.zip", Lnx_interp "everything.zip", Unix_interp "everything.zip", Amg_interp "everything.zip", Other_interp "everything.zip", ; Object Room "Competition Headquarters" with description "In this tiny room, a carpet of debris is broken by stone-cut steps leading back down into the darkness from which you came. It seems that the last game has finally been collected and sorted, leaving the place in a state of loosely-organized chaos.", d_to [; print "You turn around to trudge back down the stairs and back to real life.^"; if (game_rack in Room) { print "Would you like to save this setup before you go? > "; if (YesOrNo()) <>; print "Okay. Bye!^"; <>; } else <>; ], u_to "You climb the walls for a bit, but it doesn't help.", cant_go "There doesn't seem to be any way out other than the way you got here.", before [x inf tad hug ala agt jac rex dos htm era raif; Listen: "A faint hum of machinery echoes behind the walls"; Search: if (noun hasnt container) <>; if (child(noun)~=nothing) { print "Within ", (the) noun, " you see:^"; objectloop (x in noun) { if (x ofclass Inform_Game) inf++; if (x ofclass TADS_Game) tad++; if (x ofclass Hugo_Game) hug++; if (x ofclass ALAN_Game) ala++; if (x ofclass AGT_Game) agt++; if (x ofclass JACL_Game) jac++; if (x ofclass REXX_Game) rex++; if (x ofclass DOS_Game) dos++; if (x ofclass HTML_Game) htm++; if (x ofclass Erasma_Game) era++; if (x ofclass RAIF_Game) raif++; give x ~workflag; } objectloop (x in noun) { if ((x ofclass Inform_Game) && inf ~= 1) give x workflag; if ((x ofclass TADS_Game) && tad ~= 1) give x workflag; if ((x ofclass Hugo_Game) && hug ~= 1) give x workflag; if ((x ofclass ALAN_Game) && ala ~= 1) give x workflag; if ((x ofclass AGT_Game) && agt ~= 1) give x workflag; if ((x ofclass JACL_Game) && jac ~= 1) give x workflag; if ((x ofclass REXX_Game) && rex ~= 1) give x workflag; if ((x ofclass DOS_Game) && dos ~= 1) give x workflag; if ((x ofclass HTML_Game) && htm ~= 1) give x workflag; if ((x ofclass Erasma_Game) && era ~= 1) give x workflag; if ((x ofclass RAIF_Game) && raif ~= 1) give x workflag; } WriteListFrom(child(noun), INDENT_BIT + NEWLINE_BIT + CONCEAL_BIT + WORKFLAG_BIT); objectloop(x in noun) { if (x hasnt workflag) { if (x ofclass Inform_Game) print "one Inform game:^ ", (the) x, "^"; if (x ofclass TADS_Game) print "one TADS game:^ ", (the) x, "^"; if (x ofclass Hugo_Game) print "one Hugo game:^ ", (the) x, "^"; if (x ofclass ALAN_Game) print "one Alan game:^ ", (the) x, "^"; if (x ofclass AGT_Game) print "one AGT game:^ ", (the) x, "^"; if (x ofclass JACL_Game) print "one JACL game:^ ", (the) x, "^"; if (x ofclass REXX_Game) print "one REXX game:^ ", (the) x, "^"; if (x ofclass DOS_Game) print "one DOS game:^ ", (the) x, "^"; if (x ofclass HTML_Game) print "one HTML game:^ ", (the) x, "^"; if (x ofclass Erasma_Game) print "one Erasmatron game:^ ", (the) x, "^"; if (x ofclass RAIF_Game) print "one RAIF-POOL game:^ ", (the) x, "^"; } } rtrue; } print_ret (The) noun, " is empty."; ], has light; Class Bin with name "bin" "bins//p", initial [x; print "A bin for ", (string) self.adj, " games sits here, "; x = GamesIn(self); if(x==0) "empty."; print "containing ", (number) x; if (x>1) " games."; " game."; ], description [; print (string) self.desc, "^"; <>; ], before [; Receive: if (~~(noun ofclass Game)) "Sorry, you can only put games into the bins."; ], has container open static; Bin play_bin "bin for playable games" Room with name "playable", adj "playable", desc "This is the bin in which to put games that are playable on your computer. When you're finished, pull the lever to sort the games in here.^"; Bin noplay_bin "bin for unplayable games" Room with name "unplayable", adj "unplayable", desc "This is the bin in which to put games which are unplayable on your computer.^"; Bin unsorted "bin for unsorted games" Room with name "unsorted", adj "unsorted", desc "This is the bin where the games start out. The games in the playable bin can't be sorted (by pulling the lever) until this bin is empty, and no games are left lying around or in your possession.^"; Include ">games99"; !Putting the new games so far into the bin. Object lever "lever" Room with parse_name [ i j; switch (self.readiness()) { 1: j='green'; 2: j='yellow'; 3: j='red'; } while (NextWord()=='lever' or 'cables' or 'light' or j) i++; return i; ], initial [; print "A large lever sticks conspicuously out of one wall, just above the 'playable games' bin. A light below it glows "; switch (self.readiness()) { 1: print "green"; 2: print "yellow"; 3: print "red"; } print ". The lever is "; if (self has on) print "up"; else print "down"; "."; ], readiness [; if (GamesIn(play_bin) + GamesIn(noplay_bin) == total_games) return 1; else if (self has on) return 2; else return 3; ], description "Looking more closely, you see cables going from the various bins into the wall just below the lever.", before [; Push, Pull, Turn, Flip: if (self has on) <>; else <>; SwitchOn: if (self.readiness()~=1) "You are unable to move the lever while there are still unsorted games in the area."; ], after [; SwitchOff: EmptyInto(game_rack, play_bin); remove game_rack; remove button; move switches to Room; "With a tumble, the rack tips, depositing its contents into the 'playable games' bin again, before disappearing back into the wall."; SwitchOn: move game_rack to Room; move button to Room; remove switches; SortGames(); "With a whir, the bottom of the 'playable games' bin opens, and all the games inside disappear into an inky blackness. The bin re-closes as you hear the games rattle and thump behind the wall within unseen machinery. Finally, a panel in the wall rotates and a rack emerges, holding the games in the order in which you're supposed to play them."; ], has switchable static; Array list_order -> MAX_GAMES; [SortGames x n i j maxlen; !First, we randomize the list, a la the !designer's manual shuffle. n = children(play_bin); list_order -> 0 = 0; for(i=1:i i = list_order -> j; list_order -> j = i; } !Next, we assign the list numbers to the !'rankings'. At the same time, we keep !track of the longest title of the bunch. x = child(play_bin); for(i=0:i i) + 1; if (x.title_length>maxlen) maxlen=x.title_length; x = sibling(x); } game_rack.max_title_len = maxlen; !Finally, we move everything in play_bin !to game_rack. EmptyInto(play_bin, game_rack); ]; [EmptyInto obj1 obj2 x; !Move everything from obj1 to obj2. x = child(obj1); while (x~=nothing) { move x to obj2; x = child(obj1); } ]; Class Switch with name 'switch' 'switches//p', description [game x; print "This switch is for ", (string) self.type, " games.^^"; objectloop (game ofclass self.classtype) x = game; if (x ofclass HTML_Game) { print "These games are designed to be played over the internet on a variety of platforms with a Java-enabled browser (like Netscape or Internet Explorer)."; } if (x has standalone_DOS) { print "These games are standalone DOS games, and should be playable directly from the DOS prompt. If you are not playing on a DOS-capable machine, "; if (x provides interp_directory) print "you'll need an interpreter.^^"; else print "you will be unable to play this game.^^"; } if (x provides interp_directory) { print "Interpreters for ", (string) self.type, " games can be found in:^^", (string) x.interp_directory, "^^Interpreters exist for:^^"; if (x provides DOS_interp) print "* DOS -- ", (string) x.DOS_interp, "^^"; if (x provides Win_interp) print "* Windows -- ", (string) x.Win_interp, "^^"; if (x provides Mac_interp) print "* Macintosh -- ", (string) x.Mac_interp, "^^"; if (x provides OS2_interp) print "* OS/2 -- ", (string) x.OS2_interp, "^^"; if (x provides Lnx_interp) print "* Linux -- ", (string) x.Lnx_interp, "^^"; if (x provides Unix_interp) print "* Unix -- ", (string) x.Unix_interp, "^^"; if (x provides Amg_interp) print "* Amiga -- ", (string) x.Amg_interp, "^^"; if (x provides Other_interp) print "* Other -- ", (string) x.Other_interp, "^^"; } print (The) self, " is currently toggled in the "; switch (self.state) { 0: print "unset"; 1: print "on"; 2: print "off"; } " position."; ], state 0, type "unclassified", classtype DOS_Game, before [; Examine: self.description(); rtrue; Push, Pull, Turn, Flip: if (self has on) <>; else <>; SwitchOff: if (self.state == 0) { give self on; } ], after [x; SwitchOn: self.state = 1; objectloop (x ofclass self.classtype) { if (x.year == the_year) move x to play_bin; } "As you flip the switch, all the ", (string) self.type, " games in the room shimmer out of existence, then reappear in the bin marked 'Playable Games'."; SwitchOff: self.state = 2; objectloop (x ofclass self.classtype) { if (x.year == the_year) move x to noplay_bin; } "As you flip the switch, all the ", (string) self.type, " games in the room shimmer out of existence, then reappear in the bin marked 'Unplayable Games'."; ], has switchable; Object switches "switch rack" Room with name 'rack' 'switches' 'of' 'switch', describe "^A switch rack is on the wall; one switch for each type of game system.", description [x; print "There are switches for each game system here. Flipping one on will move all games of that system to the 'playable' bin. Turning one off will move all games of that system to the 'unplayable' bin.^^"; objectloop (x in self) { print "The ", (string) x.type, " switch is "; switch (x.state) { 0: print "unset"; 1: print "on"; 2: print "off"; } print ".^"; } ], has transparent static; Object unused_switches "Unused switch rack"; Switch -> i_switch "Inform switch" with name 'Inform' 'DOS' 'Windows' 'IBM' 'OS2' 'OS/2' 'linux' 'unix' 'amiga' 'mac' 'macintosh' 'acorn' 'bebox' 'atari' 'apple' 'iigs', type "Inform", classtype Inform_Game; Switch -> t_switch "TADS switch" with name 'TADS' 'DOS' 'IBM' 'OS2' 'OS/2' 'linux' 'unix' 'amiga' 'mac' 'macintosh' 'acorn' 'atari', type "TADS", classtype TADS_Game; Switch -> h_switch "Hugo switch" with name 'hugo' 'DOS' 'IBM' 'OS2' 'OS/2' 'linux' 'unix' 'amiga' 'non-mac' 'non-macintosh' 'acorn', type "Hugo", classtype Hugo_Game; Switch -> al_switch "ALAN switch" with name "alan" "DOS" "IBM" "Amiga" "Mac" "macintosh" "Linux" "Unix" 'non-os/2' 'non-acorn', type "ALAN", classtype ALAN_Game; Switch -> ag_switch "AGT switch" with name 'AGT' 'DOS' 'IBM' 'Mac' 'Macintosh' 'linux' 'amiga' 'unix' 'non-acorn' 'non-os/2', type "AGT", classtype AGT_Game; Switch -> j_switch "JACL switch" with name "jacl" "DOS" "IBM" "Linux" "dos-only" 'non-acorn' 'non-os/2' 'non-mac' 'non-macintosh' 'non-amiga', type "JACL", classtype JACL_Game; Switch -> r_switch "REXX-Adventure switch" with name "OS/2" "OS2" "OS_2" "REXX" "Adventure" 'rexx-adventure' 'non-ibm' 'non-acorn' 'non-mac' 'non-macintosh', type "REXX-Adventure", classtype REXX_Game; Switch -> d_switch "DOS executable switch" with name 'miscellaneous' 'other' 'random' 'misc' 'DOS' 'IBM' 'non-Linux' 'dos-only' 'non-acorn' 'non-os/2' 'msdos' 'non-mac' 'non-macintosh' 'non-amiga' 'executable', type "DOS executable", classtype DOS_Game; Switch -> htm_switch "HTML switch" with name 'html' 'java' 'javascript' 'script', type "HTML", classtype HTML_Game; Switch -> era_switch "Erasmatron switch" with name 'erasmatron' 'erasmaganza' 'orgasmatron', type "Erasmatron", classtype Erasma_Game; Switch -> raif_switch "RAIF-POOL switch" with name 'raif' 'pool' 'raif-pool', type "RAIF-POOL", classtype RAIF_Game; Object game_rack "rack on the wall" with name "rack" "panel", initial [; print_ret "There is a rack on the wall here with ", (number) GamesIn(self), " games, all sorted and lined up in their slots, ready for you to play and rate them. A square button to one side of the rack is marked 'Save Rating Information', while a round button is marked 'Save All Information'"; ], description [i j x; print "Here is your personalized list of games, and the order in which you should play them:^^"; font off; print " Title: "; for (i=0: i<(self.max_title_len-10) :i++) print " "; print "Rating:^^"; for (i=1:i<=children(self):i++) { switch(i) { 1 to 9: print " "; } print i, ": "; x = child(self); while (x.ranking ~= i) x=sibling(x); print "~", (string) x.short_name, "~"; if (x.rating~=0) { for (j=0: j<(self.max_title_len-x.title_length+1) :j++) print " "; print x.rating; } print "^"; } font on; ], max_title_len 0, before [; Push: <>; LetGo: if (noun in self) "The games are already sorted. If you want to manipulate them, push the lever again."; Receive: "The games are already sorted. If you want to add one, push the lever again and add it to the bin for playable games."; ], has container static open; [GamesIn obj i x; objectloop (x in obj) if (x ofclass Game) i++; return i;]; Object button "two buttons" with parse_name [ i flag type; for (: flag == 0: i++) { flag = 1; switch(NextWord()) { 'two', 'button', 'buttons': flag = 0; 'square': if (type == 0) { flag = 0; type = 1; } 'round', 'circular': if (type == 0) { flag = 0; type = 2; } } } self.number=type; return i-1; ], description [; switch (self.number) { 0: "There are two buttons, a square one marked 'Save Rating Information', and a round one marked 'Save All Information'."; 1: "The square button is marked 'Save Rating Information'."; 2: "The round button is marked 'Save All Information'."; } ], number 0, before [; Push, SwitchOn: if (self.number == 0) "You'll have to say which button to press."; if (SaveInfo(self.number)) "Your rating information has been saved in the file 'rating.txt' (unless you were prompted to change the filename)."; else "I tried to save your rating information, but was told I was unsuccessful. (This may be because there was no information to save.)"; ], has static concealed; Array Rating_Info -> 2048; Array Rating_Buffer -> 100; Array filename_Buffer -> 100; Array ext_Buffer -> 100; Array file string "rating.txt"; [SaveInfo swtch ok x tot_len i j numgames; print "Saving,...^"; numgames = children(game_rack); for (j=0:j tot_len = '_'; tot_len++; 1 to 9: Rating_Info -> tot_len = ' '; tot_len++; } switch (x.rating) { 0: Rating_Info -> tot_len = '_'; tot_len++; 1: Rating_Info -> tot_len = '1'; tot_len++; 2: Rating_Info -> tot_len = '2'; tot_len++; 3: Rating_Info -> tot_len = '3'; tot_len++; 4: Rating_Info -> tot_len = '4'; tot_len++; 5: Rating_Info -> tot_len = '5'; tot_len++; 6: Rating_Info -> tot_len = '6'; tot_len++; 7: Rating_Info -> tot_len = '7'; tot_len++; 8: Rating_Info -> tot_len = '8'; tot_len++; 9: Rating_Info -> tot_len = '9'; tot_len++; 10: Rating_Info -> tot_len = '1'; tot_len++; Rating_Info -> tot_len = '0'; tot_len++; } Rating_Info -> tot_len = ':'; Rating_Info -> (tot_len+1) = ' '; tot_len = tot_len+2; (x.short_name).print_to_array(Rating_Buffer); for (i=0: i<(Rating_Buffer --> 0): i++) { Rating_Info -> (tot_len+i) = Rating_Buffer -> (i+2); } tot_len = tot_len+i; Rating_Info -> tot_len = ' '; tot_len++; Rating_Info -> tot_len = '('; tot_len++; (x.filename).print_to_array(filename_Buffer); for (i=0: i<(filename_Buffer --> 0): i++) { Rating_Info -> (tot_len+i) = filename_Buffer -> (i+2); } tot_len = tot_len+i; (x.ext).print_to_array(ext_Buffer); for (i=0: i<(ext_Buffer --> 0): i++) { Rating_Info -> (tot_len+i) = ext_Buffer -> (i+2); } tot_len = tot_len+i; Rating_Info -> tot_len = ')'; tot_len++; Rating_Info -> tot_len = 13; tot_len++; Rating_Info -> tot_len = 10; tot_len++; } } @save Rating_Info tot_len file ok; return ok; ]; Object generic_blurb Room !This is to trap people trying to read the blurb !on the backs of games. with name "blurb" "back", description "All the games have blurbs on them. I'm afraid you'll have to be more specific (or just 'READ ').", before [; Examine, Consult, Read: if ((second==nothing) && (old_itobj ofclass Game)) { <>; } ], has static concealed; Object next_game "next game" Room !This is to trap examination of the !next game they have to rate. with name 'next' 'game', mimics [x i max; if (game_rack notin Room) return nothing; x=child(game_rack); max=children(game_rack); for (i=1:i<=max:i++) { x=child(game_rack); while(x.ranking~=i) { x=sibling(x); } if (x.rating==0) return x; } return nothing; ], react_before [x; default: if (noun==self) { x = self.mimics(); if (x==nothing) "You can use 'next' as an alias for the first game down the list which you haven't rated. However, there is no 'next' right now."; noun=x; } if (second==self) { x = self.mimics(); if (x==nothing) "You can use 'next' as an alias for the first game down the list which you haven't rated. However, there is no 'next' right now."; second=x; } ], has static concealed; Object instructions "instructions" Room with name "instructions" "paper" "piece" "tacked" "piece", describe "^A piece of paper is tacked to one wall, with instructions.", before [; Examine, Consult: top.select(); rtrue; ], after [; Take: "You remove the paper from the wall."; Drop: "You tack the paper back up on the wall."; ]; Object postit "post-it note" Room with name 'note' 'post-it' 'post', description "~To find out about a particular system (like Inform) just type 'X INFORM' (The same will work with TADS, ALAN, and the rest of the game types in this competition.)~"; Object bigbutton "Big Red Button Which, If You Push It, Will Make You Do Everything You Really Need To Do Automatically" Room with name 'big' 'red' 'button' 'which' 'if' 'you' 'push' 'will' 'make' 'do' 'everything' 'really' 'need' 'to' 'automatically', description "It's a Big Red Button Which, If You Push It, Will Make You Do Everything You Really Need To Do Automatically. What more do you want to know?", before [; Push, Pull: self.operate(); rtrue; ], operate [x; print "As you push the button, a panel opens in the wall, revealing a huge laser, aimed at you! Before you can react, a green beam of light shoots out at you, and you can't move! Suddenly, you find yourself moving jerkily around the room.^"; if (game_rack in room) { print "^>PULL LEVER^"; ; } print "^>FLIP ALL SWITCHES ON^"; objectloop (x in switches) if (x ofclass Switch) ; print "^>PULL LEVER^"; ; print "^>PUSH ROUND BUTTON^"; button.number=2; ; print "^The laser pauses, and seems about to retract. Then it seems to think better of it, and controls your actions one more time, for good measure."; print "^>SCRIPT ON^"; ; print "^>EXAMINE RACK^"; ; print "^>SCRIPT OFF^"; ; "^Just as suddenly as it started, the laser releases you, and disappears back behind the panel. You are quite dazed, and the sparkles before your eyes seem to spell out ~That's it! You can print out your list and go play the games now!~ before they fade into nothingness."; ], has static; Include ">menus.h"; Include ">instruct"; Object ExtraBinHolder; Bin -> bin99 "bin for Comp '99"; Bin -> bin98 "bin for Comp '98"; Include ">games98"; Bin -> bin97 "bin for Comp '97"; Include ">games97"; Bin -> bin96 "bin for Comp '96"; Include ">games96"; Bin -> bin95 "bin for Comp '95"; Include ">games95"; Bin -> bin06 "bin for Comp '06"; Include ">games06"; [ReadSub; <>;]; [ PrintVerb v; if (v=='rate') { print "rate"; rtrue; } if (v=='read') { print "read"; rtrue; } rfalse; ]; Include "Grammar"; !Extensions so people can read the blurbs on the games. Extend "examine" * noun "on"/"of"/"from" noun -> ReadAbout * noun noun -> ReadAbout reverse; Extend "read" first * noun -> Read * noun "on"/"of"/"from" noun -> ReadAbout * noun noun -> ReadAbout reverse; Extend "look" * "at" noun "on"/"of"/"from" noun -> ReadAbout * "at" noun noun -> ReadAbout reverse; [ ReadAboutSub; if (noun ~= generic_blurb) <>; if (~~(second ofclass Game)) "There is no blurb on that!"; <>; ]; !New verbs so people can (at least try) to play and rate games Verb "flip" * noun ->Flip; [FlipSub; if (noun has on) <>; else <>; ]; Verb "play" * -> Play * noun -> Play; [PlaySub; "Unfortunately, this interpreter does not allow you to play another game within this one. To play the game, exit and run the one you want to play. For more information about how this works, type 'X ', where is the system (i.e. TADS or Inform) of the game you wish to play.";]; Verb "rate" * noun -> Rate * noun number -> Rate * number number -> NumRate; Extend "give" *number "to" noun -> Rate reverse *number noun -> Rate reverse *noun number -> Rate *noun "a" number -> Rate *number number -> NumRate; [RateSub x checker; if (~~(noun ofclass game)) "You can only rate the games!"; if (game_rack notin Room) "Please sort the games you can play before you try to rate them. Simply put all games you can play in the 'playable' bin, the games you can't into the 'unplayable', and pull the lever."; if (noun notin game_rack) "I thought you said you couldn't play that game! If you can, you'll have to pull the lever again and re-sort the games."; x = child(game_rack); while (x~=nothing) { if ((x.ranking < noun.ranking) && (x.rating==0)) checker=1; x=sibling(x); } switch (second) { 0: "To rate a game, try 'rate game #', where '#' is a number from one to ten"; 1 to 10: noun.rating = second; if (checker==1) print "Rating the games out of order, huh? I'll let you get away with it, but you better have a good reason,...^Anyway, ~"; else print "Okay, ~"; print_ret (string) noun.short_name, "~ now has a rating of ", (number) noun.rating, "."; default: "You can only give a rating between one and ten."; } ]; [NumRateSub x; if (game_rack notin Room) "Please sort the games you can play before you try to rate them. Simply put all games you can play in the 'playable' bin, the games you can't into the 'unplayable', and pull the lever."; if (noun==0) "The list of games starts with '1'"; objectloop (x in game_rack) if (x.ranking==noun) { noun=x; <>; } "There is no game with that ranking right now."; ]; Extend "score" replace * ->MyScore *noun ->Rate *noun number ->Rate; [MyScoreSub x curr max; print "Isn't it fun to rate the games instead of having them rate you? Anyway, you "; if (game_rack notin location) "don't have any games available to rate yet."; objectloop (x in game_rack) { max++; if (x.rating~=0) curr++; } print_ret "have rated ", (number) curr, " out of a total of ", (number) max, " games available to you."; ]; Verb "help" "hint" "aargh" "info" "about" * ->Help; [HelpSub; top.select(); rtrue; ]; Extend 'switch' * multi ->SwitchOn * 'on' multi ->SwitchOn * 'off' multi ->SwitchOff * multi 'on' ->SwitchOn * multi 'off' ->SwitchOff; Extend 'flip' * multi ->Flip * 'on' multi ->SwitchOn * 'off' multi ->SwitchOff * multi 'on' ->SwitchOn * multi 'off' ->SwitchOff; Extend 'set' * 'on' multi ->SwitchOn * 'off' multi ->SwitchOff * multi 'on' ->SwitchOn * multi 'off' ->SwitchOff * multi 'to' 'on' ->SwitchOn * multi 'to' 'off' ->SwitchOff; Extend 'turn' * 'on' multi ->SwitchOn * 'off' multi ->SwitchOff * multi 'on' ->SwitchOn * multi 'off' ->SwitchOff * multi 'to' 'on' ->SwitchOn * multi 'to' 'off' ->SwitchOff; Extend 'examine' * 'in' container ->Search * 'in' noun ->Examine; Verb 'xyzzy' * ->Transform; Verb 'plugh' * ->Transform; ![XyzzySub; ! "You are magically transported to the only room in this game!"; !]; [TransformSub X; if (game_rack in Room) ; objectloop (x ofclass Game) { switch(x.year) { 99: move x to bin99; 98: move x to bin98; 97: move x to bin97; 96: move x to bin96; 95: move x to bin95; 6: move x to bin06; } } switch(the_year) { 99: !Change the year to '98 the_year = 98; remove rules99; move rules98 to top; EmptyInto(bin98, unsorted); 98: !Change the year to '97 the_year = 97; remove rules98; move rules97 to top; EmptyInto(bin97, unsorted); 97: !Change the year to '96 the_year = 96; remove rules97; move rules96 to top; EmptyInto(bin96, unsorted); 96: !Change the year to '95 the_year = 95; remove rules96; move rules95 to top; EmptyInto(bin95, unsorted); 95: !Change the year to '06 the_year = 6; remove rules95; move rules06 to top; EmptyInto(bin06, unsorted); 6: !Change the year to '99 the_year = 99; remove rules06; move rules99 to top; EmptyInto(bin99, unsorted); } EmptyInto(switches, unused_switches); objectloop(x in unsorted) { if (x ofclass Inform_Game) move i_switch to switches; if (x ofclass TADS_Game) move t_switch to switches; if (x ofclass Hugo_Game) move h_switch to switches; if (x ofclass ALAN_Game) move al_switch to switches; if (x ofclass AGT_Game) move ag_switch to switches; if (x ofclass JACL_Game) move j_switch to switches; if (x ofclass REXX_Game) move r_switch to switches; if (x ofclass DOS_Game) move d_switch to switches; if (x ofclass HTML_Game) move htm_switch to switches; if (x ofclass Erasma_Game) move era_switch to switches; if (x ofclass RAIF_Game) move raif_switch to switches; } objectloop (x in switches) { x.state=0; give x ~on; } total_games = children(unsorted); print "You utter a word of Power, and the room trembles in response! One by one, the games in the room begin to tremble and vibrate, phasing in and out with the room until they disappear completely. Then the 'unsorted' bin begins to rattle, and, as you watch, it fills up with a new batch of games.^^"; switch (the_year) { 6: "Odd, though. None of these games look even remotely familiar. And there's something strange about the air..."; 99: "Ah, there you go. You seem to be back where you started."; default: "The games all look new but something seems... ancient about them. As if you had gone back in time. The paper on the wall seems to have changed, too."; } ]; Verb 'waylay' *noun ->Waylay; [WaylaySub; if (noun==player) "You attempt to attack yourself, but, unlike a cat, you have no tail."; "You savagely attack ", (the) noun, ", but it remains impervious to your machinations."; ];