	X-BASED MASTERBALL(tm)
	==================	Masterball X widget, V4.10


    It has been tested on the following platforms:

	HP 3xx & 700		HP-UX 9.0x	X11R5
	Sun4, SPARC		SunOS 4.1.3	X11R4
	Sun4, SPARC		Solaris 2.3	X11R5
	PC, 486 (*)		Linux 1.0.9	X11R5

    *	Keypad 5 key may not work, in which case, try it with the
	Num-Lock on

    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?

    It should be easy. Edit the Imakefile (or Makefile.std, see below)
    for appropriate settings of variable SCOREFILE, RANDOM, then do:
	xmkmf
	make
	xmball

    If that does not work then:
	mv Imakefile Imakefile.r5
	sed 's/^XCOMM/\/\*\*\/#/' > Imakefile < Imakefile.r5
	xmkmf
	make
	xmball

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

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

ANYTHING SPECIAL IN USING?

    Click on the left mouse button to move CCW.
    Click on the middle mouse button toggle the practice mode. (This is
      good for learning moves).  Also 'P' or 'p' does the same thing.
      One must double click on the middle mouse button if the puzzle is
      being worked on.
    Click on the right mouse button if you want to randomize the wedges.
      Also 'R' or 'r' does the same thing.  One must double click on
      the right mouse button if the puzzle is being worked on.
    'I' or 'i' to increase or move up the number of latitude cuts.
    'D' or 'd' to decrease or move down the number of latitude cuts.
    'O' or 'o' to toggle orient mode.
    '2', '4', '6', or '8' (not the keypad 2, 4, 6, 8) to change to 2, 4,
      6, or 8 wedges, respectively.
      Note: if there were odd number of wedges, there would be no 180
      degree turn and therefore the puzzle would be inoperable.
    'S' or 's' to self-solve.  Unfortunately, its unimplemented.
    'U' or 'u' to undo last move.
    'E' or 'e' to enter saved puzzle.
    'W' or 'w' to write or save a puzzle.
    'Q', 'q', or Control-C to kill program.

    Key pad is defined for masterball as:
    7   8   9
        ^
    4 < 5 > 6
        v
    1   2   3

    The key pad along with the use of the mouse will allow you to move the
    wedges more than just CCW i.e.,
    KP_7=>TL	KP_8=>TOP	KP_9=>TR
    KP=>LEFT	KP_5=>CW	KP_6=>RIGHT
    KP_1=>BL	KP_2=>BOTTOM	KP_3=>BR

    The control feature allows you to move the whole masterball at
    once without being entered as a move.  Hold down the control key
    while using the left mouse button or the keypad.
 
    One has to orient the wedges in orient mode, besides getting all the
    wedges to be the same color. To do this one has to get the wedges
    with the numbers on one side and in order (clockwise).  This will add
    complexity, so there are 2 sets of records.

    Try resizing the masterball. Notice the puzzle resizes to take
    advantage of the "room" available.

    The title is in the following format:
	xmball.{2|4|6|8}: {1|2|3|4|5|6} @ (<Number of moves>/\
		{<Record number of moves>|NEVER|PRACTICE}) - <Comment>
    {2|4|6|8}: current number of wedges.
    {1|2|3|4|5|6}: number of sectors per wedge.
    {<Record...}: puzzle is either in practice mode or record mode
       In record mode, if there is no record of the current puzzle, it
       displays "NEVER".

    If you were looking for a self-solver, sorry. One of the problems in
    self-solvers the generally don't work for different number of cuts.
    If you know of one let me know.

    I know the look is not exactly right.  For simplicity, I did not take
    into account spherical placement of the latitude cuts.

    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 the standard notation is no good for variable number of
    "octas".  The format will probably change to become more readable.

    wedges: 1-8 number of wedges around ball
    rings: 1-6 number of slicess around ball
    orient: 0 false, 1 true  lines on "octa" to be oriented
    practice: 0 false, 1 true
    moves: 0-MAXINT

    starting position:
        0            Y
     7     1      D     B
                             if orient mode, orientation number
    6       2    C       R     follows face number clockwise numbered
                               like a clock except 0 is up
     5     3      O     M
        4            G

    This is then followed by the moves
    move #: wedge ring direction control
      each turn is with respect to a sector face.  The first 2 numbers
      (after the ':') wedge, ring, refer to the wedge and level,
      followed by direction and control
    Direction is represented as 0 up, 1 right, 2 down, 3 left, 4 upper right,
      5 lower right, 6 lower left, 7 upper left, 9 clockwise, and 15
      counterclockwise.
    Control is represented as 0 or 1, 1 if the whole octahedron is moved at
      once, 0 if not.  The xmball 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@source.asset.com

HISTORY

   [May 16, 95] V4.10: Warnings removed from Sun's cc and lint and now
                include a random number generator.
   [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: Minor changes.
   [Sep 15, 94]	V1.0: Xt version.
