xbomb-2.2a/ 40755 233 144 0 11304434465 5765 5xbomb-2.2a/ANNOUNCE 644 233 144 2770 11304434405 7132 0 XBOMB Version 2.2a ================== A program that looks superficially like the minesweeper program that comes supplied with MS Windows (and is also available in other versions). Runs under X Windows on the UNIX operating system. Features -------- There are a number of features that make this version different from the others available (that I have seen). 3 Grid Tile options Hexagonal - Easy (the endgame can be difficult). Square - Traditional. Triangular - Difficult. 3 Grid sizes Small - 8x8 with 10 bombs Medium - 16x16 with 40 bombs Large - 30x16 with 99 bombs Highscore table 10 entries for the fastest times for each of the 3 levels of each of the 3 grid shapes. Includes manual page with details on how to use the program. Changes in Version 2.2a ---------------------- Change colour for the number 8 so that it is visible on background. Changes in Version 2.2 ---------------------- Have different colours for each of the numbers. Allow left click on exposed number to clear adjacent unmarked areas. Several compilation fixes for portability. Availability ------------ Web page: http://www.gedanken.demon.co.uk/xbomb/ Author & Copyright ------------------ This program is copyright Andrew M. Bishop 1994-2009 (amb@gedanken.demon.co.uk) and distributed under GPL. email: amb@gedanken.demon.co.uk [Please put xbomb in the subject line] xbomb-2.2a/COPYING 644 233 144 43115 6770715647 7057 0 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. xbomb-2.2a/LSM 644 233 144 1425 11304434244 6354 0Begin3 Title: XBomb - X Windows strategy game. Version: 2.2a [29-Nov-09] Entered-date: 29NOV09 Description: A 'minesweeper' style strategy game for UNIX and X-Windows. A test of speed and logic to find the location of bombs hidden in a grid. A choice of hexagonal, square or triangular grids, each in 3 difficulty levels, all games played against the clock, with a high-score table for each. Keywords: X-Windows game strategy mine bomb Author: amb@gedanken.demon.co.uk Maintained-by: amb@gedanken.demon.co.uk Primary-site: www.gedanken.demon.co.uk /download-xbomb 24k xbomb-2.2a.tgz Original-site: Platforms: UNIX X-Windows Copying-policy: GPL End xbomb-2.2a/README 444 233 144 4435 10737754064 6676 0 XBOMB Version 2.2 ================= A program that looks superficially like the minesweeper program that comes supplied with MS Windows (and is also available in other versions). Runs under X Windows on the UNIX operating system. Features -------- There are a number of features that make this version different from the others available (that I have seen). 3 Grid Tile options Hexagonal - Easy (the endgame can be difficult). Square - Traditional. Triangular - Difficult. 3 Grid sizes Small - 8x8 with 10 bombs Medium - 16x16 with 40 bombs Large - 30x16 with 99 bombs Highscore table 10 entries for the fastest times for each of the 3 levels of each of the 3 grid shapes. Playing the game ---------------- Located under the tiles of the grid are a number of unexploded bombs. The target of the game is detect the location of the bombs given only the number of bombs neighbouring each of the locations known to have no bomb. Locations known to contain bombs, are marked and the game finishes when all locations are uncovered or marked. Left mouse button - Uncover the current location if not already done or uncover all adjacent squares not marked as bombs. Middle mouse button - Uncover all adjacent squares not marked as bombs. Right mouse button - Mark a square as being known to contain a bomb (toggles). 's' key - Start a new game 'q' key - Quit the game 'h' key - Print the high score table for the current grid shape. '1','2' or '3' key - Select game level 1, 2 or 3. 'H','S' or 'T' key - Select game type Hexagon, Square or Triangle grid. Installation ------------ Edit the Makefile to set the paths for installation (INSTDIR), X windows libraries (XLIB) and the compiler options (CC, CFLAGS). make xbomb make install And all should be OK. This program has been tested on the following systems: Linux 1.x, 2.x SunOS 4.1.x Solaris 2.x Author & Copyright ------------------ Andrew M. Bishop (XBomb first written late 1994/early 1995) email: amb@gedanken.demon.co.uk [Please put xbomb in the subject line] This program is Copyright Andrew M. Bishop 1995-2008 and distributed under GPL. xbomb-2.2a/ChangeLog 644 233 144 15746 11304434054 7602 02009-11-29 Andrew M. Bishop Version 2.2a Released 2009-11-29 Andrew M. Bishop * xbomb.ad: Add the app-defaults for the different numbers (missed in version 2.2 release). * xbomb.c, xwindow.c: Change the colour of the number 8 from white (invisible) to light green. Change the version number to 2.2a. 2008-01-22 Andrew M. Bishop Version 2.2 Released 2008-01-05 Andrew M. Bishop * xbomb.6: Change the description of the mouse buttons, add description of the X resources for coloured numbers and update for version 2.2. * README: Change the description of the mouse buttons and update for version 2.2. * xbomb.c, xbomb.h, xwindow.c: Allow the left mouse button to be used to clear safe areas (like the middle button normally does) but only when the square has already been uncovered. * hiscore.c: Change how the player's username is determined to make it more portable. 2005-10-15 Andrew M. Bishop * icon.h: Remove gcc-4.0 signed/unsigned pointer warnings. * hiscore.c: Include string.h. 2002-11-25 Andrew M. Bishop * xwindow.c: Allow a different colour for each number. Sat Apr 10 18:30:00 1999 Andrew M. Bishop Version 2.1a Released Sat Apr 10 18:28:49 1999 Andrew M. Bishop * xbomb.c: Changed the version number to 2.1a. * xwindow.c: Improved the resizing options for the triangles game. Renamed the Start button to Restart. Mon Feb 23 18:49:26 1998 Andrew M. Bishop * xwindow.c: Changed the scaling so that smaller grids are allowed to fit a 800x640 screen. Sat Jan 24 10:40:00 1998 Andrew M. Bishop Version 2.1 Released Wed Jan 21 20:20:23 1998 Andrew M. Bishop * xwindow.c: Make the hiscore window highlight even when not popped up. Wed Jan 21 19:38:18 1998 Andrew M. Bishop * README: Updated for version 2.1. Wed Jan 21 19:36:21 1998 Andrew M. Bishop * xwindow.c: Stop the size changing so much. Fri Jan 16 19:50:56 1998 Andrew M. Bishop * xbomb.ad: Add in the defaults for the hi-score table. * hiscore.c, xbomb.c, xbomb.h, xwindow.c: Use global variables to simplify things. Thu Jan 15 19:55:31 1998 Andrew M. Bishop * xbomb.c, xbomb.h, xwindow.c, hiscore.c: Added a high score window in. Sun Jan 11 11:21:44 1998 Andrew M. Bishop * hiscore.c: Change the meaning of the level variable. * xbomb.c: Change the meaning of the level variable and start a game when type or level is changed. * xwindow.c: Handle window resizing better and ensure that tiles line up. Sat Jan 10 19:17:32 1998 Andrew M. Bishop * xbomb.ad: Added comments. Thu Jan 8 20:16:12 1998 Andrew M. Bishop * xwindow.c, hiscore.c, xbomb.c, xbomb.h: Tidied the source code and added some comments about the variables used. Wed Jan 7 21:25:11 1998 Andrew M. Bishop * xwindow.c: Enable the close button on the window manager menu as if the quit button was pressed. Tue Jan 30 21:54:39 1996 Andrew M. Bishop (amb@gedanken) * README: Ready to be uploaded to sunsite. Sat Jan 20 21:02:46 1996 Andrew M. Bishop (amb@gedanken) * Makefile: Added a default CC and CFLAGS. Thu Nov 16 20:16:39 1995 Andrew Bishop (amb@dan) * xbomb.c: Used rand() instead of random() to work on Solaris 2.3 * hiscore.c: Made work on Solaris 2.3 Wed Nov 15 19:26:42 1995 Andrew Bishop (amb@dan) * xwindow.c: Made work on Solaris 2.3 Tue Jul 18 20:58:37 1995 Andrew Bishop (amb@dan) * xbomb.6: Fixed minor man page bug. Tue Jul 11 19:17:38 1995 Andrew Bishop (amb@dan) * Makefile: Changed X386 to X11R6. Wed May 10 19:00:00 1995 Andrew Bishop (amb@dan) Version 2.0 Released Wed May 10 18:55:55 1995 Andrew Bishop (amb@dan) * xwindow.c: Put a title on the title bar with a copyright message. Mon Mar 20 18:51:19 1995 Andrew Bishop (amb@dan) * xwindow.c: Changed the ratio of width:height from 15:13 to 8:7, to allow finer resizing resolution on hex and tri. Sat Feb 4 16:48:59 1995 Andrew Bishop (amb@dan) * xwindow.c: Fixed the Control-Z clock goes funny bug. Thu Feb 2 19:01:51 1995 Andrew Bishop (amb@dan) * xbomb.c, xbomb.h, hiscore.c, xwindow.c: Fixed warning messages that appear when compiling on sun. Sat Jan 21 14:33:42 1995 Andrew Bishop (amb@dan) * xwindow.c: Added the missing label for 12 neighbours. Mon Jan 16 22:03:34 1995 Andrew Bishop (amb@dan) * Makefile: Added icon.h to the dependency list. * icon.h: Initial revision - The pixmap for the icon. * xwindow.c: Added an icon. * Makefile: Removed -g from the makefile Mon Jan 16 19:18:49 1995 Andrew Bishop (amb@dan) * hiscore.c, xwindow.c, xbomb.h, xbomb.c, xbomb.6: First selection is always safe and minor text input/output improvements. Sun Jan 15 17:43:44 1995 Andrew Bishop (amb@dan) * xwindow.c, xbomb.h, xbomb.c, xbomb.6, hiscore.c, README, Makefile: Version 2 - Triangular and Hexagonal grids added [This also includes many changes and improvements to the code along the way.] Wed Jan 11 21:00:00 1995 Andrew Bishop (amb@dan) Version 1.0 Released Wed Jan 11 20:53:59 1995 Andrew Bishop (amb@dan) * xbomb.ad: Change the UNSEEN colour to make it darker. * xwindow.c: Added a 'flag' pixmap for THINK_BOMB, use stipple for UNSEEN. Sun Dec 4 17:20:27 1994 Andrew Bishop (amb@dan) * Makefile: Added the app-defaults file to the installation. * xbomb.ad: A sample app-defaults file. Sun Dec 4 17:14:05 1994 Andrew Bishop (amb@dan) * xbomb.6: Improved the X-resources section. Sun Dec 4 16:40:51 1994 Andrew Bishop (amb@dan) * Makefile: Added a LIB. * Makefile: Added a strip when installing and removed the all target. Fri Dec 2 20:46:26 1994 Andrew Bishop (amb@dan) * Makefile: Install it in man6 not man1 * Makefile: Updated installation location. Tue Nov 29 21:08:02 1994 Andrew Bishop (amb@dan) * xbomb.c: Better updating of the screen. * xwindow.c: Changed print format for window when finished. * hiscore.c: Print with different formats for the different levels. * xbomb.c: Don't print time to win in here. * xwindow.c: Return the value in milliseconds not rounded. Fri Nov 25 19:48:30 1994 Andrew Bishop (amb@dan) * xwindow.c: Hi scores now in milli seconds. * hiscore.c: Hiscore table now stores scores to milli seconds. * xbomb.c: Can now print the hi scores and exit. * xbomb.6: Mention the print hiscore and exit option. Tue Nov 15 19:26:14 1994 Andrew Bishop (amb@dan) * Makefile: Added a clean option * Makefile: Added an install option. Tue Nov 8 20:09:03 1994 Andrew Bishop (amb@dan) * Makefile, README, hiscore.c, xbomb.6, xbomb.c, xbomb.h, xwindow.c: Initial revision xbomb-2.2a/Makefile 444 233 144 2135 6100254166 7414 0# $Header: /home/amb/xbomb/RCS/Makefile 1.13 1996/01/20 21:02:46 amb Exp $ # # XBomb - 'Minesweeper' game - Version 2 # # Makefile. # # Written by Andrew M. Bishop # # This file Copyright 1994 1995 Andrew M. Bishop # It may be distributed under the GNU Public License, version 2, or # any higher version. See section COPYING of the GNU Public license # for conditions under which this file may be redistributed. # CC=gcc CFLAGS=-O2 INCLUDES= LIB= XLIB=-L/usr/X11R6/lib -lXaw -lXmu -lXt -lX11 COMPILE=$(CC) -c $(CFLAGS) LINK=$(CC) OBJ=xbomb.o xwindow.o hiscore.o INSTDIR=/usr/local ######## xbomb : $(OBJ) $(LINK) $(OBJ) -o $@ $(LIB) $(XLIB) ######## %.o : %.c $(COMPILE) $< -o $@ $(INCLUDES) xbomb.o : xbomb.c xbomb.h xwindow.o : xwindow.c xbomb.h icon.h hiscore.o : hiscore.c xbomb.h ######## clean : -rm -f *.o *~ core ######## install : strip xbomb install -d $(INSTDIR)/bin install -d $(INSTDIR)/man/man6 install -d $(INSTDIR)/lib/app-defaults install -m 755 xbomb $(INSTDIR)/bin install -m 644 xbomb.6 $(INSTDIR)/man/man6 install -m 644 xbomb.ad $(INSTDIR)/lib/app-defaults/XBomb xbomb-2.2a/hiscore.c 444 233 144 17567 10737754433 7650 0/*************************************** $Header: /home/amb/xbomb/RCS/hiscore.c 1.13 2008/01/05 19:23:07 amb Exp $ XBomb - 'Minesweeper' game - Version 2.2. Hi-score table management. ******************/ /****************** Written by Andrew M. Bishop This file Copyright 1994-2007 Andrew M. Bishop It may be distributed under the GNU Public License, version 2, or any higher version. See section COPYING of the GNU Public license for conditions under which this file may be redistributed. ***************************************/ #include #include #include #include #include #if defined(__sun__) && !defined(__svr4__) int fprintf(FILE*, const char*,...); int printf(const char*, ... ); int sscanf(char*, const char*,...); int fread(void*,unsigned int,unsigned int, FILE*); int fwrite(const void*,unsigned int,unsigned int, FILE*); int fclose(FILE*); long time(long*); #endif #include #include #include #include "xbomb.h" /*+ The current information about the grid +*/ extern int grid_type, /*+ type. +*/ grid_level; /*+ level. +*/ /*+ The names of the different game +*/ extern char *levels[NLEVELS], /*+ levels (difficulty). +*/ *types[NTYPES]; /*+ types (grid shapes). +*/ /*+ The size of the grids +*/ extern int widths[NLEVELS], /*+ width in tiles. +*/ heights[NLEVELS], /*+ height in tiles. +*/ nbombs[NLEVELS]; /*+ number of bombs. +*/ /*+ The names of the high score tables. +*/ static char *filenames[NTYPES]={"/var/tmp/xbomb6.hi","/var/tmp/xbomb4.hi","/var/tmp/xbomb3.hi"}; /*+ The names of the positions in the high score tables. +*/ static char pos[11][5]={"Top","2nd","3rd","4th","5th","6th","7th","8th","9th","10th","Lost"}; /*+ The list of hi-scores for one grid type. +*/ static int score[NLEVELS+1][11]; /*+ The list of hi-score usernames for one grid type. +*/ static char name[NLEVELS+1][11][21]; /*+ The list of hi-score dates for one grid type. +*/ static long date[NLEVELS+1][11]; /*+ Which of the hoigh scores in the table to highlight. +*/ static int which_hiscore=-1; /*+ A structure to store the high score information in the file. +*/ struct score_name { long score; /*+ The time in milliseconds. +*/ char name[20]; /*+ The user name. +*/ long date; /*+ The time in seconds from the epoch. +*/ }; static void load_high_scores(void); static void save_high_scores(void); static void decrypt_score(struct score_name* sn); static void encrypt_score(struct score_name* sn); /*++++++++++++++++++++++++++++++++++++++ Prints the high score tables. ++++++++++++++++++++++++++++++++++++++*/ void PrintHighScores(void) { int l,j; load_high_scores(); printf("\nHigh score tables for %s\n",types[grid_type-GAME_TYPE]); for(l=0;lpw_name; else username="?unknown?"; which_hiscore=10; score[grid_level-GAME_LEVEL][10]=ticks; strcpy(name[grid_level-GAME_LEVEL][10],username); date[grid_level-GAME_LEVEL][10]=time(NULL); for(j=0;j<10;j++) if(tickschanged;j--) { score[grid_level-GAME_LEVEL][j]=score[grid_level-GAME_LEVEL][j-1]; strcpy(name[grid_level-GAME_LEVEL][j],name[grid_level-GAME_LEVEL][j-1]); date[grid_level-GAME_LEVEL][j]=date[grid_level-GAME_LEVEL][j-1]; } score[grid_level-GAME_LEVEL][changed]=ticks; strcpy(name[grid_level-GAME_LEVEL][changed],username); date[grid_level-GAME_LEVEL][changed]=time(NULL); save_high_scores(); } } /*++++++++++++++++++++++++++++++++++++++ Select a set of high scores for display. ++++++++++++++++++++++++++++++++++++++*/ void ShowHighScores(void) { char datestr[11][32],*scores[11][4],scorestr[11][10]; int i; load_high_scores(); for(i=0;i<11;i++) { if(i==10 && which_hiscore!=10) {scores[i][0]=scores[i][1]=scores[i][2]=scores[i][3]="";continue;} strcpy(datestr[i],ctime(&date[grid_level-GAME_LEVEL][i])); scores[i][0]=pos[i]; scores[i][1]=name[grid_level-GAME_LEVEL][i]; if(!date[grid_level-GAME_LEVEL][i]) scores[i][2]="SLOW"; else if(grid_level==GAME_EASY) {sprintf(scorestr[i],"%6.2f",(double)score[grid_level-GAME_LEVEL][i]/1000.0);scores[i][2]=scorestr[i];} else if(grid_level==GAME_MEDIUM) {sprintf(scorestr[i],"%6.1f",(double)score[grid_level-GAME_LEVEL][i]/1000.0);scores[i][2]=scorestr[i];} else {sprintf(scorestr[i],"%6.0f",(double)score[grid_level-GAME_LEVEL][i]/1000.0);scores[i][2]=scorestr[i];} if(date[grid_level-GAME_LEVEL][i]) scores[i][3]=datestr[i]; else scores[i][3]="Never"; } DisplayHighScores(scores,which_hiscore); which_hiscore=-1; } /*++++++++++++++++++++++++++++++++++++++ Load in the high score table. ++++++++++++++++++++++++++++++++++++++*/ static void load_high_scores(void) { FILE *f; int i,j; struct score_name sn; for(i=0;i #include #include #include #include #if defined(__sun__) && !defined(__svr4__) int printf(const char*, ... ); int tolower (int c); time_t time(time_t *t); int rand(void); #endif #include "xbomb.h" /*+ The names of the different game +*/ char *levels[NLEVELS]={"Easy","Medium","Difficult"}, /*+ levels (difficulty). +*/ *types [NTYPES] ={"Hexagons","Squares","Triangles"}; /*+ types (grid shapes). +*/ /*+ The size of the grids +*/ int widths [NLEVELS]={ 8 ,16 ,30}, /*+ width in tiles. +*/ heights[NLEVELS]={ 8 ,16 ,16}, /*+ height in tiles. +*/ nbombs [NLEVELS]={10 ,40 ,99}; /*+ number of bombs. +*/ /*+ The current game status +*/ static int status=GAME_WAIT; /*+ The current information about the grid +*/ int grid_width, /*+ width. +*/ grid_height, /*+ height. +*/ grid_bombs, /*+ number of bombs. +*/ grid_level, /*+ level. +*/ grid_type; /*+ type. +*/ /*+ The status of the tiles in the grid. +*/ static unsigned char state[MAX_SIZE][MAX_SIZE]; /*+ The status of the game, +*/ static int n_unseen, /*+ the number of tiles unseen. +*/ n_think, /*+ the number of flags put down. +*/ ticks; /*+ The number of milliseconds of time passed. +*/ static int count_adjacent(int x,int y,int flag); /*++++++++++++++++++++++++++++++++++++++ The main program. int argc The command line parameters. char** argv The command line parameters. ++++++++++++++++++++++++++++++++++++++*/ int main(int argc,char** argv) { int level=GAME_EASY,type=GAME_SQUARE; /* Default values. */ int xstatus=0; long t; printf("\n" "XBomb Version 2.2a\n" "\n" "(c) Andrew M. Bishop 1994-2009. [amb@gedanken.demon.co.uk]\n" "\n"); if(argc>1) { int i,j; for(j=0;j2 && !strncmp("-hiscore",argv[i],strlen(argv[i]))) { grid_type=type; PrintHighScores(); exit(0); } } t=time(&t); srand((unsigned int)t); InitialiseX(&argc,argv); StartGame(level,type); ShowHighScores(); for(;;) { xstatus=ProcessXEvents(); if(xstatus==GAME_QUIT) break; if(xstatus>=GAME_LEVEL && xstatus<(GAME_LEVEL+NLEVELS) && xstatus!=level) { level=xstatus; xstatus=GAME_START; } if(xstatus>=GAME_TYPE && xstatus<(GAME_TYPE+NTYPES) && xstatus!=type) { type=xstatus; xstatus=GAME_START; } if(xstatus==GAME_START) { if(status==GAME_CONTINUES) StopGame(); StartGame(level,type); ShowHighScores(); } if(status==GAME_WON) { StopGame(); AddHighScore(ticks); ShowHighScores(); } else if(status==GAME_LOST) { StopGame(); ShowHighScores(); } } FinishUpX(); return(0); } /*++++++++++++++++++++++++++++++++++++++ Start a new game. int level The level of the game to play. int type The type of game to play. ++++++++++++++++++++++++++++++++++++++*/ void StartGame(int level,int type) { int x,y; grid_type=type; grid_level=level; grid_width=widths[level-GAME_LEVEL]; grid_height=heights[level-GAME_LEVEL]; grid_bombs=nbombs[level-GAME_LEVEL]; n_unseen=grid_width*grid_height; n_think=0; status=GAME_READY; for(x=0;x>8)%grid_width; y=(rand()>>8)%grid_height; } while(state[x][y]!=UNSEEN || count_adjacent(x,y,CORRECT)); state[x][y]+=ACTUAL_BOMB; } state[xs][ys]-=CORRECT; for(x=0;x=grid_width) continue; for(dy=-1;dy<=1;dy++) { if((y+dy)<0 || (y+dy)>=grid_height) continue; if(dx==0 && dy==0) continue; if(grid_type==GAME_HEXAGON && dy!=0 && dx==(1-2*(y%2))) continue; if(grid_type==GAME_TRIANGLE && dy==(2*((x+y)%2)-1) && (dx==-2 || dx==2)) continue; if(!(state[x+dx][y+dy]&THINK_BOMB)) SelectSquare(x+dx,y+dy); } } } /*++++++++++++++++++++++++++++++++++++++ Marks as a bomb the square. int x The location of the square. int y The location of the square. ++++++++++++++++++++++++++++++++++++++*/ void MarkBomb(int x,int y) { if(!(state[x][y]&UNSEEN) || status==GAME_WAIT) return; if(n_think==grid_bombs && !(state[x][y]&THINK_BOMB)) return; state[x][y]^=THINK_BOMB; if(state[x][y]&THINK_BOMB) n_think++; else n_think--; SetUXB(grid_bombs-n_think); DrawSquare(x,y,state[x][y]); if(n_think==n_unseen) status=GAME_WON; } /*++++++++++++++++++++++++++++++++++++++ Removes the empty squares around here int x Start from this position. int y Start from this position. ++++++++++++++++++++++++++++++++++++++*/ void RemoveEmpties(int x, int y) { int dx,dy,dd=(grid_type==GAME_TRIANGLE?2:1); if(!(state[x][y]&UNSEEN) || state[x][y]&THINK_BOMB) return; state[x][y]&=~UNSEEN; n_unseen--; DrawSquare(x,y,state[x][y]); if(state[x][y]!=EMPTY) return; for(dx=-dd;dx<=dd;dx++) { if((x+dx)<0 || (x+dx)>=grid_width) continue; for(dy=-1;dy<=1;dy++) { if((y+dy)<0 || (y+dy)>=grid_height) continue; if(dx==0 && dy==0) continue; if(grid_type==GAME_HEXAGON && dy!=0 && dx==(1-2*(y%2))) continue; if(grid_type==GAME_TRIANGLE && dy==(2*((x+y)%2)-1) && (dx==-2 || dx==2)) continue; RemoveEmpties(x+dx,y+dy); } } } /*++++++++++++++++++++++++++++++++++++++ Count the number of adjacent squares that are bombs. int count_adjacent Returns the number of adjacent tiles with the specified flag. int x The position to start from. int y The position to start from. int flag The type of thing to look for. ++++++++++++++++++++++++++++++++++++++*/ static int count_adjacent(int x,int y,int flag) { int n=0,dx,dy,dd=(grid_type==GAME_TRIANGLE?2:1); for(dx=-dd;dx<=dd;dx++) { if((x+dx)<0 || (x+dx)>=grid_width) continue; for(dy=-1;dy<=1;dy++) { if((y+dy)<0 || (y+dy)>=grid_height) continue; if(grid_type==GAME_HEXAGON && dy!=0 && dx==(1-2*(y%2))) continue; if(grid_type==GAME_TRIANGLE && dy==(2*((x+y)%2)-1) && (dx==-2 || dx==2)) continue; if(state[x+dx][y+dy]&flag) n++; } } return(n); } xbomb-2.2a/xbomb.h 444 233 144 5654 10737754540 7301 0/*************************************** $Header: /home/amb/xbomb/RCS/xbomb.h 1.9 2008/01/05 19:24:16 amb Exp $ XBomb - 'Minesweeper' game - Version 2.2. Global header file. ******************/ /****************** Written by Andrew M. Bishop This file Copyright 1994-2007 Andrew M. Bishop It may be distributed under the GNU Public License, version 2, or any higher version. See section COPYING of the GNU Public license for conditions under which this file may be redistributed. ***************************************/ #ifndef XBOMB_H #define XBOMB_H /* State of each square */ #define EMPTY 0 /*+ No bomb. +*/ #define ACTUAL_BOMB 16 /*+ Really is a bomb. +*/ #define THINK_BOMB 32 /*+ User thinks there is a bomb. +*/ #define UNSEEN 64 /*+ Not seen by user. +*/ #define CORRECT 128 /*+ guessed correctly at end of game. +*/ /* Status of game */ #define GAME_CONTINUES 0 /*+ Normal state during game. +*/ #define GAME_WAIT 1 /*+ Waiting for start to be pressed. +*/ #define GAME_LOST 2 /*+ Just finished a game and lost. +*/ #define GAME_WON 3 /*+ Just finished a game and won. +*/ #define GAME_READY 4 /*+ Ready to start playing. +*/ /* Status of game from the X part */ #define GAME_START 10 /*+ User has pressed start button. +*/ #define GAME_QUIT 11 /*+ User has pressed quit button. +*/ /* The level of difficulty */ #define GAME_LEVEL 12 /*+ Starting point for the levels. +*/ #define GAME_EASY 12 /*+ The Easy level. +*/ #define GAME_MEDIUM 13 /*+ The Medium level. +*/ #define GAME_DIFFICULT 14 /*+ The Difficult level. +*/ /* The type of game */ #define GAME_TYPE 20 /*+ Starting point for the game types. +*/ #define GAME_HEXAGON 20 /*+ The hexagons game. +*/ #define GAME_SQUARE 21 /*+ The squares game. +*/ #define GAME_TRIANGLE 22 /*+ The triangles game. +*/ /* The levels */ #define NLEVELS 3 /*+ The number of levels. +*/ #define MAX_SIZE 30 /*+ The maximum size of the grid. +*/ /* The game types */ #define NTYPES 3 /*+ The number of types of game. +*/ /* In hiscore.c */ void PrintHighScores(void); void AddHighScore(int ticks); void ShowHighScores(void); /* In xbomb.c */ void StartGame(int level,int type); void HideBombs(int xs,int ys); void StopGame(void); void DrawGrid(void); void SelectSquare(int x,int y); void SelectSquareOrAdjacent(int x,int y); void SelectAdjacent(int x,int y); void MarkBomb(int x,int y); void RemoveEmpties(int x, int y); /* In xwindow.c */ void InitialiseX(int *argc,char **argv); void FinishUpX(void); int ProcessXEvents(void); void DrawSquare(int x,int y,unsigned char value); void DisplayHighScores(char *scores[11][4],int which_score); void ScaleWindow(void); void StartClock(int reset); int StopClock(void); void SetUXB(int n); #endif xbomb-2.2a/xwindow.c 444 233 144 77171 11304433335 7672 0/*************************************** $Header: /home/amb/xbomb/RCS/xwindow.c 1.26 2009/11/29 08:54:53 amb Exp $ XBomb - 'Minesweeper' game - Version 2.2a. All X Window functions. ******************/ /****************** Written by Andrew M. Bishop This file Copyright 1994-2009 Andrew M. Bishop It may be distributed under the GNU Public License, version 2, or any higher version. See section COPYING of the GNU Public license for conditions under which this file may be redistributed. ***************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "xbomb.h" #include "icon.h" #if defined(__sun__) && !defined(__svr4__) int gettimeofday(struct timeval *tv, struct timezone *tz); #endif /*+ The current information about the grid +*/ extern int grid_width, /*+ width. +*/ grid_height, /*+ height. +*/ grid_bombs, /*+ number of bombs. +*/ grid_type, /*+ type. +*/ grid_level; /*+ level. +*/ /*+ The names of the different game +*/ extern char *levels[NLEVELS], /*+ levels (difficulty). +*/ *types[NTYPES]; /*+ types (grid shapes). +*/ static int xoffset,yoffset; static int status=0; static int unsigned scalex=10,scaley=10; static int unsigned pixw,pixh; static XtAppContext app_context; static Display* display; static Window play_window; static Widget play_area,clock_w,uxb_w,hiscore,toplevel; static Widget highscore,highscoresform,highscores[12][4]; static Pixmap icon_p,bombpix[2]={0,0}; static XPoint outline[8]; static void size_expose_proc(Widget w,XtPointer va,XEvent* e,Boolean* vb); static void mouse_press_proc(Widget w,XtPointer va,XEvent* e,Boolean* vb); static void key_press_proc(Widget w,XtPointer va,XEvent* e,Boolean* vb); static void change_status_proc(Widget widget,XtPointer clientData,XtPointer callData); static void hiscore_proc(Widget widget,XtPointer clientData,XtPointer callData); static void close_proc(Widget w,XtPointer va,XEvent* e,Boolean* vb); static void display_clock(XtPointer p,XtIntervalId i); static int msecs(void); #define GC_BOMB 0 /*+ For drawing the bomb and flag foreground. +*/ #define GC_ACTUAL_BACK 1 /*+ For drawing the bomb background. +*/ #define GC_THINK_BACK 2 /*+ For drawing the flag background. +*/ #define GC_NUMBER1 3 /*+ For drawing the number 1 on the grid. +*/ #define GC_NUMBER2 4 /*+ For drawing the number 2 +*/ #define GC_NUMBER3 5 /*+ For drawing the number 3 +*/ #define GC_NUMBER4 6 /*+ For drawing the number 4 +*/ #define GC_NUMBER5 7 /*+ For drawing the number 5 +*/ #define GC_NUMBER6 8 /*+ For drawing the number 6 +*/ #define GC_NUMBER7 9 /*+ For drawing the number 7 +*/ #define GC_NUMBER8 10 /*+ For drawing the number 8 +*/ #define GC_NUMBER9 11 /*+ For drawing the number 9 +*/ #define GC_NUMBER10 12 /*+ For drawing the number 10 (A) +*/ #define GC_NUMBER11 13 /*+ For drawing the number 11 (B) +*/ #define GC_NUMBER12 14 /*+ For drawing the number 12 (C) +*/ #define GC_UNSEEN 15 /*+ For unseen (hidden) tiles. +*/ #define GC_CORRECT 16 /*+ For correctly guessed tiles at the end.+*/ #define GC_BLANK 17 /*+ For blank squares. +*/ #define NUM_GC 18 /*+ A structure to hold the colour and font resource data in. +*/ struct temp { XFontStruct* fontstruct; /*+ The font. +*/ Pixel colours[NUM_GC-1]; /*+ The colours. +*/ } resources; /*+ An array to hold the GCs in. +*/ static GC gc[NUM_GC]; /*+ The colour resources for the map. +*/ static XtResource xresources[]= { {"font" , "XBomb", XtRFontStruct, sizeof(XFontStruct*), 0 , XtRString, "lucidasans-24"}, {"bomb" , "XBomb", XtRPixel , sizeof(String) , sizeof(String), XtRString, "black" }, {"bombreal", "XBomb", XtRPixel , sizeof(String) , 2*sizeof(String), XtRString, "red" }, {"bombmark", "XBomb", XtRPixel , sizeof(String) , 3*sizeof(String), XtRString, "orange" }, {"number" , "XBomb", XtRPixel , sizeof(String) , 4*sizeof(String), XtRString, "navyblue" }, {"number2" , "XBomb", XtRPixel , sizeof(String) , 5*sizeof(String), XtRString, "darkgreen" }, {"number3" , "XBomb", XtRPixel , sizeof(String) , 6*sizeof(String), XtRString, "darkred" }, {"number4" , "XBomb", XtRPixel , sizeof(String) , 7*sizeof(String), XtRString, "black" }, {"number5" , "XBomb", XtRPixel , sizeof(String) , 8*sizeof(String), XtRString, "turquoise" }, {"number6" , "XBomb", XtRPixel , sizeof(String) , 9*sizeof(String), XtRString, "orange" }, {"number7" , "XBomb", XtRPixel , sizeof(String) ,10*sizeof(String), XtRString, "violet" }, {"number8" , "XBomb", XtRPixel , sizeof(String) ,11*sizeof(String), XtRString, "lightgreen" }, {"number9" , "XBomb", XtRPixel , sizeof(String) ,12*sizeof(String), XtRString, "blue" }, {"number10", "XBomb", XtRPixel , sizeof(String) ,13*sizeof(String), XtRString, "blue" }, {"number11", "XBomb", XtRPixel , sizeof(String) ,14*sizeof(String), XtRString, "blue" }, {"number12", "XBomb", XtRPixel , sizeof(String) ,15*sizeof(String), XtRString, "blue" }, {"hidden" , "XBomb", XtRPixel , sizeof(String) ,16*sizeof(String), XtRString, "grey50" }, {"correct" , "XBomb", XtRPixel , sizeof(String) ,17*sizeof(String), XtRString, "green" } }; /*++++++++++++++++++++++++++++++++++++++ Open the X connection. int *argc A pointer to the command line parameters. char **argv The pointer to the command line parameters. ++++++++++++++++++++++++++++++++++++++*/ void InitialiseX(int *argc,char **argv) { Atom close_atom; XFontStruct *fontstruct; XGCValues values; Widget form,quit,start,menu,menushell; int i; /* Initialise the display */ toplevel=XtVaAppInitialize(&app_context,"XBomb", NULL, (Cardinal)0,argc,argv,NULL, XtNtitle,"XBomb V2.2a", XtNiconName,"XBomb", NULL); display=XtDisplay(toplevel); /* Create the widgets */ form=XtVaCreateManagedWidget("form",formWidgetClass,toplevel, XtNwidth,100,XtNheight,100, NULL); XtAddEventHandler(form,KeyReleaseMask,False,(XtEventHandler)key_press_proc,NULL); start=XtVaCreateManagedWidget("start",commandWidgetClass,form, XtNlabel,"Restart", XtNfromHoriz,NULL,XtNfromVert,NULL, XtNleft,XtChainLeft,XtNtop,XtChainTop,XtNright,XtChainLeft,XtNbottom,XtChainTop, NULL); XtAddCallback(start,XtNcallback,change_status_proc,(XtPointer)GAME_START); menu=XtVaCreateManagedWidget("menu",menuButtonWidgetClass,form, XtNlabel,"Level", XtNmenuName,"levelmenushell", XtNfromHoriz,start,XtNfromVert,NULL, XtNleft,XtChainLeft,XtNtop,XtChainTop,XtNright,XtChainLeft,XtNbottom,XtChainTop, NULL); menushell=XtCreatePopupShell("levelmenushell",simpleMenuWidgetClass,menu,NULL,0); for(i=0;ifid; for(i=0;iascent/2; /* Put an action on the close button */ close_atom=XInternAtom(display,"WM_DELETE_WINDOW",False); XSetWMProtocols(display,XtWindow(toplevel),&close_atom,1); XtAddEventHandler(toplevel,0,True,close_proc,NULL); XSetWMProtocols(display,XtWindow(highscore),&close_atom,1); XtAddEventHandler(highscore,0,True,close_proc,NULL); } /*++++++++++++++++++++++++++++++++++++++ Close the X connection. ++++++++++++++++++++++++++++++++++++++*/ void FinishUpX(void) { int i; /* Free the graphics contexts. */ for(i=0;i0 && (value&~CORRECT)<=12) { int text_xpos=xpos+pixw/2-xoffset; int text_ypos=ypos+pixh/2+yoffset; int gc_number=(value&~CORRECT)+GC_NUMBER1-1; /* Calculate GC_NUMBERx offset. */ XDrawString(display,play_window,gc[gc_number],text_xpos,text_ypos,grid_numbers[(value&~CORRECT)],1); } /* Draw the correct squares at the end. */ if(value&CORRECT) which_gc=GC_CORRECT; else which_gc=GC_BOMB; switch(grid_type) { case GAME_HEXAGON: XDrawLines(display,play_window,gc[which_gc],outline,7,CoordModePrevious); break; case GAME_SQUARE: XDrawRectangle(display,play_window,gc[which_gc],xpos,ypos,scalex-1,scaley-1); break; case GAME_TRIANGLE: if((x+y)%2) XDrawLines(display,play_window,gc[which_gc],&outline[4],4,CoordModePrevious); else XDrawLines(display,play_window,gc[which_gc],&outline[0],4,CoordModePrevious); break; } } /*++++++++++++++++++++++++++++++++++++++ Display the high scores. char *scores[11][4] The score information. int which_score Which score was just completed. ++++++++++++++++++++++++++++++++++++++*/ void DisplayHighScores(char *scores[11][4],int which_score) { int i,j; Pixel fore,back; XtVaSetValues(highscores[0][0],XtNlabel,"Pos",NULL); XtVaSetValues(highscores[0][1],XtNlabel,"Name",NULL); XtVaSetValues(highscores[0][2],XtNlabel,"Time",NULL); XtVaSetValues(highscores[0][3],XtNlabel,"Date",NULL); XtVaGetValues(highscores[0][0], XtNbackground,&back,XtNforeground,&fore, NULL); for(j=0;j<4;j++) XtVaSetValues(highscores[0][j], XtNforeground,fore, XtNbackground,back, NULL); for(i=0;i<11;i++) for(j=0;j<4;j++) XtVaSetValues(highscores[i+1][j], XtNforeground,i==which_score?back:fore, XtNbackground,i==which_score?fore:back, XtNlabel,scores[i][j], NULL); } /*++++++++++++++++++++++++++++++++++++++ A callback that is activated by an expose event on the play area window. Widget w The widget that caused the callback. XtPointer va Not used. XEvent* e The event that requires action. Boolean* vb Not used. This function is only ever called from the Xt Intrinsics routines. ++++++++++++++++++++++++++++++++++++++*/ static void size_expose_proc(Widget w,XtPointer va,XEvent* e,Boolean* vb) { if(e->type==ConfigureNotify) ScaleWindow(); if(e->type==MapNotify || (e->type==Expose && !e->xexpose.count)) DrawGrid(); } /*++++++++++++++++++++++++++++++++++++++ Scales the window. ++++++++++++++++++++++++++++++++++++++*/ void ScaleWindow(void) { unsigned short old_width,old_height; unsigned short new_width=0,new_height=0; /* Get the old size. */ XtVaGetValues(play_area,XtNwidth,&old_width,XtNheight,&old_height,NULL); /* Choose a new size */ switch(grid_type) { case GAME_HEXAGON: scalex=(int)old_width*2/(7*(2*grid_width+1)/6); scaley=(int)old_height*3/(3*grid_height+1); scaley=6*((scalex+scaley)/12); if(scaley<30) scaley=18; scalex=(scaley*7)/6; new_width =scalex*(2*grid_width+1)/2; new_height=scaley*(3*grid_height+1)/3; break; case GAME_SQUARE: scalex=(int)old_width /grid_width; scaley=(int)old_height/grid_height; scalex=scaley=(scalex+scaley)/2; if(scalex<30) scalex=scaley=20; new_width =scalex*grid_width; new_height=scaley*grid_height; break; case GAME_TRIANGLE: scalex=(int)old_width*2/(grid_width+1); scaley=(int)old_height/(7*grid_height/8); scalex=4*((scalex+scaley)/8); if(scalex<16) scalex=16; scaley=(scalex*7)/8; new_width =scalex/2*(grid_width+1); new_height=scaley*grid_height; break; } /* If changed then re-size the window. */ if(new_width!=old_width || new_height!=old_height) { unsigned short width,height; new_width-=old_width; new_height-=old_height; XtVaGetValues(XtParent(XtParent(play_area)),XtNwidth,&width,XtNheight,&height,NULL); XResizeWindow(display,XtWindow(XtParent(XtParent(play_area))),(unsigned)(width+new_width),(unsigned)(height+new_height)); } else /* Must be here due to a correct sizing. */ { int i; /* Get the outline of a funny shape tile. */ if(grid_type==GAME_HEXAGON) { /* outline[0] is filled at the time of drawing */ outline[1].x= (int)scalex/2; outline[1].y=-(int)scaley/3; outline[2].x= (int)scalex/2; outline[2].y= (int)scaley/3; outline[3].x= 0; outline[3].y=-(int)scaley/3+scaley; outline[4].x=-(int)scalex/2; outline[4].y= (int)scaley/3; outline[5].x=-(int)scalex/2; outline[5].y=-(int)scaley/3; outline[6].x= 0; outline[6].y= (int)scaley/3-scaley; } else if(grid_type==GAME_TRIANGLE) { /* outline[0] is filled at the time of drawing */ outline[1].x=-(int)scalex/2+1; outline[1].y= (int)scaley-1; outline[2].x= (int)scalex-2; outline[2].y=0; outline[3].x=-(int)scalex/2+1; outline[3].y=-(int)scaley+1; /* outline[4] is filled at the time of drawing */ outline[5].x=-(int)scalex/2+1; outline[5].y=-(int)scaley; outline[6].x= (int)scalex-2; outline[6].y=0; outline[7].x=-(int)scalex/2+1; outline[7].y= (int)scaley; } /* Draw the bomb and flag pixmaps. */ for(i=0;i<2;i++) { if(grid_type==GAME_SQUARE) pixw=scalex,pixh=scaley; else if(grid_type==GAME_HEXAGON) pixw=scalex,pixh=scaley*2/3; else pixw=scalex/2,pixh=scaley/2; if(bombpix[i]) XFreePixmap(display,bombpix[i]); bombpix[i]=XCreatePixmap(display,XtWindow(play_area),pixw,pixh,(unsigned)DefaultDepthOfScreen(XtScreen(play_area))); XFillRectangle(display,bombpix[i],gc[i+1],0,0,pixw,pixh); if(i==0) { XFillArc(display,bombpix[i],gc[GC_BOMB],(signed)pixw/4,(signed)pixh/2-2,pixw/2,pixh/2,0,360*64); XFillRectangle(display,bombpix[i],gc[GC_BOMB],3*(signed)pixw/8,3*(signed)pixh/8,pixw/4,pixh/4); XDrawLine(display,bombpix[i],gc[GC_BOMB],(signed)pixw/2,(signed)pixh/2,(signed)pixw/2,(signed)pixh/4); XDrawArc(display,bombpix[i],gc[GC_BOMB],(signed)pixw/2,2,pixw/2,pixh/2,70*64,110*64); } else { XPoint points[3]; XFillArc(display,bombpix[i],gc[GC_BOMB],(signed)pixw/4,(signed)pixh*3/4-2,pixw/2,pixh/2,0,180*64); XDrawLine(display,bombpix[i],gc[GC_BOMB],(signed)pixw/2,(signed)pixh*3/4,(signed)pixw/2,(signed)pixh/4); points[0].x=pixw/2; points[0].y=pixh/8; points[1].x=pixw*4/5; points[1].y=pixh/4; points[2].x=pixw/2; points[2].y=pixh*3/8; XFillPolygon(display,bombpix[i],gc[GC_BOMB],points,3,Convex,CoordModeOrigin); } } /* Redraw the whole grid. */ XClearWindow(display,play_window); DrawGrid(); } } /*++++++++++++++++++++++++++++++++++++++ A callback that is activated by a mouse press in the play area window. Widget w The widget that caused the callback. XtPointer va Not used. XEvent* e The event that requires action. Boolean* vb Not used. This function is only ever called from the Xt Intrinsics routines. ++++++++++++++++++++++++++++++++++++++*/ static void mouse_press_proc(Widget w,XtPointer va,XEvent* e,Boolean* vb) { int x=-1,y=-1; int x_guess,y_guess,dx,dy; int i,j,d,dmin=1e6; /* Work out which tile mouse pressed in. */ switch(grid_type) { case GAME_HEXAGON: y_guess=e->xbutton.y/scaley; x_guess=(e->xbutton.x-(y_guess%2)*scalex/2)/scalex; for(i=x_guess-1;i<=(x_guess+1);i++) for(j=y_guess-1;j<=(y_guess+1);j++) { if(i<0 || i>=grid_width || j<0 || j>=grid_height) continue; dx=e->xbutton.x-(i*scalex+(1+(j%2))*scalex/2); dy=e->xbutton.y-(j*scaley+2*scaley/3); d=dx*dx+dy*dy; if(dxbutton.x/scalex; y=e->xbutton.y/scaley; break; case GAME_TRIANGLE: x_guess=e->xbutton.x*2/scalex; y=e->xbutton.y/scaley; for(i=x_guess-1;i<=(x_guess+1);i++) { if(i<0 || i>=grid_width) continue; dx=e->xbutton.x-(i*scalex/2+scalex/2); dy=e->xbutton.y-(y*scaley+(1+(1+i+y)%2)*scaley/3); d=dx*dx+dy*dy; if(d=grid_width || y<0 || y>=grid_height) {XBell(display,0);return;} /* Do something based on button number. */ switch(e->xbutton.button) { case 1: SelectSquareOrAdjacent(x,y); break; case 2: SelectAdjacent(x,y); break; case 3: MarkBomb(x,y); break; } } /*++++++++++++++++++++++++++++++++++++++ A callback that is activated by a key press in the play area window. Widget w The widget that caused the callback. XtPointer va Not used. XEvent* e The event that requires action. Boolean* vb Not used. This function is only ever called from the Xt Intrinsics routines. ++++++++++++++++++++++++++++++++++++++*/ static void key_press_proc(Widget w,XtPointer va,XEvent* e,Boolean* vb) { KeySym k=XLookupKeysym((XKeyEvent*)e,0); Boolean shift=((XKeyEvent*)e)->state==ShiftMask || ((XKeyEvent*)e)->state==ControlMask; if(k==NoSymbol)return; /* Do an action based on which key is pressed. */ switch(k) { case XK_1: status=GAME_EASY; break; case XK_2: status=GAME_MEDIUM; break; case XK_3: status=GAME_DIFFICULT; break; case XK_s: if(shift) status=GAME_SQUARE; else status=GAME_START; break; case XK_h: if(shift) status=GAME_HEXAGON; else hiscore_proc(NULL,NULL,NULL); break; case XK_q: do { if(w==toplevel) {status=GAME_QUIT;break;} if(w==highscore) {hiscore_proc(NULL,NULL,NULL);break;} } while((w=XtParent(w))); break; case XK_t: if(shift) status=GAME_TRIANGLE; break; default: ; } } /*++++++++++++++++++++++++++++++++++++++ This function changes the state of the status flag. Widget widget Not used. XtPointer clientData The new status. XtPointer callData Not used. This function is only ever called from the Xt Intrinsics routines. ++++++++++++++++++++++++++++++++++++++*/ static void change_status_proc(Widget widget,XtPointer clientData,XtPointer callData) { status=(int)clientData; } /*++++++++++++++++++++++++++++++++++++++ This function displays the hi-scores. Widget widget Not used. XtPointer clientData Not used. XtPointer callData Not used. This function is only ever called from the Xt Intrinsics routines. ++++++++++++++++++++++++++++++++++++++*/ static void hiscore_proc(Widget widget,XtPointer clientData,XtPointer callData) { static Boolean state=False; state=!state; if(!widget) XtVaSetValues(hiscore,XtNstate,state,NULL); if(state) XtPopup(highscore,XtGrabNone); else XtPopdown(highscore); } /*++++++++++++++++++++++++++++++++++++++ A callback that is activated by a close window event on the toplevel window. Widget w The widget that caused the callback. XtPointer va Not used. XEvent* e The event that requires action. Boolean* vb Not used. This function is only ever called from the Xt Intrinsics routines. ++++++++++++++++++++++++++++++++++++++*/ static void close_proc(Widget w,XtPointer va,XEvent* e,Boolean* vb) { XClientMessageEvent *cev=(XClientMessageEvent*)e; Atom atom_type=XInternAtom(display,"WM_PROTOCOLS",False); if(atom_type==cev->message_type) { Atom atom_proto=XInternAtom(display,"WM_DELETE_WINDOW",False); if(cev->format==32 && atom_proto==(Atom)cev->data.l[0]) { if(w==toplevel) status=GAME_QUIT; else hiscore_proc(NULL,NULL,NULL); } } } /*++++++++++++++++++++++++++++++++++++++ Sets the number of UXB in the grid. int n The number of UXB. ++++++++++++++++++++++++++++++++++++++*/ void SetUXB(int n) { char string[16]; sprintf(string,"UXB : %3d",n); XtVaSetValues(uxb_w,XtNlabel,string,NULL); } /*------------ The clock -------------*/ static int ticks; static XtIntervalId id; static struct timeval starttimeval; /*++++++++++++++++++++++++++++++++++++++ The function called for each clock tick. XtPointer p Not used. XtIntervalId i Not used. This function is only called from the Intrinsics. ++++++++++++++++++++++++++++++++++++++*/ static void display_clock(XtPointer p,XtIntervalId i) { char string[16]; int ticks1000=msecs(); ticks=ticks1000/1000; ticks1000-=1000*ticks; id=XtAppAddTimeOut(app_context,(unsigned)(1000-ticks1000),(XtTimerCallbackProc)display_clock,NULL); sprintf(string,"Time : %4d",ticks); XtVaSetValues(clock_w,XtNlabel,string,NULL); } /*++++++++++++++++++++++++++++++++++++++ Starts the clock int reset If 0 then resets the clock else if 1 then starts the clock. ++++++++++++++++++++++++++++++++++++++*/ void StartClock(int reset) { if(reset) { gettimeofday(&starttimeval,NULL); display_clock(NULL,0); } else { char string[16]; sprintf(string,"Time : 0"); XtVaSetValues(clock_w,XtNlabel,string,NULL); } } /*++++++++++++++++++++++++++++++++++++++ Stops the clock and returns the time in seconds. int StopClock Returns the time in seconds. ++++++++++++++++++++++++++++++++++++++*/ int StopClock(void) { char string[16]; XtRemoveTimeOut(id); ticks=msecs(); sprintf(string,"Time : %8.3f",(double)ticks/1000.0); XtVaSetValues(clock_w,XtNlabel,string,NULL); return(ticks); } /*++++++++++++++++++++++++++++++++++++++ Returns the number of milliseconds since starting the game. int msecs The number of milli-seconds. ++++++++++++++++++++++++++++++++++++++*/ static int msecs(void) { struct timeval nowtimeval; gettimeofday(&nowtimeval,NULL); return(1000*(nowtimeval.tv_sec-starttimeval.tv_sec)+(nowtimeval.tv_usec-starttimeval.tv_usec)/1000); } xbomb-2.2a/xbomb.6 444 233 144 10535 10737754271 7232 0.\" This file Copyright 1994-2008 Andrew M. Bishop. .\" It may be distributed under the GNU Public License, version 2, or .\" any higher version. See section COPYING of the GNU Public license .\" for conditions under which this file may be redistributed. .\" .\" XBOMB manual page .\" By Andrew M. Bishop November 94 + January 95 + January 2008 .\" .TH XBomb 1 "January 5, 2008" .SH NAME xbomb Version 2 \- a version of the popular minesweeper program with some novel features. .SH SYNOPSIS .B xbomb .BR [\-hexagon | \-square | \-triangle] .BR [\-1 | \-2 | \-3] .BR [\-hiscore] .SH OPTIONS .TP .BR \-hiscore command line option displays the current hi-score table without starting the game. .TP .BR \-hexagon \ | \ \-square \ | \ \-triangle Selects the type of grid to use when starting the game. .TP .BR \-1 \ | \ \-2 \ | \ \-3 Selects the level to use when starting the game. .TP The standard X window options also apply to this program. .SH DESCRIPTION A game of logical deduction against the clock. The purpose of the game is to find the location of the hidden bombs in a grid. Each of the locations in the grid is initially covered, by uncovering a locations, a number or a bomb will be revealed underneath. If a bomb is revealed then the game is finished. A number indicates the number of adjacent locations that contain bombs. Locations that have not been uncovered but are thought to contain bombs can be marked as such so that they can be identified. There is a choice of hexagonal, square or triangular units that make up the grid, the level of difficulty increasing as the number of sides decreases. In all cases the grids are of the same size and contain the same number of bombs for the same levels. There are three levels to the game: .TP .BR Easy 8 by 8 grid with 10 bombs. .TP .BR Medium 16 by 16 grid with 40 bombs. .TP .BR Difficult 30 by 16 grid with 99 bombs. .LP A high score table is maintained for each of the levels for each of the grid types, storing the username, the time to complete the puzzle and the date that it was finished. .SH MOUSE OPERATION The game is played with the mouse, with all three buttons having different actions. .TP .BR Left \ Button Uncover the current location if it is hidden or uncover all surrounding locations marked as not containing bombs if the square is already uncovered. The first selection made in a game is always a 'safe' square. .TP .BR Middle \ Button Uncover all surrounding locations that are not marked as containing a bomb. .TP .BR Right \ Button Mark the current grid location as having a hidden bomb (toggle). .SH KEYSTROKES There are a number of keystroke shortcuts for the game: .TP .BR 1 \ 2 \ 3 Select level 1, 2 or 3 for the next game. .TP .BR s Start a new game. .TP .BR q Quit the program. .TP .BR h Print the high-scores. .TP .BR H \ or \ Control-H Use the grid of hexagons for the next game. .TP .BR S \ or \ Control-S Use the grid of squares for the next game. .TP .BR T \ or \ Control-T Use the grid of triangles for the next game. .TP .SH X RESOURCES The name of the class used is XBomb, the widget hierarchy used is (Widget-Class:name): XBomb Form:form Command:start MenuButton:menu SimpleMenu:levelmenushell smeBSBObject:Easy smeBSBObject:Medium smeBSBObject:Difficult MenuButton:menu SimpleMenu:typemenushell smeBSBObject:Hexagon smeBSBObject:Square smeBSBObject:Triangle Command:hiscore Command:quit Core:grid Command:clock Command:uxb .LP The extra resources that are available for the grid are: .TP .BR grid.bomb The colour of the bombs \- default black. .TP .BR grid.bombreal The colour of the real bombs \- default red. .TP .BR grid.bombmark The colour of the bombs that are marked by the user \- default orange. .TP .BR grid.number The colour of the number '1' when drawn in the grid \- default navy blue. .TP .BR grid.number2 The colour of the number '2' when drawn in the grid \- default dark green. .TP .BR grid.number3 The colour of the number '3' when drawn in the grid \- default dark red. The other numbers up to 12 also have their own resources. .TP .BR grid.hidden The colour of the hidden squares \- default grey50. .TP .BR grid.correct The colour of the squares that were correctly guessed \- default green .TP .BR grid.font The font that is used for the number in the grid \- default lucidasans-24 .SH BUGS None known. .SH AUTHOR Andrew M. Bishop. xbomb-2.2a/xbomb.ad 444 233 144 1672 11304433772 7422 0! XBomb app-defaults Version 2.2a. ! ! Copyright 1994-2009 Andrew M. Bishop ! ! The default font and the font for the markings on the grid. *font: lucidasans-bold-14 *grid.font: lucidasans-bold-24 ! The colour for the bomb and flag foreground. *grid.bomb: black ! The colour for the bomb background. *grid.bombreal: red ! The colour for the flag background. *grid.bombmark: orange ! The colour for the numbers in the grid. *grid.number: navyblue *grid.number2: darkgreen *grid.number3: darkred *grid.number4: black *grid.number5: turquoise *grid.number6: orange *grid.number7: violet *grid.number8: lightgreen *grid.number9: blue *grid.number10: blue *grid.number11: blue *grid.number12: blue ! The colour for the uncovered tiles. *grid.hidden: grey50 ! The colour for the correctly guessed squares at the end. *grid.correct: green ! The colours for the hi-score table. *hiscores*foreground: black *hiscores*background: white xbomb-2.2a/icon.h 444 233 144 6313 10324245174 7101 0#define icon_width 64 #define icon_height 64 static char icon_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x70, 0x0e, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x30, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x08, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x86, 0x31, 0x00, 0xe2, 0x01, 0x00, 0x00, 0x00, 0x81, 0x41, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x81, 0x41, 0x70, 0x10, 0x18, 0x00, 0x00, 0x00, 0x07, 0x70, 0x0c, 0x20, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x42, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x42, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x82, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};