hints & hintcomp - a text adventure hints reader and compiler ============================================================= This was basically written so that I could read the Scott Adams hints without having to mentally work them out :) I have expanded it and rewritten the file format so that you can include extra bits of information, such as the name of the author of the hints etc. Note: The executables here are Arc executables The reader ========== To use ------ It is fully command-line driven and (should) work on any machine with a C compiler. The syntax is: hints [flags] [question] The flags are as follows: -f Show the full solution for question -h|-? Show the flags -i Show a hint on the question -k Show question -l List the questions and question numbers -t Show a tip on the question +d don't list hint file details +i don't list hint to solution +k don't show question The default settings are: show hint, show question, show details. The default question is 0. The -l switch also implies a '+ki' - If you require either the question or hint (or both) just add the switches AFTER the -l eg: hints fred -il will just list the questions, whereas hints fred -li will list the questions and the hint to question 0, but won't list the question. also there is a -- switch which will make the string after the -- be the input file (useful if your filename starts with a dash) and, of course a quote switch... :) The flags maybe placed anywhere on the command-line, either seperately, or in a block, eg hint -t pirate -l 1 +k +i hint -tl pirate 1 hint pirate 1 -tl +ki do the same thing, the only premise is that the filename MUST be placed before the question number. Question numbers start from 0. The order of importance of tips is: * hint - lowest importance * tip * full - highest importance File format ----------- The file consists of a set of directives, questions and words... Directives are preceded by a # and are as follows: #name - sets the name of the game as #author - sets the author of the hints as #info - any extra info #questions - there are questions #words - there are words Questions are preceded by a ? and are followed by 3 lines (LF terminated) which consist of the tip, hint and full solution resp.eg ? MUD DRIES UP A LOT? 130 26 79 93 77 93 6 49 77 Words consist of a number followed by the word. eg 1 HELLO 2 WORLD Spaces at the start are ignored (though not at end yet :) The parsing of the file isn't fully robust - it is not expected for these files to be manually created. Other bits ---------- If you want to get ALL the hints in a file, the best way to do it would be in a shell script, for example, in Yoonicks: NUMBERS=`hints ptt1.hint -l | cut -f ':' -d 1` for i in NUMBERS do hints -tif ptt1.hint $i >ptt1.all done Of course the above might not work straight off as I'm not typing this on a unix box :) I have deliberately not included the above so that the user has to want all the questions deliberately... Compiler ======== To use ------ All command line based, just: hintcomp the format of the infile is similar to that of the outfile - except the text of the questions are in proper text, not numbers and the #words and #questions directives are missing - also the dictionary isn't there, see sample file in files/uncompiled/ptt1 (files.uncompiled.ptt1 for arc) Copyright ========= All code produced here (except for the Scott Adams hint files) are (C) David Lodge 4th October 1994. And are to be distributed under the GNU licence, in essence: * You are allowed to spread, copy this as you want. * You can alter the source however you want to improve it. * You can upload it to your BBS or link it to your WWW page or make it available for ftp. And a personal bit: * You may not charge any more than a reasonable amount for passing this on. A reasonable amount is 1 UKP or LESS - You can send brand new discs in brand new jiffy bags for 58p so I don't see why certain PD libraries charge 2.50 UKP - I do not write code so that other people can fiscally profit from it... If you want to distribute this on a magazine disc then I would ask that you ask my permission first (I will probably allow you to - but be kind to us poor programmers) If you do alter it and sort out some of the many bugs then I just ask that you send me a copy first, so that I can have a version control on it. Contacts ======== You may contact me at: (until july 1995) snail: 17 Turnbull Road Longsight Manchester M13 0PZ England email: D.LODGE@uk03.wins.icl.co.uk (after sept 1995 you'll prob find me at se4dal@dmu.ac.uk) My 'permanent' base is: 26 Cleveland Way Carlton Miniott Thirsk N. Yorks YO7 4LN England Any donations will not go amiss... *hint* *hint* :) Thanx to: Admin of if-archive (can't remember his name :) The person who wrote the Adams hint sheets The person who wrote Scott Free Dominic Symes for Zap - an excellent editor for the arc... Paul David Doherty (sp - sorry :( Known bugs - reader =================== I make no apologies for the nasty code - I wrote the program in one night and haven't bothered too much to make it nice and robust... * Spaces not removed from end of string... And of course there'll be many more... The above should be easy to alter I just can't be bothered to load up my c compiler :) Remember: "No hope = No fear" - Peter Steele