Newsgroups: rec.arts.int-fiction
Path: nntp.gmd.de!Dortmund.Germany.EU.net!Germany.EU.net!howland.reston.ans.net!spool.mu.edu!news.cs.indiana.edu!shulick@guava.ucs.indiana.edu
From: "Sam Hulick" <shulick@guava.ucs.indiana.edu>
Subject: Re: Inform: Free code..in-game hints (FIX)
Message-ID: <1995Oct4.151047.5046@news.cs.indiana.edu>
Organization: Vallen Software
References: <1995Oct4.015056.1538@news.cs.indiana.edu>
Date: Wed, 4 Oct 1995 15:10:36 -0500
Lines: 62


Stupid me. :) putting silly limitations on something that need not be
limited!  Code change follows...

Carbon-copy: Gareth
Gareth, make these minor fixes to the hints.inf I posted, if you plan to
put it on your web page.  Now there is no 16-hint limit anymore, so this
code is more compact, AND it functions nicely. :)  Thanks.

"Sam Hulick" <shulick@mango.ucs.indiana.edu> wrote:
[..snip snip]

>Global hintflags = $0;   !get rid of this
>Global hintcount = 0;
>Array hint_array --> 30;
>
>Constant HOWOPENSAFE   $1;  ! change this to 1 (NOT $1)
>Constant WHYMANSCREAMS $2;  ! change this to 2 (not $2)
>Constant HOWGETOUT     $4;  ! .. to 3  (not $3)
>
[snip]

>Object cluebook "magic clue book"
> with  name "magic" "clue" "book" "clues",
>       description [;
[change "hintflags == $0" to "hintcount == 0"]
>          if (hintflags == $0) "The clue book is blank.  Confused, you \
>                                turn to the back, where it reads, \
>                                ~Clues will fill in automatically as \
>                                you encounter new problems.~";
>          return HintRoutine();
>       ],

< snip>

>[ AddHint bit;
>   if (hintflags & bit ~= 0) rfalse;
>   hintflags = hintflags | bit;
>   hint_array-->hintcount = bit;
>   hintcount++;
>];

Forget it.  New AddHint()

[ AddHint bit x;
   for (x = 0: x < hintcount: x++)
   { if (hint_array-->x == bit) rfalse; }
   hint_array-->hintcount = bit;
   hintcount++;
];

And everything else is fine.  Now this wil not limit you to 16 hints
anymore :)

If the original hint code expired, check the Inform web page.. Gareth
may have placed it there with the other stuff.

-- 
--- Sam Hulick ------------- shulick@indiana.edu ---------------------
Systems Consultant        | Homepage:
Indiana College Placement |    http://copper.ucs.indiana.edu/~shulick/
  and Assessment Center   | PGP public key available on request
