Newsgroups: rec.arts.int-fiction
Path: nntp.gmd.de!Dortmund.Germany.EU.net!Germany.EU.net!howland.reston.ans.net!vixen.cso.uiuc.edu!usenet.ucs.indiana.edu!news.cs.indiana.edu!shulick@guava.ucs.indiana.edu
From: "Sam Hulick" <shulick@guava.ucs.indiana.edu>
Subject: Re: INFORM: Printing time and "Include"
Message-ID: <1995Aug29.142847.22983@news.cs.indiana.edu>
Organization: Vallen Software
References: <1995Aug27.150248.89979@rs6000.cmp.ilstu.edu> <1995Aug29.003939.24089@news.cs.indiana.edu>
Date: Tue, 29 Aug 1995 14:28:40 -0500
Lines: 44

"Sam Hulick" <shulick@guava.ucs.indiana.edu> writes:
>ceforma@rs6000.cmp.ilstu.edu (Christopher E. Forman) writes:
>>Another set of questions:
>>
>>1) Is there a standard function to print the time (in the game's text, not
>>   the status line)?
>
>Nope. there is now :)....
>
>[ TimeSub i;
>   print "The current time is ";
>   i = sline2 % 12;
>   if (i == 0) i = 12;
>   print i, ":";
>   if (sline3 < 10) print "0";
>   print sline3;
>   if ((sline2 / 12) > 0) print "pm.^"; else print "am.^";
>]; ! Umm, the slineX stuff may vary... this is just what I use in my game.
>  ! I have like four sline values,because my status line has score AND
>  ! time in it.
>
>Verb meta "time"
> *    -> Time;

I'm sorry, this is wrong.  It DOES work, but it is a silly hack.  Use
this instead:

[ TimeSub i div mod;
   div = the_time / 60;
   mod = the_time % 60;
   print "The current time is ";
   i = div % 12;
   if (i == 0) i = 12;
   print i, ":";
   if (mod < 10) print "0";
   print mod;
   if ((div / 12) > 0) print "pm.^"; else print "am.^";
];

-- 
--- 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
