	X-BASED RUBIK'S CUBE(tm)
	====================	Magic cube X widgets, V5.0


    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		SunOS 5.4	X11R5
	PC, 486			Linux 1.0.9	X11R5(*)
	PC, 486			Linux 1.2.8	X11R6(**)

    *	Keypad 5 key may not work, in which case, try it with the
	Num-Lock on
    **	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
	xrubik  [motif version will be xmrubik]

    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
        xrubik

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

    You should have Rubik.ad (or Stupid.ad) copied to $(HOME)/Rubik or 
    /usr/lib/X11/app-defaults/Rubik to run, especially if the background
    is similar to one of the faces. Edit this file for your preferences.
    You might want to move xrubik into /usr/bin/X11 (or wherever your
    X binaries are).
    You might also want to move xrubik.man to /usr/man/man6/xrubik.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 cube.
      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 the number of cubes.
    'D' or 'd' to decrease the number of cubes.
    'O' or 'o' to toggle orient mode. (I prefer the orient mode since
      it is slightly more challenging).
    'S', 's' to auto-solve.  It only works on 1x1x1, 2x2x2, 3x3x3 cubes.
      For the 3x3x3 it only solves it in the non-orient mode.
    '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 2d rubik as:
        8
        ^
    4 < 5 > 6
        v
        2

    The key pad along with the use of the mouse will allow you to move the
    cube more than just CCW i.e.,
		KP_8=>TOP
    KP=>LEFT	KP_5=>CW	KP_6=>RIGHT
   		KP_2=>BOTTOM

    Key pad for 3d rubik, use your intuition (is this a cop out or what?).
    The key pad is defined differently depending on which side of the cube
    your mouse is pointing at. One thing that stays the same is KP_5=>CW.

    The control key allows you to move the whole cube 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 faces in orient mode, besides getting all the
    faces to be the same color. To do this one has to get the lines to
    be oriented in the same direction, this only matters with center
    cubes (i.e. those cubes not on a corner or edge). This does add
    complexity so there are 2 sets of records.

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

    The title is in the following format (non-motif version):
	xrubik{2|3}d: {1|2|3|4|5|6} @ (<Number of moves>/\
		{<Record number of moves>|NEVER|PRACTICE}) - <Comment>
    {2|3}: current dimensional view
    {1|2|3|4|5|6}: number of cubes per edge
    {<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 auto-solver, sorry. One of the problems in
    auto-solvers the generally don't work for different number of cuts.
    If you know of one let me know. There is a real neat 3x3x3 cube called
    "magiccube" with a better 3-D look, a auto-solver, and Motif. Use
    "archie" to find "magiccube" at the site nearest you.

    Also a tesseract (4D cube) would be nice. (I heard a 3^N cube has been
    built in software and solved!)

    Personally, I have solved 1-3 using this program, 2-5 using the
    physical cubes, and 6 to my knowledge have never been done (be the
    first on your block). If you want you can play with MAXCUBES and
    set it for 7 but then the graphics start messing up. 7 is neat
    because if it was a physical cube corner pieces would fall off when
    a face is turned.

    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
    cubelets.  The format will probably change to become more readable.
    Consider the 2d cross representation:

    size: 1-6 the number of cubes per row
    orient: 0 false, 1 true lines on cube to be oriented
    practice: 0 false, 1 true
    moves: 0-MAXINT
 
    starting position:
      0       R     where the starting unrandomized faces would be,
    1 2 3   Y W G   each face has size * size cubes
      4       O     if orient mode, orientation number follows face number
      5       B       0 up, 1 right, 2 down, and 3 left.

    This is then followed by the moves
    move #: face cublet_in_ith_column cubelet_in_jth_row direction control
      each turn is with respect to a cubelet face.  The first 3 numbers
      (after the ':') face, i, j, refer to the cubelet, followed by
      direction and control
    Direction is represented as 0 up, 1 right, 2 down, 3 left, 5 clockwise,
      and 7 counterclockwise.
    Control is represented as 0 or 1, 1 if the whole cube is moved at once
      (here i and j do not matter), 0 if not.  The xrubik record keeper
      does not count a control move as a move, but here we do. 

    Caution: the program may crash on corrupted input.

    If you have a Rubik's cube you can't solve (2x2x2 or 3x3x3) enter
    it in rubik.data file.  Have size = 2 or 3, orient = 0, practice = 0,
    randomized = 1, and moves = 0 and the number representation for the
    color of the cubelet faces (usually 0=R, 1=Y, 2=W, 3=G, 4=O, 5=B).
    Bring up xrubik, hit 'e' to enter your configuration and then 's' to
    solve your cube and then 'w' to write out the steps.  Then examine
    your rubik.data file. 

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

   [Oct 06, 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.
   [Mar 13, 95]	V4.9: Removed lint warnings and added a VMS make.com .
   [Nov 11, 94]	V4.8: Conservative guess for random number generator.
   [Oct 11, 94]	V4.7: Bug fix for save with undos.
   [Sep 28, 94]	V4.6: Now allows undos, saves, and recalls.
   [Aug 08, 94]	V4.5: Auto-solves from practice mode.
   [Jun 23, 94]	V4.4: Auto-solves up to 3x3x3 courtesy of
		Michael B. Martin <martinm@sps1.phys.vt.edu>.
   [Jun 15, 94]	V4.3: Mistakenly used a Boolean variable in an array.
   [Jun 02, 94]	V4.2: Minor changes, R6.
   [May 31, 94]	V4.1: Minor changes, record sometimes displayed "32767"
		instead of "NONE".
   [May 10, 94]	V4.0: Xt version.
		I got some good ideas from oclock.
   [May 20, 93]	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.
   [Jan 16, 92]	V2.0: XView version.
   [Jan 16, 91]	V1.0: SunView version.
