		README for nhl -- NHL Schedule Program
				   
			   George Ferguson
		      ferguson@cs.rochester.edu
				   
			      6 Sep 1993


This file describes "nhl", a program for querying and displaying the
NHL regular season schedule. See the section INSTALLATION for
information on building an installing nhl. See the section UPDATING
for information about updating nhl for a new season.

CREDITS:

  Original program concept by Len Carr, used with permission.

  All other features created by Rob Springall (rgs7077@ultb.isc.rit.edu,
  rgs7077@ritvax.bitnet), except for the neutral site games feature,
  created by Tom Wilson (twilson@dab.ge.com).

  Maintained through 1992-93 season by: Valerie Hammerl
  (hammerl@acsu.buffalo.edu) and Rob Springall.

  Re-constructed for 1993-94 by George Ferguson (ferguson@cs.rochester.edu),
  who also added head-to-head modes, wrote the manpage and put together
  the distribution kit.

  1993-94 schedule data and beta testing by:
    Joseph Charles Ashkar <jca2@cec1.wustl.edu>
    Michael Collingridge <colling@ann-arbor.applicon.slb.com>
    John P. Curcio <jpc@philabs.philips.com>
    Mike (M.D.) D'Amico <miked77@bnr.ca>
    Valerie S. Hammerl <hammerl@acsu.buffalo.edu>
    Richard Hildebrand <rhh@tarheel.math.ufl.edu>
    Mark Holoubek <af042@Freenet.carleton.ca>
    Lori Iannamico <lli+@cs.cmu.edu>
    Mark Irwin <irwin@galton.uchicago.edu>
    Garry Knox <knox@monster.umd.edu>
    Carl J. Lunenfeld <lunenfcj@duvm.ocs.drexel.edu>
    Patrick MacRoberts <macro@hpcobr30.cup.hp.com>
    Kris Myers <kris@fs2.assist.uci.edu>
    David A. Ondzes <dao@scribe.mitre.org>
    John Michael Santore <jsbh+@andrew.cmu.edu>
    Andrew Scott <andrew@idacom.hp.com>
    Scott Simpson <simpson@bnr.ca>
    <diqman@ufcc.ufl.edu>
    <seth@hos1cad.att.com>

INSTALLATION:

  1. Edit Makefile as needed to set compiler flags and/or destination
     directories for your version of nhl. Since it doesn't use
     anything fancy, this should not be a problem. You don't have to
     use "make"; see steps (2) and (3).

  2. Type "make". If you don't have make, you can simply do:
	  % cc -o nhl nhl.c
     or some similar incantation. I told you it was easy.

  3. Type "make install" to install the executable and "make install.man"
     to install the manpage. If you don't have make, just install them
     by hand. Or don't install them (at least, not the manpages). It's
     not a big deal since there's built-in help.

UPDATING:

  All season-specific data is contained in the file "schedule.c",
  which is the only file you should have to change for a new season.
  This section describes what you have to do and, in part, why.
  Please share your updates with the rest of the world by posting
  them.

  1. Set the constants NHL_START_DATE and NHL_END_DATE to be strings
     of the form "MM/DD/YYYY". They must be strings (i.e., enclosed in
     double-quotes) and the year must have four digits. These are
     parsed into variables when nhl starts; the startup cost is small
     compared to how easy this makes it to update them. The constant
     NHL_START_DOW should be a capitalized string representing the
     day-of-the-week for the NHL_START_DATE. Check weekday[] in nhl.c
     for spelling if you're not sure. This is used as a base for
     day-of-the-week calculations that would otherwise require use of
     true Julian dates (which is no doubt overkill). Don't forget the
     double-quotes on this one either.

  2. In an expansion year, you will have to change the constant
     NUM_TEAMS and the teams[] array. This array should contain an
     entry for each team consisting of the city name, team nickname,
     and three-letter code, all of which should be strings.

  3. In a realignment or expansion year, you will have to change the
     constant NUM_DIVISIONS and the divisions[] array. This array
     should contain an entry for each division consisting of the
     division name, a list of the team codes for teams in the
     division, and a division code to be specified on the command line
     in head-to-head mode. The list of teams is parsed into a flags[]
     array for each division to make testing whether a team is in a
     division faster. Again, the startup cost of the parsing the list
     is outweighed by the ease of updating.

  4. The array special_dates[] contains entries for days for which
     there are no games scheduled and for which we would like to print
     a special message. These are typically the All-Star Game and the
     Holiday Break. Specify them with integers for month and day, and
     string to print on that day. End the array with a NULL string
     entry.

  5. The neutral_sites[] array contains strings representing each of
     the neutral site locations. Each city need only appear once (this
     was changed by GF for 93-94 from TW's original per-team scheme).

  6. Finally, the big one, the schedule[] array. Basically this array
     contains a string for each day of the season, each character of
     which specifies what the team in the corresponding location of
     the teams[] array is doing that day. A set of macros is defined
     for testing the meaning of the characters. Team codes index the
     teams[] array, site codes index teh neutral_sites[] array. 

     So long as the number of teams does not increase beyond 26, these
     macros do not have to change (even if the teams change names or
     cities as reflected in the teams[] array). Simply use the key
     given in schedule.c to fill out the strings, or rather, use the
     key to write some scripts that will do it for you.

     If the number of teams changes, then you have to do a bit more.
     You need to assign codes to the new teams and change the accessor
     and tester macros to handle them and properly map them into
     indices into the teams[] array. Since there are only 26 letters
     in the alphabet, you'll have to extend the current system. For
     example, you could add digits, to get:
     
     #define ISAWAYCODE(C)    (((C)>='a' && (C)<='z') || (C)>='0' && (C)<='9'))
     #define TEAMCODETOINDEX(C) ((int)(((C)>='a') ? ((C)-'a') : ((C)-'0'+26)))
     #define INDEXTOTEAMCODE(N) ((char)(((N)>=26) ? ((N)-26+'0') : ((N)+'a')))

     With these macros, you would use letter `a' to `z' for the first
     26 teams in teams[], then `0' to `9' for the next ten teams. That
     ought to tide us over for a while.

  7. I suggest saving the old schedule.c file for posterity, then
     trying to build and run it with your new schedule. This will make
     sure that all the run-time parsing of constants is ok. Once
     you've done that, tell the world!

HISTORY:
   6 Sep 1993:
    - Added -H and -A options.

  30 Aug 1993:
    - Don't include <sys/time.h> for MSDOS machines.
    - Use time() rather than gettimeofday() for MSDOS machines and ok
      for others.
      <Janusz_Ziemianski@mindlink.bc.ca> and others
    - Added -v flag and patchlevel.h file.

  20 Aug 1993: First official release.
