  X-BASED CUBES
  ============= Cubes X widget, V5.6.2

Primary site: ftp://ftp.tux.org/pub/tux/bagleyd/xpuzzles
Secondary site: ftp://ibiblio.org/pub/Linux/games/strategy
Web page: http://www.tux.org/~bagleyd/puzzles.html
Maintainer: David A. Bagley <bagleyd@tux.org>

  It has been tested on the following platforms:
    Sun Ultra 5     SunOS 5.8
    PC  Pentium 4   Linux 2.4.18
    PC  Pentium 4   WindowsXP/Cygwin
    IBM PowerPC     AIX 4.3.3.0

  Previous versions tested on:
    Sun Ultra       SunOS 5.6-5.7
    Sun SPARC       SunOS 5.5.1 (X11R5 & X11R6)
    Sun SPARC       SunOS 4.1.3
    PC  Pentium     Linux 2.0.9
    PC  486         Linux 1.2.13(*)
    DEC VAX & ALPHA VMS 6.1
    IBM PowerPC     AIX 4.3.1.0
    HP  898         HP-UX 10.20
    HP  3xx & 700   HP-UX 9.01

    * 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.  Also it may work better
      with the Num-Lock on.

  If you have to do any editing to get this to work, please mail me
  the changes.

HOW TO BUILD?

  An ANSI C compiler is required for build.

  To build, it should be easy.  There are 3 choices.

    configure:
      You may want to set SCOREFILE and DATAFILE in Makefile.in .

      configure ; make

    imake:
      Sometimes this is not setup correctly by the distributer ... i.e. not
      my fault.  You may want to set SCOREFILE and DATAFILE in Imakefile .
      If you have Motif you may want to do this quick edit in the Imakefile:
        Uncomment line "#define XmLibrary".

      xmkmf ; make

    make.com (VMS users only):
      You may want to set SCOREFILE and DATAFILE in make.com .

      @make

  Then just run "xcubes".  If you do a "make install" "SCOREFILE" and
  "DATAFILE" must be set correctly.

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

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

  If you were looking for a auto-solver, sorry.  I know the X11 "puzzle"
  shows the piece sliding, has a auto-solver, and a graphical image,
  but this program completes a theme with xtriangles and xhexagons. This
  program can be generalized to do a tesseract the puzzle gets no harder
  than the 2-D puzzle except its more tedious.

  Keep in mind that Cubes 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 and instructions
  on how to operate.

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

MATHEMATICAL STUFF USED IN CONSTRUCTION

  Assuming it is a box of i columns, j rows, and k stacks and the
  numbering starts from 1.
    Corner 1-> 1
           2-> i
           3-> i*j-i+1
           4-> i*j
           5-> i*j*k-i*j+1
           6-> i*j*k-i*j+i
           7-> i*j*k-i+1
           8-> i*j*k
    Center -> i%2 =>
           0: None
           1: ((i+1)/2)^3

    Max_Width -> i units
    Max_Height -> j units
    Max_Depth -> k units

    Start -> x=y=z=0
    Next -> n%i =>
           0: x= 0 units; y+= 1 unit
              if (y == j)
                 {y = 0 units; z+= 1 unit;}
           default: x+= 1 unit

    Same row? -> (m-1) / i == (n-1) / i
    Same column? -> ((m-1) % i == (n-1) % i) &&
                     ((m-1) / (i*j) == (n-1) / (i*j))
    Same stack? -> (m-1) % (i*j) == (n-1) % (i*j)

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
  be able to duplicate them.

HISTORY

  [Mar 21, 2003]  V5.6.2:
    Installation fixes for Motif and X versions.
  [Nov 06, 2002]  V5.6.1:
    VMS Motif fix and minor changes
  [Sep 06, 2002]  V5.6:
    configure if around 2nd AC_CHECK_FUNC
    removed Sun CC (char *) warnings
    removed hard coding of program name
    Cygwin changes ./, -lSM -lICE
    record store fix
    x and xm files combined using HAVE_MOTIF
    port back from Java (on the Java side I got some help from
        Sarat Chandran, saratcmahadevan@yahoo.com)
      use -1 for NEVER instead of 32767
      handle nobody = (null)
      .data->.dat for consistency
      frame color change on enter/leave
      background/foreground set by default
      allow more arrow keys (osf)
      menu
      3d tiles
      puzzle border changes
      clear
      swap column/row (internal representation)
      random swapping correction
      changed brick -> block
      PositionToBlock update
      reset maximum
      animation
  [Sep 01, 2001]  V5.5.4: g++ 3.0 warnings removed.
  [Mar 27, 2001]  V5.5.3: Infinite loop fix for ARM thanks to Matej Vela
    <mvela@public.srce.hr>.
  [Aug 11, 1999]  V5.5.2: Fixed runtime library problems when using configure.
  [Jul 31, 1999]  V5.5.1: Imakefile fix for xcubes, and removed HP usleep
    warning.
  [Jun 20, 1999]  V5.5: Added -rv, -mono, -base
  [Jan 01, 1997]  V5.4: Username, concurrency check, configure, man page
    updates.
  [Apr 08, 1996]  V5.3: Minor changes.
  [Jan 31, 1996]  V5.2: Tiles will invert, when selected.
    Now using dynamic allocation, so there is no maximum size.
  [Dec 15, 1995]  V5.1: Minor updates, RNG for 32/64 bit.
  [Oct 01, 1995]  V5.0: Xt/Motif, your choice.
  [May 16, 1995]  V4.10: Warnings removed from Sun's cc and lint and now
    include a random number generator.
  [Mar 13, 1995]  V4.4: Removed lint warnings and added a VMS make.com .
  [Nov 11, 1994]  V4.3: Conservative guess for random number generator.
  [Oct 25, 1994]  V4.2: Now allows undos, saves, and recalls.
  [Jun 28, 1994]  V4.1: Can accommodate a auto-solver.
  [Jun 07, 1994]  V4.0: Xt version.
    I got some good ideas from oclock.
  [Apr 01, 1993]  V3.0: Motif version.
    I got some good ideas from Douglas A. Young's
    book: "The X Window System Programming and Applications
    with Xt OSF/Motif Edition", particularly his dial widget.
    I got some good ideas on presentation from Q. Zhao's
    tetris.
  [Dec 19, 1991]  V2.0: XView version.
  [Aug 01, 1991]  V1.0: SunView version.
