	X-BASED MISSING LINK(tm)
	====================	Missing Link X widget, V5.3


    It has been tested on the following platforms:

	Sun4, SPARC		SunOS 4.1.3	X11R4
	Sun4, SPARC		SunOS 5.4	X11R5
	PC, 486			Linux 1.0.9	X11R5
	PC, 486			Linux 1.2.8	X11R6(*)

    *	Keypad may not work, since various keycodes may not be defined
	by default.  Check that "KP_1 - KP_9, Home, Up, Prior, Left,
	Begin, Right, End, Down, Next" are defined towards the end of
	/usr/lib/X11/etc/xmodmap.std .  If not defined
	cp /usr/lib/X11/etc/xmodmap.std /usr/lib/X11/xinit/.Xmodmap
	and then motify this or create your own at ${HOME}/.Xmodmap .
	You should just have to uncomment them (get rid of some '!').
	This should be done before X is started.

    If yours is not in this list, please let me know -- thanks. The
    most updated source could be found on ftp.x.org under
    /contrib/games/puzzles.

HOW TO BUILD?

    Do you have Motif?  If so, uncomment line 28 of Imakefile.

    It should be easy. Edit the Imakefile (or Makefile.std, see below)
    for appropriate settings of variable SCOREFILE, then do:
	xmkmf
	make
	xmlink  [motif version will be xmmlink]

    Note: if you don't have 'xmkmf' or the "Makefile" it generates
    does not work well, edit Makefile.std for appropriate settings for
    XINCLUDEPATH and XLIBPATH, then try:
	make -f Makefile.std
	xmlink

    or if you have Motif, uncomment appropriate sections, then try:
        make -f Makefile.std all.xm
	xmmlink

    You should have Mlink.ad copied to $(HOME)/Mlink or 
    /usr/lib/X11/app-defaults/Mlink to run, especially if the background
    is similar to one of the faces. Edit this file for your preferences.
    You might want to move xmlink into /usr/bin/X11 (or wherever your
    X binaries are).
    You might also want to move xmlink.man to /usr/man/man6/xmlink.6

    I also did not confirm that all the puzzles can be solved when
    randomized.  It does appear to be the case though.  The last few
    tiles are a trick to place.

    Monochrome users may have to run it with -tile Black or -tile White.
    or with -fg White or -fg Black.  Whatever works for you.

ANYTHING SPECIAL IN USING?

    Click on the left mouse button to move tile.  If you click and
      release on the same row with a blank all the tiles from there will
      move towards the space.  If you click and then release on a
      different row, then the tiles will "rotate" up or down depending
      where the click is released.
    Click on the right mouse button if you want to randomize the puzzle.
      Also 'R' or 'r' do the same thing.  One must double click on
      the right mouse button if the puzzle is being worked on.
    'O' or 'o' to toggle orient mode. (I prefer the orient mode since
      it is slightly more challenging) (Default is off).
    'M' or 'm' to toggle middle mode. All the middle tiles rotate
      together.  This is considerably more challenging (Default is on).
    'S' or 's' to auto-solve.  Unfortunately, its unimplemented.
    'U' or 'u' to undo last move.
    'G' or 'g' to get a saved puzzle.
    'W' or 'w' to write or save a puzzle.
    'Q', 'q', or Control-C to kill program.

    Key pad is defined for Mlink as:
        8 
        ^
    4 <   > 6
        v
        2

    Tiles can also be moved by the keypad,
               KP_8=>Top
    KP=>Left                 KP_6=>Right
               KP_2=>Bottom

    Notice one can move more than one tile at a time by clicking on the
    tile farthest from the space but in a row with the space.

    The shift key along with the up and down arrows or mouse allow one to
    rotate the whole puzzle.

    The control key allows you to change the complexity of xlink.  Hold
    down control key and use the keypad.
 
    The title is in the following format (non-motif version):
	xmlink: <int>x<int> {norm | ind} @ (<Number of moves>/\
		{<Record number of moves>|NEVER}) - <Comment>
    <int>x<int>: row by column.
    {norm | ind}: middle tiles rotate together or independent.
    {<Record...}: if there is no record of the current puzzle, it
       displays "NEVER".

    I chose to display the puzzle horizontally because if I ever decide
    to implement the auto-solver, it will be easier because the IDEAL
    solution book shows it that way.
 
    Keep in mind that Mlink is a widget that can be simply stuck in
    other X programs. (If you find a use for this, let me know).

    Refer to the man page for detailed command line options.

    If you want further information on puzzles, I'll be glad :-) to send
    it to you.

SAVE FORMAT

    The format is not standard.  The reason is that this is simple to
    produce and I do not know what the standard is.  The format will
    probably change to become more readable.

    tiles: number of tiles in a row
    faces: number of tiles in a column
    middle: 0 false, 1 true  middle moves as one unit
    orient: 0 false, 1 true  chain linked in order
    moves: 0-MAXINT

    startingPosition: array where 0 is the empty space

    This is then followed by the moves
    move #: direction tile shift
    Direction is represented as 0 up, 1 right, 2 down, and 3 left.
    Tile is the column of tile.
    Shift is represented as 0 or 1, 1 if the whole puzzle is moved at
      once (here Tile does not matter), 0 if not.  The xmlink record keeper
      does not count a control move as a move, but here we do.

    Caution: the program may crash on corrupted input.

FOUND A BUG?

    Send bugs reports and fixes to the author. For bugs, please include
    as much information as to their location as possible, since I may not
    have the resources to duplicate the them.

	David Albert Bagley,	bagleyd@hertz.njit.edu

HISTORY

  [Aug 01, 96]	V5.3.2: Fixed for default for monochrome.
  [Apr 08, 96]	V5.3: Minor changes.  Links are drawn now with the same
		orientation as the original.
  [Jan 31, 96]  V5.2: Now uses an intuitive drag and drop approach for
		rotating tiles.  Tiles will invert, when selected.
		Now using dynamic allocation, so there is no maximum size.
  [Dec 15, 95]	V5.1: Minor updates, RNG for 32/64 bit.  Better sector
		drawing algorithm.  Border color to make faces look more
		realistic.
  [Oct 01, 95]	V5.0: Xt/Motif, your choice.
  [May 16, 95] V4.10: Warnings removed from Sun's cc and lint and now
		include a random number generator.  Bug fixed where
		xmlink moved correctly but was hard to turn.
  [Mar 13, 95]	V1.4: Removed lint warnings and added a VMS make.com .
  [Nov 11, 94]	V1.3: Conservative guess for random number generator.
  [Nov 07, 94]	V1.2: Now allows undos, saves, and recalls.
  [Sep 19, 94]	V1.1: Initialize bug removed.
  [Aug 30, 94]	V1.0: Xt version.
