home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-05-15 | 59.5 KB | 1,762 lines |
- Newsgroups: comp.sources.misc
- From: fleurant@hri.com (P.Fleurant)
- Subject: v37i038: magiccube - a cube simulator for X11/Motif, Part01/05
- Message-ID: <csm-v37i038=magiccube.162752@sparky.IMD.Sterling.COM>
- X-Md4-Signature: ae469947ce34c680083cb5f03bd9a5b7
- Date: Mon, 10 May 1993 21:28:15 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: fleurant@hri.com (P.Fleurant)
- Posting-number: Volume 37, Issue 38
- Archive-name: magiccube/part01
- Environment: X11, Motif, ANSI-C
-
- This is a R*b*ks' Cube Simulator with a solver by Don Taylor.
-
- P.Fleurant Horizon Research, Inc.
- fleurant@hri.com Waltham, MA
- -----------------------
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then feed it
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # Contents: cube cube/LICENSE cube/cube.h cube/layer1corner.c cube/lib
- # cube/lib/Makefile
- # Wrapped by kent@sparky on Mon May 10 16:15:40 1993
- PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 1 (of 5)."'
- if test ! -d 'cube' ; then
- echo shar: Creating directory \"'cube'\"
- mkdir 'cube'
- fi
- if test -f 'cube/LICENSE' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'cube/LICENSE'\"
- else
- echo shar: Extracting \"'cube/LICENSE'\" \(17982 characters\)
- sed "s/^X//" >'cube/LICENSE' <<'END_OF_FILE'
- X GNU GENERAL PUBLIC LICENSE
- X Version 2, June 1991
- X
- X Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- X 675 Mass Ave, Cambridge, MA 02139, USA
- X Everyone is permitted to copy and distribute verbatim copies
- X of this license document, but changing it is not allowed.
- X
- X Preamble
- X
- X The licenses for most software are designed to take away your
- Xfreedom to share and change it. By contrast, the GNU General Public
- XLicense is intended to guarantee your freedom to share and change free
- Xsoftware--to make sure the software is free for all its users. This
- XGeneral Public License applies to most of the Free Software
- XFoundation's software and to any other program whose authors commit to
- Xusing it. (Some other Free Software Foundation software is covered by
- Xthe GNU Library General Public License instead.) You can apply it to
- Xyour programs, too.
- X
- X When we speak of free software, we are referring to freedom, not
- Xprice. Our General Public Licenses are designed to make sure that you
- Xhave the freedom to distribute copies of free software (and charge for
- Xthis service if you wish), that you receive source code or can get it
- Xif you want it, that you can change the software or use pieces of it
- Xin new free programs; and that you know you can do these things.
- X
- X To protect your rights, we need to make restrictions that forbid
- Xanyone to deny you these rights or to ask you to surrender the rights.
- XThese restrictions translate to certain responsibilities for you if you
- Xdistribute copies of the software, or if you modify it.
- X
- X For example, if you distribute copies of such a program, whether
- Xgratis or for a fee, you must give the recipients all the rights that
- Xyou have. You must make sure that they, too, receive or can get the
- Xsource code. And you must show them these terms so they know their
- Xrights.
- X
- X We protect your rights with two steps: (1) copyright the software, and
- X(2) offer you this license which gives you legal permission to copy,
- Xdistribute and/or modify the software.
- X
- X Also, for each author's protection and ours, we want to make certain
- Xthat everyone understands that there is no warranty for this free
- Xsoftware. If the software is modified by someone else and passed on, we
- Xwant its recipients to know that what they have is not the original, so
- Xthat any problems introduced by others will not reflect on the original
- Xauthors' reputations.
- X
- X Finally, any free program is threatened constantly by software
- Xpatents. We wish to avoid the danger that redistributors of a free
- Xprogram will individually obtain patent licenses, in effect making the
- Xprogram proprietary. To prevent this, we have made it clear that any
- Xpatent must be licensed for everyone's free use or not licensed at all.
- X
- X The precise terms and conditions for copying, distribution and
- Xmodification follow.
- X
- X GNU GENERAL PUBLIC LICENSE
- X TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
- X
- X 0. This License applies to any program or other work which contains
- Xa notice placed by the copyright holder saying it may be distributed
- Xunder the terms of this General Public License. The "Program", below,
- Xrefers to any such program or work, and a "work based on the Program"
- Xmeans either the Program or any derivative work under copyright law:
- Xthat is to say, a work containing the Program or a portion of it,
- Xeither verbatim or with modifications and/or translated into another
- Xlanguage. (Hereinafter, translation is included without limitation in
- Xthe term "modification".) Each licensee is addressed as "you".
- X
- XActivities other than copying, distribution and modification are not
- Xcovered by this License; they are outside its scope. The act of
- Xrunning the Program is not restricted, and the output from the Program
- Xis covered only if its contents constitute a work based on the
- XProgram (independent of having been made by running the Program).
- XWhether that is true depends on what the Program does.
- X
- X 1. You may copy and distribute verbatim copies of the Program's
- Xsource code as you receive it, in any medium, provided that you
- Xconspicuously and appropriately publish on each copy an appropriate
- Xcopyright notice and disclaimer of warranty; keep intact all the
- Xnotices that refer to this License and to the absence of any warranty;
- Xand give any other recipients of the Program a copy of this License
- Xalong with the Program.
- X
- XYou may charge a fee for the physical act of transferring a copy, and
- Xyou may at your option offer warranty protection in exchange for a fee.
- X
- X 2. You may modify your copy or copies of the Program or any portion
- Xof it, thus forming a work based on the Program, and copy and
- Xdistribute such modifications or work under the terms of Section 1
- Xabove, provided that you also meet all of these conditions:
- X
- X a) You must cause the modified files to carry prominent notices
- X stating that you changed the files and the date of any change.
- X
- X b) You must cause any work that you distribute or publish, that in
- X whole or in part contains or is derived from the Program or any
- X part thereof, to be licensed as a whole at no charge to all third
- X parties under the terms of this License.
- X
- X c) If the modified program normally reads commands interactively
- X when run, you must cause it, when started running for such
- X interactive use in the most ordinary way, to print or display an
- X announcement including an appropriate copyright notice and a
- X notice that there is no warranty (or else, saying that you provide
- X a warranty) and that users may redistribute the program under
- X these conditions, and telling the user how to view a copy of this
- X License. (Exception: if the Program itself is interactive but
- X does not normally print such an announcement, your work based on
- X the Program is not required to print an announcement.)
- X
- XThese requirements apply to the modified work as a whole. If
- Xidentifiable sections of that work are not derived from the Program,
- Xand can be reasonably considered independent and separate works in
- Xthemselves, then this License, and its terms, do not apply to those
- Xsections when you distribute them as separate works. But when you
- Xdistribute the same sections as part of a whole which is a work based
- Xon the Program, the distribution of the whole must be on the terms of
- Xthis License, whose permissions for other licensees extend to the
- Xentire whole, and thus to each and every part regardless of who wrote it.
- X
- XThus, it is not the intent of this section to claim rights or contest
- Xyour rights to work written entirely by you; rather, the intent is to
- Xexercise the right to control the distribution of derivative or
- Xcollective works based on the Program.
- X
- XIn addition, mere aggregation of another work not based on the Program
- Xwith the Program (or with a work based on the Program) on a volume of
- Xa storage or distribution medium does not bring the other work under
- Xthe scope of this License.
- X
- X 3. You may copy and distribute the Program (or a work based on it,
- Xunder Section 2) in object code or executable form under the terms of
- XSections 1 and 2 above provided that you also do one of the following:
- X
- X a) Accompany it with the complete corresponding machine-readable
- X source code, which must be distributed under the terms of Sections
- X 1 and 2 above on a medium customarily used for software interchange; or,
- X
- X b) Accompany it with a written offer, valid for at least three
- X years, to give any third party, for a charge no more than your
- X cost of physically performing source distribution, a complete
- X machine-readable copy of the corresponding source code, to be
- X distributed under the terms of Sections 1 and 2 above on a medium
- X customarily used for software interchange; or,
- X
- X c) Accompany it with the information you received as to the offer
- X to distribute corresponding source code. (This alternative is
- X allowed only for noncommercial distribution and only if you
- X received the program in object code or executable form with such
- X an offer, in accord with Subsection b above.)
- X
- XThe source code for a work means the preferred form of the work for
- Xmaking modifications to it. For an executable work, complete source
- Xcode means all the source code for all modules it contains, plus any
- Xassociated interface definition files, plus the scripts used to
- Xcontrol compilation and installation of the executable. However, as a
- Xspecial exception, the source code distributed need not include
- Xanything that is normally distributed (in either source or binary
- Xform) with the major components (compiler, kernel, and so on) of the
- Xoperating system on which the executable runs, unless that component
- Xitself accompanies the executable.
- X
- XIf distribution of executable or object code is made by offering
- Xaccess to copy from a designated place, then offering equivalent
- Xaccess to copy the source code from the same place counts as
- Xdistribution of the source code, even though third parties are not
- Xcompelled to copy the source along with the object code.
- X
- X 4. You may not copy, modify, sublicense, or distribute the Program
- Xexcept as expressly provided under this License. Any attempt
- Xotherwise to copy, modify, sublicense or distribute the Program is
- Xvoid, and will automatically terminate your rights under this License.
- XHowever, parties who have received copies, or rights, from you under
- Xthis License will not have their licenses terminated so long as such
- Xparties remain in full compliance.
- X
- X 5. You are not required to accept this License, since you have not
- Xsigned it. However, nothing else grants you permission to modify or
- Xdistribute the Program or its derivative works. These actions are
- Xprohibited by law if you do not accept this License. Therefore, by
- Xmodifying or distributing the Program (or any work based on the
- XProgram), you indicate your acceptance of this License to do so, and
- Xall its terms and conditions for copying, distributing or modifying
- Xthe Program or works based on it.
- X
- X 6. Each time you redistribute the Program (or any work based on the
- XProgram), the recipient automatically receives a license from the
- Xoriginal licensor to copy, distribute or modify the Program subject to
- Xthese terms and conditions. You may not impose any further
- Xrestrictions on the recipients' exercise of the rights granted herein.
- XYou are not responsible for enforcing compliance by third parties to
- Xthis License.
- X
- X 7. If, as a consequence of a court judgment or allegation of patent
- Xinfringement or for any other reason (not limited to patent issues),
- Xconditions are imposed on you (whether by court order, agreement or
- Xotherwise) that contradict the conditions of this License, they do not
- Xexcuse you from the conditions of this License. If you cannot
- Xdistribute so as to satisfy simultaneously your obligations under this
- XLicense and any other pertinent obligations, then as a consequence you
- Xmay not distribute the Program at all. For example, if a patent
- Xlicense would not permit royalty-free redistribution of the Program by
- Xall those who receive copies directly or indirectly through you, then
- Xthe only way you could satisfy both it and this License would be to
- Xrefrain entirely from distribution of the Program.
- X
- XIf any portion of this section is held invalid or unenforceable under
- Xany particular circumstance, the balance of the section is intended to
- Xapply and the section as a whole is intended to apply in other
- Xcircumstances.
- X
- XIt is not the purpose of this section to induce you to infringe any
- Xpatents or other property right claims or to contest validity of any
- Xsuch claims; this section has the sole purpose of protecting the
- Xintegrity of the free software distribution system, which is
- Ximplemented by public license practices. Many people have made
- Xgenerous contributions to the wide range of software distributed
- Xthrough that system in reliance on consistent application of that
- Xsystem; it is up to the author/donor to decide if he or she is willing
- Xto distribute software through any other system and a licensee cannot
- Ximpose that choice.
- X
- XThis section is intended to make thoroughly clear what is believed to
- Xbe a consequence of the rest of this License.
- X
- X 8. If the distribution and/or use of the Program is restricted in
- Xcertain countries either by patents or by copyrighted interfaces, the
- Xoriginal copyright holder who places the Program under this License
- Xmay add an explicit geographical distribution limitation excluding
- Xthose countries, so that distribution is permitted only in or among
- Xcountries not thus excluded. In such case, this License incorporates
- Xthe limitation as if written in the body of this License.
- X
- X 9. The Free Software Foundation may publish revised and/or new versions
- Xof the General Public License from time to time. Such new versions will
- Xbe similar in spirit to the present version, but may differ in detail to
- Xaddress new problems or concerns.
- X
- XEach version is given a distinguishing version number. If the Program
- Xspecifies a version number of this License which applies to it and "any
- Xlater version", you have the option of following the terms and conditions
- Xeither of that version or of any later version published by the Free
- XSoftware Foundation. If the Program does not specify a version number of
- Xthis License, you may choose any version ever published by the Free Software
- XFoundation.
- X
- X 10. If you wish to incorporate parts of the Program into other free
- Xprograms whose distribution conditions are different, write to the author
- Xto ask for permission. For software which is copyrighted by the Free
- XSoftware Foundation, write to the Free Software Foundation; we sometimes
- Xmake exceptions for this. Our decision will be guided by the two goals
- Xof preserving the free status of all derivatives of our free software and
- Xof promoting the sharing and reuse of software generally.
- X
- X NO WARRANTY
- X
- X 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
- XFOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
- XOTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
- XPROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
- XOR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- XMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
- XTO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
- XPROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
- XREPAIR OR CORRECTION.
- X
- X 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
- XWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
- XREDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
- XINCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
- XOUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
- XTO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
- XYOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
- XPROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
- XPOSSIBILITY OF SUCH DAMAGES.
- X
- X END OF TERMS AND CONDITIONS
- X
- X Appendix: How to Apply These Terms to Your New Programs
- X
- X If you develop a new program, and you want it to be of the greatest
- Xpossible use to the public, the best way to achieve this is to make it
- Xfree software which everyone can redistribute and change under these terms.
- X
- X To do so, attach the following notices to the program. It is safest
- Xto attach them to the start of each source file to most effectively
- Xconvey the exclusion of warranty; and each file should have at least
- Xthe "copyright" line and a pointer to where the full notice is found.
- X
- X <one line to give the program's name and a brief idea of what it does.>
- X Copyright (C) 19yy <name of author>
- X
- X This program is free software; you can redistribute it and/or modify
- X it under the terms of the GNU General Public License as published by
- X the Free Software Foundation; either version 2 of the License, or
- X (at your option) any later version.
- X
- X This program is distributed in the hope that it will be useful,
- X but WITHOUT ANY WARRANTY; without even the implied warranty of
- X MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- X GNU General Public License for more details.
- X
- X You should have received a copy of the GNU General Public License
- X along with this program; if not, write to the Free Software
- X Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- X
- XAlso add information on how to contact you by electronic and paper mail.
- X
- XIf the program is interactive, make it output a short notice like this
- Xwhen it starts in an interactive mode:
- X
- X Gnomovision version 69, Copyright (C) 19yy name of author
- X Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- X This is free software, and you are welcome to redistribute it
- X under certain conditions; type `show c' for details.
- X
- XThe hypothetical commands `show w' and `show c' should show the appropriate
- Xparts of the General Public License. Of course, the commands you use may
- Xbe called something other than `show w' and `show c'; they could even be
- Xmouse-clicks or menu items--whatever suits your program.
- X
- XYou should also get your employer (if you work as a programmer) or your
- Xschool, if any, to sign a "copyright disclaimer" for the program, if
- Xnecessary. Here is a sample; alter the names:
- X
- X Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- X `Gnomovision' (which makes passes at compilers) written by James Hacker.
- X
- X <signature of Ty Coon>, 1 April 1989
- X Ty Coon, President of Vice
- X
- XThis General Public License does not permit incorporating your program into
- Xproprietary programs. If your program is a subroutine library, you may
- Xconsider it more useful to permit linking proprietary applications with the
- Xlibrary. If this is what you want to do, use the GNU Library General
- XPublic License instead of this License.
- END_OF_FILE
- if test 17982 -ne `wc -c <'cube/LICENSE'`; then
- echo shar: \"'cube/LICENSE'\" unpacked with wrong size!
- fi
- # end of 'cube/LICENSE'
- fi
- if test -f 'cube/cube.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'cube/cube.h'\"
- else
- echo shar: Extracting \"'cube/cube.h'\" \(14880 characters\)
- sed "s/^X//" >'cube/cube.h' <<'END_OF_FILE'
- X/**********************************************************************************
- X * cube.h: declarations for the cube program
- X *The following references were used:
- X "The X Window System Programming And Applications with Xt
- X OSF/MOTIF EDITION"
- X by Douglas A Young
- X Prentice-Hall, 1990.
- X ISBN 0-13-642786-3
- X
- X "Mastering Rubik's Cube"
- X by Don Taylor
- X An Owl Book; Holt, Rinehart and Winston, New York, 1980
- X ISBN 0-03-059941-5
- X
- X-------------------------------------------------------------------
- XCopyright (C) 1993 by Pierre A. Fleurant
- XPermission is granted to copy and distribute this program
- Xwithout charge, provided this copyright notice is included
- Xin the copy.
- XThis Software is distributed on an as-is basis. There will be
- XABSOLUTELY NO WARRANTY for any part of this software to work
- Xcorrect. In no case will the author be liable to you for damages
- Xcaused by the usage of this software.
- X-------------------------------------------------------------------
- X */
- X
- X#include <X11/StringDefs.h>
- X#include <X11/cursorfont.h>
- X#include <X11/Intrinsic.h>
- X#include <X11/Xutil.h>
- X#include <Xm/Xm.h>
- X#include <Xm/DrawingA.h>
- X#include <Xm/RowColumn.h>
- X#include <Xm/Form.h>
- X#include <Xm/PushB.h>
- X#include <Xm/ToggleB.h>
- X#include <Xm/Label.h>
- X#include <math.h>
- X#include "libXs.h"
- X
- X#define DEFAULT_DELTA_ANGLE 30
- X
- X/* application context, display */
- XXtAppContext appContext;
- XDisplay *xDisplay;
- X
- X/* #define MotifBC YES */
- X
- XBoolean Draw_Enable = TRUE;
- XBoolean Cube_Side_Chosen = FALSE;
- XBoolean Fill_Pattern_Chosen = FALSE;
- X
- X/* Used for cornermap array. See align_subfaces in cube.c */
- Xtypedef struct {
- X int a;
- X int b;
- X int c;
- X} Corner;
- X
- X/* Used for edge array. See align_subfaces in cube.c */
- Xtypedef struct {
- X int a;
- X int b;
- X} Edge;
- X
- X/* help information */
- X
- Xchar *tophelp_str[] = {
- X "Init Cube: init cube to pattern desired",
- X "Pristine: to start with a pristine cube",
- X "Quit: exit",
- X "rotate,spin,flip: turns whole cube",
- X "!front, !left, !right,...: operates on 1/3 of cube",
- X " ",
- X " ",
- X "",""};
- X
- Xstatic unsigned char fg_bitmap[32] = {
- X 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* solid foreground */
- X 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- X 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- X 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
- X};
- X#define fg_width 16
- X#define fg_height 16
- X
- X/* the initial colors of the 6 sides of the cube */
- Xchar *seed_color[] = {
- X/* 0 1 2 3 4 5
- X front left right back top bottom
- X */
- X "red", "yellow", "orange", "light grey", "blue", "green"
- X};
- X
- X/* the names of the 6 sides of the cube */
- Xchar *side_names[] = {
- X "front", "left", "right", "back", "top", "bottom"
- X};
- X
- X/* Menu bar data */
- Xextern void spin_it();
- Xextern void rot_it();
- Xextern void flip_it();
- Xextern void quit_it();
- Xextern void init_cube();
- Xextern void clear_draw();
- Xextern void cubik_front();
- Xextern void cubik_left();
- Xextern void cubik_right();
- Xextern void cubik_back();
- Xextern void cubik_top();
- Xextern void cubik_bottom();
- X
- X/*
- X * Create the list of menu items for a sub menu pane.
- X */
- Xstatic xs_menu_struct OpData[] = {
- X {"rotate", rot_it, "ignore", NULL, 0, NULL},
- X {"spin", spin_it, "ignore", NULL, 0, NULL},
- X {"flip", flip_it, "ignore", NULL, 0 ,NULL},
- X {"!front", cubik_front, "ignore", NULL, 0, NULL},
- X {"!left", cubik_left, "ignore", NULL, 0, NULL},
- X {"!right", cubik_right, "ignore", NULL, 0, NULL},
- X {"!back", cubik_back, "ignore", NULL, 0, NULL},
- X {"!top", cubik_top, "ignore", NULL, 0, NULL},
- X {"!bottom",cubik_bottom, "ignore", NULL, 0, NULL}
- X};
- X
- X/*
- X * Describe the menu bar, giving only the names to appear in
- X * the menu bar and pointers to each pulldown pane.
- X */
- Xstatic xs_menu_struct PulldownData[] = {
- X {"Operate" , NULL, NULL,
- X OpData, XtNumber(OpData), NULL}
- X};
- X
- X/* Old cube0 values.
- X #define MR_X 150
- X #define MR_Y 125
- X #define Z_DEPTH 0
- X*/
- X/* With following values cube is centered about (0,0,0) */
- X#define MR_X (-75)
- X#define MR_Y (-75)
- X#define Z_DEPTH (-75)
- X
- X#define WINDOW_CENTER_X 225
- X#define WINDOW_CENTER_Y 200
- X
- X#define PROJECTION_DEPTH 500
- X#define FACE0_WIDTH 50
- X#define FACE0_HEIGHT 50
- X#define NUM_SUBPLANES 54
- X#define NUM_CUBIKPLANES 21 /* number of planes moved in cubikked op; 1/3 of cube moved */
- X
- X
- X/* Double_XPoint arrays are used for all double calculations so that rotated, flipped,
- X or spin'ed face does not look bad after many small increments of rotation.
- X The z coordnate is used to preserve info when spin`ed or flipped. The routine
- X shortface() converts the double_XPoint array to the regular XPoint array for drawing */
- Xtypedef struct {
- X double x;
- X double y;
- X double z;
- X}double_XPoint;
- X
- X/* seed_face coordinates use mode=CoordModePrevious. They are converted to mode=CoordModeOrigin later. */
- Xdouble_XPoint rot_face[NUM_SUBPLANES][5]; /* the last spin'ed, flipped, or rotated face */
- Xdouble_XPoint cubik_face[NUM_SUBPLANES][5]; /* the cubikked face, a face that is turned only-1/3 of cube */
- Xdouble_XPoint seed_face[][5] = {
- X
- X /* Side 0 (front)*/
- X {MR_X, MR_Y, Z_DEPTH},
- X {FACE0_WIDTH,0,0},{0,FACE0_HEIGHT,0},{-FACE0_WIDTH,0,0},{0,-FACE0_HEIGHT,0},
- X {MR_X+FACE0_WIDTH, MR_Y, Z_DEPTH},
- X {FACE0_WIDTH,0,0},{0,FACE0_HEIGHT,0},{-FACE0_WIDTH,0,0},{0,-FACE0_HEIGHT,0},
- X {MR_X+2*FACE0_WIDTH, MR_Y, Z_DEPTH},
- X {FACE0_WIDTH,0,0},{0,FACE0_HEIGHT,0},{-FACE0_WIDTH,0,0},{0,-FACE0_HEIGHT,0},
- X
- X {MR_X, MR_Y+FACE0_HEIGHT, Z_DEPTH},
- X {FACE0_WIDTH,0,0},{0,FACE0_HEIGHT,0},{-FACE0_WIDTH,0,0},{0,-FACE0_HEIGHT,0},
- X {MR_X+FACE0_WIDTH, MR_Y+FACE0_HEIGHT, Z_DEPTH},
- X {FACE0_WIDTH,0,0},{0,FACE0_HEIGHT,0},{-FACE0_WIDTH,0,0},{0,-FACE0_HEIGHT,0},
- X {MR_X+2*FACE0_WIDTH, MR_Y+FACE0_HEIGHT, Z_DEPTH},
- X {FACE0_WIDTH,0,0},{0,FACE0_HEIGHT,0},{-FACE0_WIDTH,0,0},{0,-FACE0_HEIGHT,0},
- X
- X {MR_X, MR_Y+2*FACE0_HEIGHT, Z_DEPTH},
- X {FACE0_WIDTH,0,0},{0,FACE0_HEIGHT,0},{-FACE0_WIDTH,0,0},{0,-FACE0_HEIGHT,0},
- X {MR_X+FACE0_WIDTH, MR_Y+2*FACE0_HEIGHT, Z_DEPTH},
- X {FACE0_WIDTH,0,0},{0,FACE0_HEIGHT,0},{-FACE0_WIDTH,0,0},{0,-FACE0_HEIGHT,0},
- X {MR_X+2*FACE0_WIDTH, MR_Y+2*FACE0_HEIGHT, Z_DEPTH},
- X {FACE0_WIDTH,0,0},{0,FACE0_HEIGHT,0},{-FACE0_WIDTH,0,0},{0,-FACE0_HEIGHT,0},
- X
- X /* Side 1 (left) */
- X {MR_X, MR_Y, Z_DEPTH},
- X {0,0,FACE0_WIDTH},{0,FACE0_HEIGHT,0},{0,0,-FACE0_WIDTH},{0,-FACE0_HEIGHT,0},
- X {MR_X, MR_Y, Z_DEPTH+FACE0_WIDTH},
- X {0,0,FACE0_WIDTH},{0,FACE0_HEIGHT,0},{0,0,-FACE0_WIDTH},{0,-FACE0_HEIGHT,0},
- X {MR_X, MR_Y, Z_DEPTH+2*FACE0_WIDTH},
- X {0,0,FACE0_WIDTH},{0,FACE0_HEIGHT,0},{0,0,-FACE0_WIDTH},{0,-FACE0_HEIGHT,0},
- X
- X {MR_X, MR_Y+FACE0_HEIGHT, Z_DEPTH},
- X {0,0,FACE0_WIDTH},{0,FACE0_HEIGHT,0},{0,0,-FACE0_WIDTH},{0,-FACE0_HEIGHT,0},
- X {MR_X, MR_Y+FACE0_HEIGHT, Z_DEPTH+FACE0_WIDTH},
- X {0,0,FACE0_WIDTH},{0,FACE0_HEIGHT,0},{0,0,-FACE0_WIDTH},{0,-FACE0_HEIGHT,0},
- X {MR_X, MR_Y+FACE0_HEIGHT, Z_DEPTH+2*FACE0_WIDTH},
- X {0,0,FACE0_WIDTH},{0,FACE0_HEIGHT,0},{0,0,-FACE0_WIDTH},{0,-FACE0_HEIGHT,0},
- X
- X {MR_X, MR_Y+2*FACE0_HEIGHT, Z_DEPTH},
- X {0,0,FACE0_WIDTH},{0,FACE0_HEIGHT,0},{0,0,-FACE0_WIDTH},{0,-FACE0_HEIGHT,0},
- X {MR_X, MR_Y+2*FACE0_HEIGHT, Z_DEPTH+FACE0_WIDTH},
- X {0,0,FACE0_WIDTH},{0,FACE0_HEIGHT,0},{0,0,-FACE0_WIDTH},{0,-FACE0_HEIGHT,0},
- X {MR_X, MR_Y+2*FACE0_HEIGHT, Z_DEPTH+2*FACE0_WIDTH},
- X {0,0,FACE0_WIDTH},{0,FACE0_HEIGHT,0},{0,0,-FACE0_WIDTH},{0,-FACE0_HEIGHT,0},
- X
- X /* Side 2 (right) */
- X {MR_X+3*FACE0_WIDTH, MR_Y, Z_DEPTH},
- X {0,0,FACE0_WIDTH},{0,FACE0_HEIGHT,0},{0,0,-FACE0_WIDTH},{0,-FACE0_HEIGHT,0},
- X {MR_X+3*FACE0_WIDTH, MR_Y, Z_DEPTH+FACE0_WIDTH},
- X {0,0,FACE0_WIDTH},{0,FACE0_HEIGHT,0},{0,0,-FACE0_WIDTH},{0,-FACE0_HEIGHT,0},
- X {MR_X+3*FACE0_WIDTH, MR_Y, Z_DEPTH+2*FACE0_WIDTH},
- X {0,0,FACE0_WIDTH},{0,FACE0_HEIGHT,0},{0,0,-FACE0_WIDTH},{0,-FACE0_HEIGHT,0},
- X
- X {MR_X+3*FACE0_WIDTH, MR_Y+FACE0_HEIGHT, Z_DEPTH},
- X {0,0,FACE0_WIDTH},{0,FACE0_HEIGHT,0},{0,0,-FACE0_WIDTH},{0,-FACE0_HEIGHT,0},
- X {MR_X+3*FACE0_WIDTH, MR_Y+FACE0_HEIGHT, Z_DEPTH+FACE0_WIDTH},
- X {0,0,FACE0_WIDTH},{0,FACE0_HEIGHT,0},{0,0,-FACE0_WIDTH},{0,-FACE0_HEIGHT,0},
- X {MR_X+3*FACE0_WIDTH, MR_Y+FACE0_HEIGHT, Z_DEPTH+2*FACE0_WIDTH},
- X {0,0,FACE0_WIDTH},{0,FACE0_HEIGHT,0},{0,0,-FACE0_WIDTH},{0,-FACE0_HEIGHT,0},
- X
- X {MR_X+3*FACE0_WIDTH, MR_Y+2*FACE0_HEIGHT, Z_DEPTH},
- X {0,0,FACE0_WIDTH},{0,FACE0_HEIGHT,0},{0,0,-FACE0_WIDTH},{0,-FACE0_HEIGHT,0},
- X {MR_X+3*FACE0_WIDTH, MR_Y+2*FACE0_HEIGHT, Z_DEPTH+FACE0_WIDTH},
- X {0,0,FACE0_WIDTH},{0,FACE0_HEIGHT,0},{0,0,-FACE0_WIDTH},{0,-FACE0_HEIGHT,0},
- X {MR_X+3*FACE0_WIDTH, MR_Y+2*FACE0_HEIGHT, Z_DEPTH+2*FACE0_WIDTH},
- X {0,0,FACE0_WIDTH},{0,FACE0_HEIGHT,0},{0,0,-FACE0_WIDTH},{0,-FACE0_HEIGHT,0},
- X
- X /* Side 3 (back) */
- X {MR_X, MR_Y, Z_DEPTH+3*FACE0_WIDTH},
- X {FACE0_WIDTH,0,0},{0,FACE0_HEIGHT,0},{-FACE0_WIDTH,0,0},{0,-FACE0_HEIGHT,0},
- X {MR_X+FACE0_WIDTH, MR_Y, Z_DEPTH+3*FACE0_WIDTH},
- X {FACE0_WIDTH,0,0},{0,FACE0_HEIGHT,0},{-FACE0_WIDTH,0,0},{0,-FACE0_HEIGHT,0},
- X {MR_X+2*FACE0_WIDTH, MR_Y, Z_DEPTH+3*FACE0_WIDTH},
- X {FACE0_WIDTH,0,0},{0,FACE0_HEIGHT,0},{-FACE0_WIDTH,0,0},{0,-FACE0_HEIGHT,0},
- X
- X {MR_X, MR_Y+FACE0_HEIGHT, Z_DEPTH+3*FACE0_WIDTH},
- X {FACE0_WIDTH,0,0},{0,FACE0_HEIGHT,0},{-FACE0_WIDTH,0,0},{0,-FACE0_HEIGHT,0},
- X {MR_X+FACE0_WIDTH, MR_Y+FACE0_HEIGHT, Z_DEPTH+3*FACE0_WIDTH},
- X {FACE0_WIDTH,0,0},{0,FACE0_HEIGHT,0},{-FACE0_WIDTH,0,0},{0,-FACE0_HEIGHT,0},
- X {MR_X+2*FACE0_WIDTH, MR_Y+FACE0_HEIGHT, Z_DEPTH+3*FACE0_WIDTH},
- X {FACE0_WIDTH,0,0},{0,FACE0_HEIGHT,0},{-FACE0_WIDTH,0,0},{0,-FACE0_HEIGHT,0},
- X
- X {MR_X, MR_Y+2*FACE0_HEIGHT, Z_DEPTH+3*FACE0_WIDTH},
- X {FACE0_WIDTH,0,0},{0,FACE0_HEIGHT,0},{-FACE0_WIDTH,0,0},{0,-FACE0_HEIGHT,0},
- X {MR_X+FACE0_WIDTH, MR_Y+2*FACE0_HEIGHT, Z_DEPTH+3*FACE0_WIDTH},
- X {FACE0_WIDTH,0,0},{0,FACE0_HEIGHT,0},{-FACE0_WIDTH,0,0},{0,-FACE0_HEIGHT,0},
- X {MR_X+2*FACE0_WIDTH, MR_Y+2*FACE0_HEIGHT, Z_DEPTH+3*FACE0_WIDTH},
- X {FACE0_WIDTH,0,0},{0,FACE0_HEIGHT,0},{-FACE0_WIDTH,0,0},{0,-FACE0_HEIGHT,0},
- X
- X /* Side 4 (top) */
- X {MR_X, MR_Y, Z_DEPTH},
- X {FACE0_WIDTH,0,0},{0,0,FACE0_HEIGHT},{-FACE0_WIDTH,0,0},{0,0,-FACE0_HEIGHT},
- X {MR_X+FACE0_WIDTH, MR_Y, Z_DEPTH},
- X {FACE0_WIDTH,0,0},{0,0,FACE0_HEIGHT},{-FACE0_WIDTH,0,0},{0,0,-FACE0_HEIGHT},
- X {MR_X+2*FACE0_WIDTH, MR_Y, Z_DEPTH},
- X {FACE0_WIDTH,0,0},{0,0,FACE0_HEIGHT},{-FACE0_WIDTH,0,0},{0,0,-FACE0_HEIGHT},
- X
- X {MR_X, MR_Y, Z_DEPTH+FACE0_HEIGHT},
- X {FACE0_WIDTH,0,0},{0,0,FACE0_HEIGHT},{-FACE0_WIDTH,0,0},{0,0,-FACE0_HEIGHT},
- X {MR_X+FACE0_WIDTH, MR_Y, Z_DEPTH+FACE0_HEIGHT},
- X {FACE0_WIDTH,0,0},{0,0,FACE0_HEIGHT},{-FACE0_WIDTH,0,0},{0,0,-FACE0_HEIGHT},
- X {MR_X+2*FACE0_WIDTH, MR_Y, Z_DEPTH+FACE0_HEIGHT},
- X {FACE0_WIDTH,0,0},{0,0,FACE0_HEIGHT},{-FACE0_WIDTH,0,0},{0,0,-FACE0_HEIGHT},
- X
- X {MR_X, MR_Y, Z_DEPTH+2*FACE0_HEIGHT},
- X {FACE0_WIDTH,0,0},{0,0,FACE0_HEIGHT},{-FACE0_WIDTH,0,0},{0,0,-FACE0_HEIGHT},
- X {MR_X+FACE0_WIDTH, MR_Y, Z_DEPTH+2*FACE0_HEIGHT},
- X {FACE0_WIDTH,0,0},{0,0,FACE0_HEIGHT},{-FACE0_WIDTH,0,0},{0,0,-FACE0_HEIGHT},
- X {MR_X+2*FACE0_WIDTH, MR_Y, Z_DEPTH+2*FACE0_HEIGHT},
- X {FACE0_WIDTH,0,0},{0,0,FACE0_HEIGHT},{-FACE0_WIDTH,0,0},{0,0,-FACE0_HEIGHT},
- X
- X /* Side 5 (bottom) */
- X {MR_X, MR_Y+3*FACE0_HEIGHT, Z_DEPTH},
- X {FACE0_WIDTH,0,0},{0,0,FACE0_HEIGHT},{-FACE0_WIDTH,0,0},{0,0,-FACE0_HEIGHT},
- X {MR_X+FACE0_WIDTH, MR_Y+3*FACE0_HEIGHT, Z_DEPTH},
- X {FACE0_WIDTH,0,0},{0,0,FACE0_HEIGHT},{-FACE0_WIDTH,0,0},{0,0,-FACE0_HEIGHT},
- X {MR_X+2*FACE0_WIDTH, MR_Y+3*FACE0_HEIGHT, Z_DEPTH},
- X {FACE0_WIDTH,0,0},{0,0,FACE0_HEIGHT},{-FACE0_WIDTH,0,0},{0,0,-FACE0_HEIGHT},
- X
- X {MR_X, MR_Y+3*FACE0_HEIGHT, Z_DEPTH+FACE0_HEIGHT},
- X {FACE0_WIDTH,0,0},{0,0,FACE0_HEIGHT},{-FACE0_WIDTH,0,0},{0,0,-FACE0_HEIGHT},
- X {MR_X+FACE0_WIDTH, MR_Y+3*FACE0_HEIGHT, Z_DEPTH+FACE0_HEIGHT},
- X {FACE0_WIDTH,0,0},{0,0,FACE0_HEIGHT},{-FACE0_WIDTH,0,0},{0,0,-FACE0_HEIGHT},
- X {MR_X+2*FACE0_WIDTH, MR_Y+3*FACE0_HEIGHT, Z_DEPTH+FACE0_HEIGHT},
- X {FACE0_WIDTH,0,0},{0,0,FACE0_HEIGHT},{-FACE0_WIDTH,0,0},{0,0,-FACE0_HEIGHT},
- X
- X {MR_X, MR_Y+3*FACE0_HEIGHT, Z_DEPTH+2*FACE0_HEIGHT},
- X {FACE0_WIDTH,0,0},{0,0,FACE0_HEIGHT},{-FACE0_WIDTH,0,0},{0,0,-FACE0_HEIGHT},
- X {MR_X+FACE0_WIDTH, MR_Y+3*FACE0_HEIGHT, Z_DEPTH+2*FACE0_HEIGHT},
- X {FACE0_WIDTH,0,0},{0,0,FACE0_HEIGHT},{-FACE0_WIDTH,0,0},{0,0,-FACE0_HEIGHT},
- X {MR_X+2*FACE0_WIDTH, MR_Y+3*FACE0_HEIGHT, Z_DEPTH+2*FACE0_HEIGHT},
- X {FACE0_WIDTH,0,0},{0,0,FACE0_HEIGHT},{-FACE0_WIDTH,0,0},{0,0,-FACE0_HEIGHT},
- X
- X};
- Xint rot_angle,spin_angle,flip_angle;
- X
- X/* The subplanes that are moved in the cubikc_xxxx callback
- X * that make up a twisting of the 1/3 of the cube.
- X *
- X */
- Xint seed_front[] = {
- X 0,1,2,3,4,5,6,7,8,
- X 0,0,0,
- X 0,0,0,
- X 0,0,0,
- X 0,0,0
- X };
- X
- Xint seed_left[] = {
- X 9,10,11,12,13,14,15,16,17,
- X 0,0,0,
- X 0,0,0,
- X 0,0,0,
- X 0,0,0
- X };
- X
- Xint seed_right[] = {
- X 18,19,20,21,22,23,24,25,26,
- X 0,0,0,
- X 0,0,0,
- X 0,0,0,
- X 0,0,0
- X };
- X
- Xint seed_back[] = {
- X 27,28,29,30,31,32,33,34,35,
- X 0,0,0,
- X 0,0,0,
- X 0,0,0,
- X 0,0,0
- X };
- X
- Xint seed_top[] = {
- X 36,37,38,39,40,41,42,43,44,
- X 0,0,0,
- X 0,0,0,
- X 0,0,0,
- X 0,0,0
- X };
- X
- Xint seed_bottom[] = {
- X 45,46,47,48,49,50,51,52,53,
- X 0,0,0,
- X 0,0,0,
- X 0,0,0,
- X 0,0,0
- X };
- X/* the front[]. left[], .... arrays
- X indicate which subplane occupies a subplane location.
- X When pristine these values are equal. (See seed_xxxx.)
- X cubik_face[x][] gives the coordinates of a the xth
- X subplane. The coordinates of a subplane change if a cubik
- X operation operates on the said subplane.
- X */
- Xint front[NUM_CUBIKPLANES],left[NUM_CUBIKPLANES];
- Xint right[NUM_CUBIKPLANES],back[NUM_CUBIKPLANES];
- Xint top[NUM_CUBIKPLANES],bottom[NUM_CUBIKPLANES];
- XCorner cornermap[6][6][6]; /* see align_subfaces in cube.c */
- XEdge edgemap[6][6]; /* see align_subfaces in cube.c */
- X
- X
- Xdouble Delta_Angle = DEFAULT_DELTA_ANGLE;
- X
- Xvoid draw_line();
- Xvoid draw_circle();
- Xvoid draw_rectangle();
- Xvoid draw_filled_circle();
- Xvoid draw_filled_rectangle();
- X
- Xvoid activate();
- Xvoid refresh();
- Xvoid refresh_cube();
- Xvoid set_stipple();
- Xvoid start_rubber_band();
- Xvoid track_rubber_band();
- Xvoid end_rubber_band();
- Xvoid prev_to_org();
- Xvoid facecpy();
- Xvoid cubik();
- Xvoid cubikcpy();
- Xvoid update_cubik();
- Xvoid lefthand_twist();
- Xvoid righthand_twist();
- Xvoid xs_help_callback();
- Xvoid init_subplane_pattern();
- Xvoid norm_face();
- Xvoid projface();
- Xvoid shortface();
- Xextern void xcube_init_cubik();
- Xextern void taylor();
- Xextern void ldfile();
- X
- Xvoid init_cornermap();
- Xvoid init_edgemap();
- Xvoid check_events();
- XBool test_for_event();
- END_OF_FILE
- if test 14880 -ne `wc -c <'cube/cube.h'`; then
- echo shar: \"'cube/cube.h'\" unpacked with wrong size!
- fi
- # end of 'cube/cube.h'
- fi
- if test -f 'cube/layer1corner.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'cube/layer1corner.c'\"
- else
- echo shar: Extracting \"'cube/layer1corner.c'\" \(14286 characters\)
- sed "s/^X//" >'cube/layer1corner.c' <<'END_OF_FILE'
- X/* layer1corner.c
- X This incorporates Don Taylor's solution to the
- X Buvos Kocka (Hungarian Magic Cube).
- X
- X First Layer Corner Cube
- X
- X The following references were used:
- X "The X Window System Programming And Applications with Xt
- X OSF/MOTIF EDITION"
- X by Douglas A Young
- X Prentice-Hall, 1990.
- X ISBN 0-13-642786-3
- X
- X "Mastering Rubik's Cube"
- X by Don Taylor
- X An Owl Book; Holt, Rinehart and Winston, New York, 1980
- X ISBN 0-03-059941-5
- X
- X-------------------------------------------------------------------
- XCopyright (C) 1993 by Pierre A. Fleurant
- XPermission is granted to copy and distribute this program
- Xwithout charge, provided this copyright notice is included
- Xin the copy.
- XThis Software is distributed on an as-is basis. There will be
- XABSOLUTELY NO WARRANTY for any part of this software to work
- Xcorrect. In no case will the author be liable to you for damages
- Xcaused by the usage of this software.
- X-------------------------------------------------------------------
- X*/
- X
- X#include "taylor.h"
- X
- Xextern void F(); /* front */
- Xextern void L(); /* left */
- Xextern void R(); /* right */
- Xextern void B(); /* back */
- Xextern void U(); /* up */
- Xextern void D(); /* down */
- X
- Xextern void first_layer_corner_tfr(); /* layer1c_txx */
- Xextern void first_layer_corner_trb(); /* layer1c_txx */
- Xextern void first_layer_corner_tbl(); /* layer1c_txx */
- Xextern void first_layer_corner_tlf(); /* layer1c_txx */
- X
- XBoolean first_layer_corner(w,wdata,call_data) /* These parameters needed for macros */
- X Widget w;
- X widget_data *wdata;
- X caddr_t call_data;
- X{
- X /* Search for the Top corner cubes,
- X place in lower layer directly below
- X destination cube then
- X dispatch to first_layer_corner_tXX accordingly.
- X There are 8 corner cubes in all.
- X */
- X
- X /* Bottom Corner Cubes */
- X /* There are 12 places a TOP can be in the bottom layer.
- X */
- X
- X /*1*/
- X if(Front(8) == TOP){
- X if(Right(6) == FRONT){
- X if(Bottom(2) == RIGHT){
- X first_layer_corner_tfr(w,wdata,call_data);
- X }
- X else if(Bottom(2) == LEFT){
- X D(-1);
- X first_layer_corner_tlf(w,wdata,call_data);
- X }
- X }
- X else if(Right(6) == RIGHT){
- X if(Bottom(2) == FRONT){
- X first_layer_corner_tfr(w,wdata,call_data);
- X }
- X else if(Bottom(2) == BACK){
- X D(1);
- X first_layer_corner_trb(w,wdata,call_data);
- X }
- X }
- X else if(Right(6) == BACK){
- X if(Bottom(2) == RIGHT){
- X D(1);
- X first_layer_corner_trb(w,wdata,call_data);
- X }
- X else if(Bottom(2) == LEFT){
- X D(2);
- X first_layer_corner_tbl(w,wdata,call_data);
- X }
- X }
- X else if(Right(6) == LEFT){
- X if(Bottom(2) == FRONT){
- X D(-1);
- X first_layer_corner_tlf(w,wdata,call_data);
- X }
- X else if(Bottom(2) == BACK){
- X D(2);
- X first_layer_corner_tbl(w,wdata,call_data);
- X }
- X }
- X }
- X
- X else if(Right(6) == TOP){
- X if(Front(8) == FRONT){
- X if(Bottom(2) == RIGHT){
- X first_layer_corner_tfr(w,wdata,call_data);
- X }
- X else if(Bottom(2) == LEFT){
- X D(-1);
- X first_layer_corner_tlf(w,wdata,call_data);
- X }
- X }
- X else if(Front(8) == RIGHT){
- X if(Bottom(2) == FRONT){
- X first_layer_corner_tfr(w,wdata,call_data);
- X }
- X else if(Bottom(2) == BACK){
- X D(1);
- X first_layer_corner_trb(w,wdata,call_data);
- X }
- X }
- X else if(Front(8) == BACK){
- X if(Bottom(2) == RIGHT){
- X D(1);
- X first_layer_corner_trb(w,wdata,call_data);
- X }
- X else if(Bottom(2) == LEFT){
- X D(2);
- X first_layer_corner_tbl(w,wdata,call_data);
- X }
- X }
- X else if(Front(8) == LEFT){
- X if(Bottom(2) == FRONT){
- X D(-1);
- X first_layer_corner_tlf(w,wdata,call_data);
- X }
- X else if(Bottom(2) == BACK){
- X D(2);
- X first_layer_corner_tbl(w,wdata,call_data);
- X }
- X }
- X }
- X
- X else if(Bottom(2) == TOP){
- X if(Front(8) == FRONT){
- X if(Right(6) == RIGHT){
- X first_layer_corner_tfr(w,wdata,call_data);
- X }
- X else if(Right(6) == LEFT){
- X D(-1);
- X first_layer_corner_tlf(w,wdata,call_data);
- X }
- X }
- X else if(Front(8) == RIGHT){
- X if(Right(6) == FRONT){
- X first_layer_corner_tfr(w,wdata,call_data);
- X }
- X else if(Right(6) == BACK){
- X D(1);
- X first_layer_corner_trb(w,wdata,call_data);
- X }
- X }
- X else if(Front(8) == BACK){
- X if(Right(6) == RIGHT){
- X D(1);
- X first_layer_corner_trb(w,wdata,call_data);
- X }
- X else if(Right(6) == LEFT){
- X D(2);
- X first_layer_corner_tbl(w,wdata,call_data);
- X }
- X }
- X else if(Front(8) == LEFT){
- X if(Right(6) == FRONT){
- X D(-1);
- X first_layer_corner_tlf(w,wdata,call_data);
- X }
- X else if(Right(6) == BACK){
- X D(2);
- X first_layer_corner_tbl(w,wdata,call_data);
- X }
- X }
- X }
- X
- X /*2*/
- X if(Right(8) == TOP){
- X if(Back(8) == FRONT){
- X if(Bottom(8) == RIGHT){
- X D(-1);
- X first_layer_corner_tfr(w,wdata,call_data);
- X }
- X else if(Bottom(8) == LEFT){
- X D(2);
- X first_layer_corner_tlf(w,wdata,call_data);
- X }
- X }
- X else if(Back(8) == RIGHT){
- X if(Bottom(8) == FRONT){
- X D(-1);
- X first_layer_corner_tfr(w,wdata,call_data);
- X }
- X else if(Bottom(8) == BACK){
- X first_layer_corner_trb(w,wdata,call_data);
- X }
- X }
- X else if(Back(8) == BACK){
- X if(Bottom(8) == RIGHT){
- X first_layer_corner_trb(w,wdata,call_data);
- X }
- X else if(Bottom(8) == LEFT){
- X D(1);
- X first_layer_corner_tbl(w,wdata,call_data);
- X }
- X }
- X else if(Back(8) == LEFT){
- X if(Bottom(8) == FRONT){
- X D(2);
- X first_layer_corner_tlf(w,wdata,call_data);
- X }
- X else if(Bottom(8) == BACK){
- X D(1);
- X first_layer_corner_tbl(w,wdata,call_data);
- X }
- X }
- X }
- X
- X else if(Back(8) == TOP){
- X if(Right(8) == FRONT){
- X if(Bottom(8) == RIGHT){
- X D(-1);
- X first_layer_corner_tfr(w,wdata,call_data);
- X }
- X else if(Bottom(8) == LEFT){
- X D(2);
- X first_layer_corner_tlf(w,wdata,call_data);
- X }
- X }
- X else if(Right(8) == RIGHT){
- X if(Bottom(8) == FRONT){
- X D(-1);
- X first_layer_corner_tfr(w,wdata,call_data);
- X }
- X else if(Bottom(8) == BACK){
- X first_layer_corner_trb(w,wdata,call_data);
- X }
- X }
- X else if(Right(8) == BACK){
- X if(Bottom(8) == RIGHT){
- X first_layer_corner_trb(w,wdata,call_data);
- X }
- X else if(Bottom(8) == LEFT){
- X D(1);
- X first_layer_corner_tbl(w,wdata,call_data);
- X }
- X }
- X else if(Right(8) == LEFT){
- X if(Bottom(8) == FRONT){
- X D(2);
- X first_layer_corner_tlf(w,wdata,call_data);
- X }
- X else if(Bottom(8) == BACK){
- X D(1);
- X first_layer_corner_tbl(w,wdata,call_data);
- X }
- X }
- X }
- X
- X else if(Bottom(8) == TOP){
- X if(Right(8) == FRONT){
- X if(Back(8) == RIGHT){
- X D(-1);
- X first_layer_corner_tfr(w,wdata,call_data);
- X }
- X else if(Back(8) == LEFT){
- X D(2);
- X first_layer_corner_tlf(w,wdata,call_data);
- X }
- X }
- X else if(Right(8) == RIGHT){
- X if(Back(8) == FRONT){
- X D(-1);
- X first_layer_corner_tfr(w,wdata,call_data);
- X }
- X else if(Back(8) == BACK){
- X first_layer_corner_trb(w,wdata,call_data);
- X }
- X }
- X else if(Right(8) == BACK){
- X if(Back(8) == RIGHT){
- X first_layer_corner_trb(w,wdata,call_data);
- X }
- X else if(Back(8) == LEFT){
- X D(1);
- X first_layer_corner_tbl(w,wdata,call_data);
- X }
- X }
- X else if(Right(8) == LEFT){
- X if(Back(8) == FRONT){
- X D(2);
- X first_layer_corner_tlf(w,wdata,call_data);
- X }
- X else if(Back(8) == BACK){
- X D(1);
- X first_layer_corner_tbl(w,wdata,call_data);
- X }
- X }
- X }
- X
- X /*3*/
- X if(Back(6) == TOP){
- X if(Left(8) == FRONT){
- X if(Bottom(6) == RIGHT){
- X D(2);
- X first_layer_corner_tfr(w,wdata,call_data);
- X }
- X else if(Bottom(6) == LEFT){
- X D(1);
- X first_layer_corner_tlf(w,wdata,call_data);
- X }
- X }
- X else if(Left(8) == RIGHT){
- X if(Bottom(6) == FRONT){
- X D(2);
- X first_layer_corner_tfr(w,wdata,call_data);
- X }
- X else if(Bottom(6) == BACK){
- X D(-1);
- X first_layer_corner_trb(w,wdata,call_data);
- X }
- X }
- X else if(Left(8) == BACK){
- X if(Bottom(6) == RIGHT){
- X D(-1);
- X first_layer_corner_trb(w,wdata,call_data);
- X }
- X else if(Bottom(6) == LEFT){
- X first_layer_corner_tbl(w,wdata,call_data);
- X }
- X }
- X else if(Left(8) == LEFT){
- X if(Bottom(6) == FRONT){
- X D(1);
- X first_layer_corner_tlf(w,wdata,call_data);
- X }
- X else if(Bottom(6) == BACK){
- X first_layer_corner_tbl(w,wdata,call_data);
- X }
- X }
- X }
- X
- X else if(Left(8) == TOP){
- X if(Back(6) == FRONT){
- X if(Bottom(6) == RIGHT){
- X D(2);
- X first_layer_corner_tfr(w,wdata,call_data);
- X }
- X else if(Bottom(6) == LEFT){
- X D(1);
- X first_layer_corner_tlf(w,wdata,call_data);
- X }
- X }
- X else if(Back(6) == RIGHT){
- X if(Bottom(6) == FRONT){
- X D(2);
- X first_layer_corner_tfr(w,wdata,call_data);
- X }
- X else if(Bottom(6) == BACK){
- X D(-1);
- X first_layer_corner_trb(w,wdata,call_data);
- X }
- X }
- X else if(Back(6) == BACK){
- X if(Bottom(6) == RIGHT){
- X D(-1);
- X first_layer_corner_trb(w,wdata,call_data);
- X }
- X else if(Bottom(6) == LEFT){
- X first_layer_corner_tbl(w,wdata,call_data);
- X }
- X }
- X else if(Back(6) == LEFT){
- X if(Bottom(6) == FRONT){
- X D(1);
- X first_layer_corner_tlf(w,wdata,call_data);
- X }
- X else if(Bottom(6) == BACK){
- X first_layer_corner_tbl(w,wdata,call_data);
- X }
- X }
- X }
- X
- X else if(Bottom(6) == TOP){
- X if(Back(6) == FRONT){
- X if(Left(8) == RIGHT){
- X D(2);
- X first_layer_corner_tfr(w,wdata,call_data);
- X }
- X else if(Left(8) == LEFT){
- X D(1);
- X first_layer_corner_tlf(w,wdata,call_data);
- X }
- X }
- X else if(Back(6) == RIGHT){
- X if(Left(8) == FRONT){
- X D(2);
- X first_layer_corner_tfr(w,wdata,call_data);
- X }
- X else if(Left(8) == BACK){
- X D(-1);
- X first_layer_corner_trb(w,wdata,call_data);
- X }
- X }
- X else if(Back(6) == BACK){
- X if(Left(8) == RIGHT){
- X D(-1);
- X first_layer_corner_trb(w,wdata,call_data);
- X }
- X else if(Left(8) == LEFT){
- X first_layer_corner_tbl(w,wdata,call_data);
- X }
- X }
- X else if(Back(6) == LEFT){
- X if(Left(8) == FRONT){
- X D(1);
- X first_layer_corner_tlf(w,wdata,call_data);
- X }
- X else if(Left(8) == BACK){
- X first_layer_corner_tbl(w,wdata,call_data);
- X }
- X }
- X }
- X
- X /*4*/
- X if(Left(6) == TOP){
- X if(Front(6) == FRONT){
- X if(Bottom(0) == RIGHT){
- X D(1);
- X first_layer_corner_tfr(w,wdata,call_data);
- X }
- X else if(Bottom(0) == LEFT){
- X first_layer_corner_tlf(w,wdata,call_data);
- X }
- X }
- X else if(Front(6) == RIGHT){
- X if(Bottom(0) == FRONT){
- X D(1);
- X first_layer_corner_tfr(w,wdata,call_data);
- X }
- X else if(Bottom(0) == BACK){
- X D(2);
- X first_layer_corner_trb(w,wdata,call_data);
- X }
- X }
- X else if(Front(6) == BACK){
- X if(Bottom(0) == RIGHT){
- X D(2);
- X first_layer_corner_trb(w,wdata,call_data);
- X }
- X else if(Bottom(0) == LEFT){
- X D(-1);
- X first_layer_corner_tbl(w,wdata,call_data);
- X }
- X }
- X else if(Front(6) == LEFT){
- X if(Bottom(0) == FRONT){
- X first_layer_corner_tlf(w,wdata,call_data);
- X }
- X else if(Bottom(0) == BACK){
- X D(-1);
- X first_layer_corner_tbl(w,wdata,call_data);
- X }
- X }
- X }
- X
- X else if(Front(6) == TOP){
- X if(Left(6) == FRONT){
- X if(Bottom(0) == RIGHT){
- X D(1);
- X first_layer_corner_tfr(w,wdata,call_data);
- X }
- X else if(Bottom(0) == LEFT){
- X first_layer_corner_tlf(w,wdata,call_data);
- X }
- X }
- X else if(Left(6) == RIGHT){
- X if(Bottom(0) == FRONT){
- X D(1);
- X first_layer_corner_tfr(w,wdata,call_data);
- X }
- X else if(Bottom(0) == BACK){
- X D(2);
- X first_layer_corner_trb(w,wdata,call_data);
- X }
- X }
- X else if(Left(6) == BACK){
- X if(Bottom(0) == RIGHT){
- X D(2);
- X first_layer_corner_trb(w,wdata,call_data);
- X }
- X else if(Bottom(0) == LEFT){
- X D(-1);
- X first_layer_corner_tbl(w,wdata,call_data);
- X }
- X }
- X else if(Left(6) == LEFT){
- X if(Bottom(0) == FRONT){
- X first_layer_corner_tlf(w,wdata,call_data);
- X }
- X else if(Bottom(0) == BACK){
- X D(-1);
- X first_layer_corner_tbl(w,wdata,call_data);
- X }
- X }
- X }
- X
- X else if(Bottom(0) == TOP){
- X if(Left(6) == FRONT){
- X if(Front(6) == RIGHT){
- X D(1);
- X first_layer_corner_tfr(w,wdata,call_data);
- X }
- X else if(Front(6) == LEFT){
- X first_layer_corner_tlf(w,wdata,call_data);
- X }
- X }
- X else if(Left(6) == RIGHT){
- X if(Front(6) == FRONT){
- X D(1);
- X first_layer_corner_tfr(w,wdata,call_data);
- X }
- X else if(Front(6) == BACK){
- X D(2);
- X first_layer_corner_trb(w,wdata,call_data);
- X }
- X }
- X else if(Left(6) == BACK){
- X if(Front(6) == RIGHT){
- X D(2);
- X first_layer_corner_trb(w,wdata,call_data);
- X }
- X else if(Front(6) == LEFT){
- X D(-1);
- X first_layer_corner_tbl(w,wdata,call_data);
- X }
- X }
- X else if(Left(6) == LEFT){
- X if(Front(6) == FRONT){
- X first_layer_corner_tlf(w,wdata,call_data);
- X }
- X else if(Front(6) == BACK){
- X D(-1);
- X first_layer_corner_tbl(w,wdata,call_data);
- X }
- X }
- X }
- X
- X /* Top Corner Cubes */
- X /* There are 12 places a TOP can be in the top layer corner cubes layer.
- X If all first layer corners are ok, then True is returned.
- X Else if a TOP is found in top layer corner, with the wrong orientation then
- X the operation to bring it to the lower layer is performed.
- X Else False is returned.
- X */
- X
- X if(Top(0) == TOP &&
- X Top(2) == TOP &&
- X Top(6) == TOP &&
- X Top(8) == TOP &&
- X Front(0) == FRONT &&
- X Front(2) == FRONT &&
- X Right(0) == RIGHT &&
- X Right(2) == RIGHT &&
- X Back(0) == BACK &&
- X Back(2) == BACK &&
- X Left(0) == LEFT &&
- X Left(2) == LEFT)
- X return(True);
- X
- X /* Here if more passes needed.
- X * Check if any miss-oriented ones on top.
- X * If so, then bring it down to bottom layer.
- X */
- X if((Top(2) == TOP ||
- X Front(2) == TOP ||
- X Right(0) == TOP) &&
- X (Top(2) != TOP ||
- X Front(2) != FRONT ||
- X Right(0) != RIGHT)){
- X R(-1);D(1);R(1);
- X return(False);
- X }
- X
- X if((Top(8) == TOP ||
- X Right(2) == TOP ||
- X Back(2) == TOP) &&
- X (Top(8) != TOP ||
- X Right(2) != RIGHT ||
- X Back(2) != BACK)){
- X B(-1);D(1);B(1);
- X return(False);
- X }
- X
- X if((Top(6) == TOP ||
- X Back(0) == TOP ||
- X Left(2) == TOP) &&
- X (Top(6) != TOP ||
- X Back(0) != BACK ||
- X Left(2) != LEFT)){
- X L(-1);D(1);L(1);
- X return(False);
- X }
- X
- X if((Top(0) == TOP ||
- X Left(0) == TOP ||
- X Front(0) == TOP) &&
- X (Top(0) != TOP ||
- X Left(0) != LEFT ||
- X Front(0) != FRONT)){
- X F(-1);D(1);F(1);
- X return(False);
- X }
- X return(False);
- X}
- END_OF_FILE
- if test 14286 -ne `wc -c <'cube/layer1corner.c'`; then
- echo shar: \"'cube/layer1corner.c'\" unpacked with wrong size!
- fi
- # end of 'cube/layer1corner.c'
- fi
- if test ! -d 'cube/lib' ; then
- echo shar: Creating directory \"'cube/lib'\"
- mkdir 'cube/lib'
- fi
- if test -f 'cube/lib/Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'cube/lib/Makefile'\"
- else
- echo shar: Extracting \"'cube/lib/Makefile'\" \(8662 characters\)
- sed "s/^X//" >'cube/lib/Makefile' <<'END_OF_FILE'
- X# Makefile generated by imake - do not edit!
- X# $XConsortium: imake.c,v 1.51 89/12/12 12:37:30 jim Exp $
- X#
- X# The cpp used on this machine replaces all newlines and multiple tabs and
- X# spaces in a macro expansion with a single space. Imake tries to compensate
- X# for this, but is not always successful.
- X#
- X
- X###########################################################################
- X# Makefile generated from "Imake.tmpl" and </tmp/IIf.a02079>
- X# $XConsortium: Imake.tmpl,v 1.77 89/12/18 17:01:37 jim Exp $
- X#
- X# Platform-specific parameters may be set in the appropriate .cf
- X# configuration files. Site-wide parameters may be set in the file
- X# site.def. Full rebuilds are recommended if any parameters are changed.
- X#
- X# If your C preprocessor doesn't define any unique symbols, you'll need
- X# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
- X# "make Makefile", "make Makefiles", or "make World").
- X#
- X# If you absolutely can't get imake to work, you'll need to set the
- X# variables at the top of each Makefile as well as the dependencies at the
- X# bottom (makedepend will do this automatically).
- X#
- X
- X###########################################################################
- X# platform-specific configuration parameters - edit sun.cf to change
- X
- X# platform: $XConsortium: sun.cf,v 1.38 89/12/23 16:10:10 jim Exp $
- X# operating system: SunOS 4.0.3
- X
- X###########################################################################
- X# site-specific configuration parameters - edit site.def to change
- X
- X SHELL = /bin/sh
- X
- X TOP = ../.
- X CURRENT_DIR = ./lib
- X
- X AR = ar clq
- X BOOTSTRAPCFLAGS =
- X CC = cc
- X
- X COMPRESS = compress
- X CPP = /lib/cpp $(STD_CPP_DEFINES)
- X PREPROCESSCMD = cc -E $(STD_CPP_DEFINES)
- X INSTALL = install
- X LD = ld
- X LINT = lint
- X LINTLIBFLAG = -C
- X LINTOPTS = -axz
- X LN = ln -s
- X MAKE = make
- X MV = mv
- X CP = cp
- X RANLIB = ranlib
- X RANLIBINSTFLAGS =
- X RM = rm -f
- X STD_INCLUDES =
- X STD_CPP_DEFINES =
- X STD_DEFINES =
- X EXTRA_LOAD_FLAGS =
- X EXTRA_LIBRARIES =
- X TAGS = ctags
- X
- X SHAREDCODEDEF = -DSHAREDCODE
- X SHLIBDEF = -DSUNSHLIB
- X
- X PROTO_DEFINES =
- X
- X INSTPGMFLAGS =
- X
- X INSTBINFLAGS = -m 0755
- X INSTUIDFLAGS = -m 4755
- X INSTLIBFLAGS = -m 0664
- X INSTINCFLAGS = -m 0444
- X INSTMANFLAGS = -m 0444
- X INSTDATFLAGS = -m 0444
- X INSTKMEMFLAGS = -m 4755
- X
- X DESTDIR =
- X
- X TOP_INCLUDES = -I$(INCROOT)
- X
- X CDEBUGFLAGS = -O
- X CCOPTIONS =
- X COMPATFLAGS =
- X
- X ALLINCLUDES = $(STD_INCLUDES) $(TOP_INCLUDES) $(INCLUDES) $(EXTRA_INCLUDES)
- X ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(PROTO_DEFINES) $(DEFINES) $(COMPATFLAGS)
- X CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
- X LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
- X LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
- X LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS)
- X LDCOMBINEFLAGS = -X -r
- X
- X MACROFILE = sun.cf
- X RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
- X
- X IMAKE_DEFINES =
- X
- X IRULESRC = $(CONFIGDIR)
- X IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES)
- X
- X ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
- X $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
- X $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES)
- X
- X###########################################################################
- X# X Window System Build Parameters
- X# $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
- X
- X###########################################################################
- X# X Window System make variables; this need to be coordinated with rules
- X# $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
- X
- X PATHSEP = /
- X USRLIBDIR = $(DESTDIR)/usr/lib
- X BINDIR = $(DESTDIR)/usr/bin/X11
- X INCROOT = $(DESTDIR)/usr/include
- X BUILDINCROOT = $(TOP)
- X BUILDINCDIR = $(BUILDINCROOT)/X11
- X BUILDINCTOP = ..
- X INCDIR = $(INCROOT)/X11
- X ADMDIR = $(DESTDIR)/usr/adm
- X LIBDIR = $(USRLIBDIR)/X11
- X CONFIGDIR = $(LIBDIR)/config
- X LINTLIBDIR = $(USRLIBDIR)/lint
- X
- X FONTDIR = $(LIBDIR)/fonts
- X XINITDIR = $(LIBDIR)/xinit
- X XDMDIR = $(LIBDIR)/xdm
- X AWMDIR = $(LIBDIR)/awm
- X TWMDIR = $(LIBDIR)/twm
- X GWMDIR = $(LIBDIR)/gwm
- X MANPATH = $(DESTDIR)/usr/man
- X MANSOURCEPATH = $(MANPATH)/man
- X MANDIR = $(MANSOURCEPATH)n
- X LIBMANDIR = $(MANSOURCEPATH)3
- X XAPPLOADDIR = $(LIBDIR)/app-defaults
- X
- X SOXLIBREV = 4.2
- X SOXTREV = 4.0
- X SOXAWREV = 4.0
- X SOOLDXREV = 4.0
- X SOXMUREV = 4.0
- X SOXEXTREV = 4.0
- X
- X FONTCFLAGS = -t
- X
- X INSTAPPFLAGS = $(INSTDATFLAGS)
- X
- X IMAKE = imake
- X DEPEND = makedepend
- X RGB = rgb
- X FONTC = bdftosnf
- X MKFONTDIR = mkfontdir
- X MKDIRHIER = /bin/sh $(BINDIR)/mkdirhier.sh
- X
- X CONFIGSRC = $(TOP)/config
- X CLIENTSRC = $(TOP)/clients
- X DEMOSRC = $(TOP)/demos
- X LIBSRC = $(TOP)/lib
- X FONTSRC = $(TOP)/fonts
- X INCLUDESRC = $(TOP)/X11
- X SERVERSRC = $(TOP)/server
- X UTILSRC = $(TOP)/util
- X SCRIPTSRC = $(UTILSRC)/scripts
- X EXAMPLESRC = $(TOP)/examples
- X CONTRIBSRC = $(TOP)/../contrib
- X DOCSRC = $(TOP)/doc
- X RGBSRC = $(TOP)/rgb
- X DEPENDSRC = $(UTILSRC)/makedepend
- X IMAKESRC = $(CONFIGSRC)
- X XAUTHSRC = $(LIBSRC)/Xau
- X XLIBSRC = $(LIBSRC)/X
- X XMUSRC = $(LIBSRC)/Xmu
- X TOOLKITSRC = $(LIBSRC)/Xt
- X AWIDGETSRC = $(LIBSRC)/Xaw
- X OLDXLIBSRC = $(LIBSRC)/oldX
- X XDMCPLIBSRC = $(LIBSRC)/Xdmcp
- X BDFTOSNFSRC = $(FONTSRC)/bdftosnf
- X MKFONTDIRSRC = $(FONTSRC)/mkfontdir
- X EXTENSIONSRC = $(TOP)/extensions
- X
- X DEPEXTENSIONLIB =
- X EXTENSIONLIB = -lXext
- X
- X DEPXLIB = $(DEPEXTENSIONLIB)
- X XLIB = $(EXTENSIONLIB) -lX11
- X
- X DEPXAUTHLIB = $(USRLIBDIR)/libXau.a
- X XAUTHLIB = -lXau
- X
- X DEPXMULIB =
- X XMULIB = -lXmu
- X
- X DEPOLDXLIB =
- X OLDXLIB = -loldX
- X
- X DEPXTOOLLIB =
- X XTOOLLIB = -lXt
- X
- X DEPXAWLIB =
- X XAWLIB = -lXaw
- X
- X LINTEXTENSIONLIB = $(USRLIBDIR)/llib-lXext.ln
- X LINTXLIB = $(USRLIBDIR)/llib-lX11.ln
- X LINTXMU = $(USRLIBDIR)/llib-lXmu.ln
- X LINTXTOOL = $(USRLIBDIR)/llib-lXt.ln
- X LINTXAW = $(USRLIBDIR)/llib-lXaw.ln
- X
- X DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
- X
- X DEPLIBS1 = $(DEPLIBS)
- X DEPLIBS2 = $(DEPLIBS)
- X DEPLIBS3 = $(DEPLIBS)
- X
- X###########################################################################
- X# Imake rules for building libraries, programs, scripts, and data files
- X# rules: $XConsortium: Imake.rules,v 1.67 89/12/18 17:14:15 jim Exp $
- X
- X###########################################################################
- X# start of Imakefile
- X
- X#
- X# Imakefile - Xs
- X
- XSTD_INCLUDES = -I/usr/local/X11R5/include -I/usr/local/include -I./lib
- XSTD_CPP_DEFINES =
- XSTD_DEFINES =
- XEXTRA_LOAD_FLAGS = -lXm -lX11 -lXt
- XEXTRA_LIBRARIES = -L/usr/local/X11R5/lib -L/usr/lib
- X
- XSRCS = concat.c str2flt.c invert.c quit.c talkto.c wprintf.c insert.c xmstr_to_str.c\
- X send_msg.c xor.c strtoxmstr.c menus.c help_dialog.c pix_buttons.c
- X
- XOBJS = concat.o str2flt.o invert.o quit.o talkto.o wprintf.o insert.o xmstr_to_str.o\
- X send_msg.o xor.o strtoxmstr.o menus.o help_dialog.o pix_buttons.o
- X
- X#
- X# Make Xs
- X#
- X
- Xall:: libXs.a
- X
- XlibXs.a: $(OBJS)
- X $(RM) $@
- X $(AR) $@ $(OBJS)
- X $(RANLIB) $@
- X
- Xdepend::
- X $(DEPEND) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
- X
- X###########################################################################
- X# common rules for all Makefiles - do not edit
- X
- Xemptyrule::
- X
- Xclean::
- X $(RM_CMD) \#*
- X
- XMakefile::
- X -@if [ -f Makefile ]; then \
- X echo " $(RM) Makefile.bak; $(MV) Makefile Makefile.bak"; \
- X $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
- X else exit 0; fi
- X $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
- X
- Xtags::
- X $(TAGS) -w *.[ch]
- X $(TAGS) -xw *.[ch] > TAGS
- X
- Xsaber:
- X #load $(ALLDEFINES) $(SRCS)
- X
- Xosaber:
- X #load $(ALLDEFINES) $(OBJS)
- X
- X###########################################################################
- X# empty rules for directories that do not have SUBDIRS - do not edit
- X
- Xinstall::
- X @echo "install in $(CURRENT_DIR) done"
- X
- Xinstall.man::
- X @echo "install.man in $(CURRENT_DIR) done"
- X
- XMakefiles::
- X
- Xincludes::
- X
- X###########################################################################
- X# dependencies generated by makedepend
- X
- END_OF_FILE
- if test 8662 -ne `wc -c <'cube/lib/Makefile'`; then
- echo shar: \"'cube/lib/Makefile'\" unpacked with wrong size!
- fi
- # end of 'cube/lib/Makefile'
- fi
- echo shar: End of archive 1 \(of 5\).
- cp /dev/null ark1isdone
- MISSING=""
- for I in 1 2 3 4 5 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 5 archives.
- rm -f ark[1-9]isdone
- else
- echo You still must unpack the following archives:
- echo " " ${MISSING}
- fi
- exit 0
- exit 0 # Just in case...
-