xdemineur-2.1.1/ 40755 1750 1750 0 6754625505 12440 5ustar babafouskiffxdemineur-2.1.1/ANNOUNCE100644 1750 1750 2716 6754625206 13672 0ustar babafouskiffI'm pleased to announce the release of xdémineur 2.1.1, a minesweeper game for the X Window System. This release only includes appicon support for the Window Maker window manager . You can get xdémineur source code from: (primary site) Precompiled packages (not necessarily up to date) are also available for various operating systems: * NetBSD maintained by Manuel Bouyer * FreeBSD maintained by * Linux Debian maintained by Mark Baker * Linux Red Hat Linux Suse maintained by * Tru64 UNIX maintained by * HP-UX maintained by You can also have some information about xdémineur by visiting: xdemineur-2.1.1/ChangeLog100644 1750 1750 2606 6754625207 14312 0ustar babafouskiff1999-08-12 Marc Baudoin * ANNOUNCE: Version 2.1.1 released. 1999-07-29 Marc Baudoin * xdemineur.c (xdemineur_initialize): now generates an appicon to be used by the Window Maker window manager. 1998-02-09 Marc Baudoin * ANNOUNCE: Version 2.1 released. * xdemineur.c: #include instead of . * main.c (main): SA_RESTART is used only if defined (it doesn't exist on SunOS). 1998-02-08 Marc Baudoin * xdemineur.c (xdemineur_event_loop): Don't change the face icon when button 2 is pressed over an already uncovered square or a square which don't have all its flags placed around yet. * main.c (main): Added -v option, which shows version number and copyright notice before exiting. 1998-02-07 Marc Baudoin * xdemineur.xbm: Some changes in the face icons and the window icon, from . * main.c: CVS is now used to manage the source tree. 1998-02-04 Marc Baudoin * xdemineur.c (xdemineur_event_loop): Stop the timer when the window is iconified or fully obscured and start it again when the window is deiconified or unobscured. 1998-01-29 Marc Baudoin * xdemineur.c: #include needed on Linux. It is needed by select(2) anyway. xdemineur-2.1.1/INSTALL100644 1750 1750 3657 6754074331 13574 0ustar babafouskiffINSTALL file for xdémineur ========================== Requirements ------------ To compile and install xdémineur, you need: * An ANSI C compiler such as the GNU C compiler, GCC. You can get an up to date list of the existing GNU archives at: * The X Window System (X11R4 or higher). * The XPM library by Arnaud Le Hors. You can get the latest version from the following locations: Compilation and installation ---------------------------- You should normally not need to edit the Imakefile but feel free to have a look at it (there's not much to see anyway). Then do the usual: xmkmf to generate a Makefile from the Imakefile. Then: make to compile xdémineur. It should compile OK on most systems. Anyway, if you have any difficulties, please send me a report (my e-mail adress is ) stating your environment (operating system type and version, compiler, X version and every information you find relevant) and a copy of the errror messages from the compiler. If the compilation was successful, you can try xdémineur by typing: ./xdemineur If you're happy with it, you can install the binary: make install and the manual page: make install.man These two commands should be run as root on most systems. Copyright --------- Copyright © 1993-1999 Marc Baudoin Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The author makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. -- Marc Baudoin xdemineur-2.1.1/Imakefile100644 1750 1750 1444 6750143311 14333 0ustar babafouskiffXCOMM Copyright © 1993-1999 Marc Baudoin XCOMM XCOMM Permission to use, copy, modify, and distribute this software and XCOMM its documentation for any purpose and without fee is hereby XCOMM granted, provided that the above copyright notice appear in all XCOMM copies and that both that copyright notice and this permission XCOMM notice appear in supporting documentation. The author makes no XCOMM representations about the suitability of this software for any XCOMM purpose. It is provided "as is" without express or implied XCOMM warranty. XCOMM DEFINES = -Wall LOCAL_LIBRARIES = -lXpm $(XLIB) DEPLIBS = $(DEPXLIB) SRCS = demineur.c main.c util.c xdemineur.c OBJS = demineur.o main.o util.o xdemineur.o ComplexProgramTarget(xdemineur) xdemineur-2.1.1/README100644 1750 1750 5142 6754074433 13415 0ustar babafouskiffREADME file for xdémineur ========================= Xdémineur is a minesweeper game for the X Window System. The object of this game is to find the location of the mines hidden in the minefield and to mark their location by placing a warning flag. You have exactly as many flags as there are mines. The number of flags that remain to be placed is displayed in the top left corner of the window and a timer is displayed in the top right corner. The game is played using a three buttons mouse, as usual with the X Window System. The left button (button 1) is used to uncover the square on which you click (hoping that a mine is not hidden there). The number displayed in an uncovered square indicates how many mines are located around this square (for example, a 3 means that there are three mines within the 8 surrounding squares). The whole game relies on the right use of these numbers. The right button (button 3) is used to place a flag on a square (this indicates that there is a mine here). If you click again with the right button on a square that has a flag, the flag is changed into a question mark: this is useful if you are trying to guess the possible location of some mine, you can use question marks to think about it. One more click with the right button and the question mark disappears. Clicking with the middle button (button 2) on an uncovered square which has all its flags placed around uncovers the surrounding cells which have no flags (this will save a lot of time). Finally, to start a new game, just click on the yellow face above the minefield. FTP sites --------- You can get the latest version of xdémineur by anonymous FTP from: (primary site) Installation ------------ See the INSTALL file. Bugs ---- Please report any bug you could find in xdémineur to . Also, you should tell me the customizations you may have done, such as adding new functions to the game or making modifications to allow the game to run on your system. Copyright --------- Copyright © 1993-1999 Marc Baudoin Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The author makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. -- Marc Baudoin xdemineur-2.1.1/demineur.c100644 1750 1750 26507 6750143312 14526 0ustar babafouskiff/* * Copyright © 1993-1999 Marc Baudoin * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation. The author makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied * warranty. * */ static char *const cvsid = "$Id: demineur.c,v 1.2.2.1 1999/07/29 21:25:30 babafou Exp $" ; #include #include #include #include #include #include "demineur.h" #include "util.h" #include "xdemineur.h" /* ------------------------------------------------------------------------- */ typedef struct row_column { int row ; int column ; struct row_column *next ; } row_column_t ; /* ------------------------------------------------------------------------- */ int demineur_flag_count ( int row , int column ) ; void demineur_won ( ) ; /* ------------------------------------------------------------------------- */ board_t board ; int mines ; volatile time_t elapsed ; state_t state ; /* ------------------------------------------------------------------------- */ void demineur_initialize ( int option_mines ) { int row , column , m , openings ; row_column_t *rc = NULL , *ptr = NULL ; /* There are two extra rows and two extra columns so that * there's no need to handle side effects when counting the * number of surrounding mines. */ board.board = ( square_t ** ) xmalloc ( ( board.rows + 2 ) * sizeof ( square_t * ) ) ; for ( row = 0 ; row < board.rows + 2 ; row ++ ) { board.board[row] = ( square_t * ) xmalloc ( ( board.columns + 2 ) * sizeof ( square_t ) ) ; } if ( option_mines != 0 ) { if ( option_mines >= board.rows * board.columns ) { printf ( "Too many mines, using default number.\n" ) ; mines = board.mines = board.rows * board.columns / 4.8 ; } else { mines = board.mines = option_mines ; } } else { mines = board.mines = board.rows * board.columns / 4.8 ; } elapsed = 0 ; state = PLAYING ; /* initialize board */ for ( row = 0 ; row < board.rows + 2 ; row ++ ) { for ( column = 0 ; column < board.columns + 2 ; column ++ ) { board.board[row][column].mine = 0 ; board.board[row][column].around = 0 ; board.board[row][column].state = HIDDEN ; } } /* special treatment for extra squares */ for ( row = 0 ; row < board.rows + 2 ; row ++ ) { board.board[row][0].state = UNCOVERED ; board.board[row][board.columns + 1].state = UNCOVERED ; } for ( column = 0 ; column < board.columns + 2 ; column ++ ) { board.board[0][column].state = UNCOVERED ; board.board[board.rows + 1][column].state = UNCOVERED ; } /* mines deposit */ for ( row = 1 ; row <= board.rows ; row ++ ) { for ( column = 1 ; column <= board.columns ; column ++ ) { if ( rc == NULL ) /* first square */ { rc = ( row_column_t * ) xmalloc ( sizeof ( row_column_t ) ) ; ptr = rc ; } else { ptr->next = ( row_column_t * ) xmalloc ( sizeof ( row_column_t ) ) ; ptr = ptr->next ; } ptr->row = row ; ptr->column = column ; ptr->next = NULL ; } } for ( m = 0 ; m < board.mines ; m ++ ) { int alea = rand ( ) % ( board.rows * board.columns - m ) ; if ( alea == 0 ) { ptr = rc ; rc = rc->next ; } else { row_column_t *tmp ; for ( ptr = rc ; alea > 1 ; alea -- , ptr = ptr->next ) { continue ; } tmp = ptr->next ; ptr->next = ptr->next->next ; ptr = tmp ; } board.board[ptr->row][ptr->column].mine = 1 ; free ( ptr ) ; } /* free memory used by squares without mine */ for ( ptr = rc ; ptr != NULL ; ) { row_column_t *tmp = ptr->next ; free ( ptr ) ; ptr = tmp ; } rc = NULL ; /* mines counting */ for ( row = 1 ; row <= board.rows ; row ++ ) { for ( column = 1 ; column <= board.columns ; column ++ ) { board.board[row][column].around = board.board[row - 1][column - 1].mine + board.board[row - 1][column ].mine + board.board[row - 1][column + 1].mine + board.board[row ][column - 1].mine + board.board[row ][column + 1].mine + board.board[row + 1][column - 1].mine + board.board[row + 1][column ].mine + board.board[row + 1][column + 1].mine ; } } /* automatic opening */ openings = 0 ; for ( row = 1 ; row <= board.rows ; row ++ ) { for ( column = 1 ; column <= board.columns ; column ++ ) { if ( board.board[row][column].around == 0 && ! board.board[row][column].mine ) { openings ++ ; if ( rc == NULL ) /* first square */ { rc = ( row_column_t * ) xmalloc ( sizeof ( row_column_t ) ) ; ptr = rc ; } else { ptr->next = ( row_column_t * ) xmalloc ( sizeof ( row_column_t ) ) ; ptr = ptr->next ; } ptr->row = row ; ptr->column = column ; ptr->next = NULL ; } } } if ( openings != 0 ) { int alea = rand ( ) % openings , i ; for ( i = 0 , ptr = rc ; i < alea ; i ++ , ptr = ptr->next ) { continue ; } demineur_play ( ptr->row , ptr->column ) ; } for ( ptr = rc ; ptr != NULL ; ) { row_column_t *tmp = ptr->next ; free ( ptr ) ; ptr = tmp ; } } /* ------------------------------------------------------------------------- */ void demineur_start_timer ( ) { struct itimerval itimerval ; itimerval.it_interval.tv_sec = 1 ; itimerval.it_interval.tv_usec = 0 ; itimerval.it_value.tv_sec = 1 ; itimerval.it_value.tv_usec = 0 ; if ( setitimer ( ITIMER_REAL , &itimerval , NULL ) == -1 ) { perror ( "setitimer" ) ; exit ( EX_OSERR ) ; } } /* ------------------------------------------------------------------------- */ void demineur_stop_timer ( ) { struct itimerval itimerval ; timerclear ( &itimerval.it_interval ) ; timerclear ( &itimerval.it_value ) ; if ( setitimer ( ITIMER_REAL , &itimerval , NULL ) == -1 ) { perror ( "setitimer" ) ; exit ( EX_OSERR ) ; } } /* ------------------------------------------------------------------------- */ void demineur_play ( int row , int column ) { if ( row < 1 || row > board.rows || column < 1 || column > board.columns ) { return ; } if ( board.board[row][column].state == HIDDEN ) { board.board[row][column].state = UNCOVERED ; xdemineur_square ( row , column ) ; if ( board.board[row][column].mine ) { state = LOST ; demineur_stop_timer ( ) ; xdemineur_display ( ) ; } else if ( board.board[row][column].around == 0 ) { demineur_clear ( row , column ) ; } } if ( mines == 0 ) { demineur_won ( ) ; } } /* ------------------------------------------------------------------------- */ int demineur_hidden ( int row , int column ) { return demineur_hidden_count ( row - 1 , column - 1 ) + demineur_hidden_count ( row - 1 , column ) + demineur_hidden_count ( row - 1 , column + 1 ) + demineur_hidden_count ( row , column - 1 ) + demineur_hidden_count ( row , column + 1 ) + demineur_hidden_count ( row + 1 , column - 1 ) + demineur_hidden_count ( row + 1 , column ) + demineur_hidden_count ( row + 1 , column + 1 ) ; } /* ------------------------------------------------------------------------- */ int demineur_hidden_count ( int row , int column ) { return ( board.board[row][column].state == HIDDEN ) ? 1 : 0 ; } /* ------------------------------------------------------------------------- */ int demineur_flags ( int row , int column ) { return demineur_flag_count ( row - 1 , column - 1 ) + demineur_flag_count ( row - 1 , column ) + demineur_flag_count ( row - 1 , column + 1 ) + demineur_flag_count ( row , column - 1 ) + demineur_flag_count ( row , column + 1 ) + demineur_flag_count ( row + 1 , column - 1 ) + demineur_flag_count ( row + 1 , column ) + demineur_flag_count ( row + 1 , column + 1 ) ; } /* ------------------------------------------------------------------------- */ int demineur_flag_count ( int row , int column ) { return ( board.board[row][column].state == FLAGGED ) ? 1 : 0 ; } /* ------------------------------------------------------------------------- */ void demineur_clear ( int row , int column ) { demineur_play ( row - 1 , column - 1 ) ; demineur_play ( row - 1 , column ) ; demineur_play ( row - 1 , column + 1 ) ; demineur_play ( row , column - 1 ) ; demineur_play ( row , column + 1 ) ; demineur_play ( row + 1 , column - 1 ) ; demineur_play ( row + 1 , column ) ; demineur_play ( row + 1 , column + 1 ) ; } /* ------------------------------------------------------------------------- */ void demineur_flag_question ( int row , int column ) { switch ( board.board[row][column].state ) { case HIDDEN : if ( mines > 0 ) { board.board[row][column].state = FLAGGED ; mines -- ; if ( mines == 0 ) { demineur_won ( ) ; } } break ; case FLAGGED : board.board[row][column].state = QUESTION ; mines ++ ; break ; case QUESTION : board.board[row][column].state = HIDDEN ; break ; case UNCOVERED : break ; } } /* ------------------------------------------------------------------------- */ void demineur_won ( ) { int row , column ; for ( row = 1 ; row <= board.rows ; row ++ ) { for ( column = 1 ; column <= board.columns ; column ++ ) { if ( board.board[row][column].state == HIDDEN || board.board[row][column].state == QUESTION ) { return ; } } } /* if you get there, it's that you've won */ state = WON ; demineur_stop_timer ( ) ; xdemineur_face ( ) ; } /* ------------------------------------------------------------------------- */ void demineur_end ( ) { int row ; for ( row = 0 ; row < board.rows + 2 ; row ++ ) { free ( board.board[row] ) ; } free ( board.board ) ; } xdemineur-2.1.1/demineur.h100644 1750 1750 3513 6750143313 14504 0ustar babafouskiff/* * Copyright © 1993-1999 Marc Baudoin * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation. The author makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied * warranty. * */ /* $Id: demineur.h,v 1.2.2.1 1999/07/29 21:25:31 babafou Exp $ */ #ifndef _DEMINEUR_H_ #define _DEMINEUR_H_ typedef struct { int mine ; /* 1 if there's a mine, 0 otherwise */ int around ; /* mine count around this square */ enum { HIDDEN , /* hidden square */ FLAGGED , /* flagged square */ QUESTION , /* question mark */ UNCOVERED /* uncovered square */ } state ; /* square state */ } square_t ; typedef struct { int rows ; /* number of rows */ int columns ; /* number of columns */ int mines ; /* number of mines */ square_t **board ; /* the game board */ } board_t ; typedef enum { PLAYING , WON , LOST } state_t ; /* ------------------------------------------------------------------------- */ void demineur_initialize ( int option_mines ) ; void demineur_start_timer ( ) ; void demineur_stop_timer ( ) ; void demineur_play ( int row , int column ) ; int demineur_hidden ( int row , int column ) ; int demineur_hidden_count ( int row , int column ) ; int demineur_flags ( int row , int column ) ; void demineur_clear ( int row , int column ) ; void demineur_flag_question ( int row , int column ) ; void demineur_end ( ) ; #endif /* _DEMINEUR_H_ */ xdemineur-2.1.1/main.c100644 1750 1750 7133 6751132312 13613 0ustar babafouskiff/* * Copyright © 1993-1999 Marc Baudoin * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation. The author makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied * warranty. * */ static char *const cvsid = "$Id: main.c,v 1.3.2.2 1999/08/01 20:57:46 babafou Exp $" ; #include #include #include #include #include #include #include "demineur.h" #include "xdemineur.h" /* ------------------------------------------------------------------------- */ void sigalrm ( int sig ) ; /* ------------------------------------------------------------------------- */ extern volatile time_t elapsed ; extern state_t state ; /* ------------------------------------------------------------------------- */ int main ( int argc , char **argv ) { int i , option_mines = 0 ; char *display_name = NULL , *geometry = NULL ; struct sigaction act ; /* command line arguments */ for ( i = 1 ; i < argc ; i ++ ) { if ( strcmp ( argv[i] , "-v" ) == 0 ) { unsigned char *message = "\ xdémineur 2.1.1\n\ \n\ Copyright © 1993-1999 Marc Baudoin \n\ \n\ Permission to use, copy, modify, and distribute this software and\n\ its documentation for any purpose and without fee is hereby\n\ granted, provided that the above copyright notice appear in all\n\ copies and that both that copyright notice and this permission\n\ notice appear in supporting documentation. The author makes no\n\ representations about the suitability of this software for any\n\ purpose. It is provided \"as is\" without express or implied\n\ warranty.\n" ; printf ( "%s" , message ) ; exit ( EX_OK ) ; } else if ( strcmp ( argv[i] , "-display" ) == 0 ) { i ++ ; if ( i < argc ) { display_name = argv[i] ; continue ; } i -- ; } else if ( strcmp ( argv[i] , "-geometry" ) == 0 ) { i ++ ; if ( i < argc ) { geometry = argv[i] ; continue ; } i -- ; } else if ( strcmp ( argv[i] , "-m" ) == 0 ) { i ++ ; if ( i < argc ) { option_mines = atoi ( argv[i] ) ; continue ; } i -- ; } fprintf ( stderr , "bad command line option \"%s\"\n" , argv[i] ) ; fprintf ( stderr , "usage: %s [-v] [-display displayname] [-geometry geom] [-m mines]\n" , argv[0] ) ; exit ( EX_USAGE ) ; } /* initialization */ xdemineur_initialize ( argc , argv , display_name , geometry ) ; srand ( time ( NULL ) ) ; demineur_initialize ( option_mines ) ; act.sa_handler = sigalrm ; sigemptyset ( &act.sa_mask ) ; #ifdef SA_RESTART act.sa_flags = SA_RESTART ; #else act.sa_flags = 0 ; #endif if ( sigaction ( SIGALRM , &act , NULL ) == -1 ) { perror ( "sigaction" ) ; exit ( EX_OSERR ) ; } /* event loop */ xdemineur_event_loop ( ) ; /* the end */ demineur_end ( ) ; exit ( EX_OK ) ; } /* ------------------------------------------------------------------------- */ void sigalrm ( int sig ) { elapsed ++ ; } xdemineur-2.1.1/util.c100644 1750 1750 1775 6750143314 13655 0ustar babafouskiff/* * Copyright © 1993-1999 Marc Baudoin * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation. The author makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied * warranty. * */ static char *const cvsid = "$Id: util.c,v 1.1.1.1.2.1 1999/07/29 21:25:32 babafou Exp $" ; #include #include #include #include /* ------------------------------------------------------------------------- */ void *xmalloc ( size_t size ) { void *ptr ; ptr = malloc ( size ) ; if ( ptr == NULL ) { fprintf ( stderr , "Can't allocate memory.\n" ) ; exit ( EX_SOFTWARE ) ; } return ptr ; } xdemineur-2.1.1/util.h100644 1750 1750 1334 6750143315 13652 0ustar babafouskiff/* * Copyright © 1993-1999 Marc Baudoin * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation. The author makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied * warranty. * */ /* $Id: util.h,v 1.1.1.1.2.1 1999/07/29 21:25:33 babafou Exp $ */ #ifndef _UTIL_H_ #define _UTIL_H_ #include void *xmalloc ( size_t size ) ; #endif /* _UTIL_H_ */ xdemineur-2.1.1/xdemineur.c100644 1750 1750 70345 6750143315 14720 0ustar babafouskiff/* * Copyright © 1993-1999 Marc Baudoin * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation. The author makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied * warranty. * */ static char *const cvsid = "$Id: xdemineur.c,v 1.3.2.2 1999/07/29 21:25:33 babafou Exp $" ; #include #include #include #include #include #include #include #include #include #include #include #include "demineur.h" #include "xdemineur.h" #include "xdemineur.xbm" #include "pixmaps/face_normal.xpm" #include "pixmaps/face_click.xpm" #include "pixmaps/face_play.xpm" #include "pixmaps/face_happy.xpm" #include "pixmaps/face_sad.xpm" #include "pixmaps/digit_0.xpm" #include "pixmaps/digit_1.xpm" #include "pixmaps/digit_2.xpm" #include "pixmaps/digit_3.xpm" #include "pixmaps/digit_4.xpm" #include "pixmaps/digit_5.xpm" #include "pixmaps/digit_6.xpm" #include "pixmaps/digit_7.xpm" #include "pixmaps/digit_8.xpm" #include "pixmaps/digit_9.xpm" #include "pixmaps/square_0.xpm" #include "pixmaps/square_1.xpm" #include "pixmaps/square_2.xpm" #include "pixmaps/square_3.xpm" #include "pixmaps/square_4.xpm" #include "pixmaps/square_5.xpm" #include "pixmaps/square_6.xpm" #include "pixmaps/square_7.xpm" #include "pixmaps/square_8.xpm" #include "pixmaps/relief.xpm" #include "pixmaps/flag.xpm" #include "pixmaps/question.xpm" #include "pixmaps/mine.xpm" #include "pixmaps/mine_lost.xpm" #include "pixmaps/mine_false.xpm" /* ------------------------------------------------------------------------- */ typedef enum { ITEM_NOTHING , ITEM_SQUARE , ITEM_FACE } item_t ; typedef struct { int row , column ; enum { STATE_NONE , STATE_UNCOVER , STATE_CLEAR , STATE_FLAG_QUESTION , STATE_FACE } state ; } previous_t ; typedef enum { RAISED , SUNKEN } relief_t ; typedef enum { INSIDE , OUTSIDE } inout_t ; /* ------------------------------------------------------------------------- */ void xdemineur_colors ( ) ; void xdemineur_pixmaps ( ) ; void xdemineur_xpm ( char **data , Pixmap *pixmap_return ) ; item_t mouse ( int x , int y , int *row , int *column ) ; void xdemineur_frames ( ) ; void xdemineur_frame ( int x1 , int y1 , int x2 , int y2 , int width , relief_t relief , inout_t inoutside ) ; void xdemineur_face_click ( ) ; void xdemineur_face_play ( ) ; void xdemineur_face_display ( Pixmap face ) ; void xdemineur_mines ( ) ; void xdemineur_digits ( int number , int digits , int x , int y ) ; void xdemineur_grid ( ) ; void xdemineur_square_play ( int row , int column ) ; void xdemineur_squares_clear ( int row , int column ) ; void xdemineur_squares ( int row , int column ) ; void xdemineur_end ( ) ; /* ------------------------------------------------------------------------- */ extern board_t board ; extern int mines ; extern volatile time_t elapsed ; extern state_t state ; static Display *display ; static int screen ; static Window window ; static Pixmap icon_bitmap ; static Atom protocol[1] ; static GC gc ; static unsigned long black , white , gray , light_gray ; static Pixmap face_normal , face_click , face_play , face_happy , face_sad , digit[10] , square[9] , relief , flag , question , mine , mine_lost , mine_false ; /* ------------------------------------------------------------------------- */ void xdemineur_initialize ( int argc , char **argv , char *display_name , char *geometry ) { XSizeHints size_hints ; int x_pos = 0 , y_pos = 0 , width = MIN_WIDTH , height = MIN_HEIGHT ; char *window_title = "xdémineur" , *icon_title = "xdémineur" ; XTextProperty window_name , icon_name ; XWMHints wm_hints ; XClassHint class_hints ; XGCValues values ; display = XOpenDisplay ( display_name ) ; if ( display == NULL ) { fprintf ( stderr , "Error: Can't open display: %s\n" , XDisplayName ( display_name ) ) ; exit ( EX_OSERR ) ; } screen = DefaultScreen ( display ) ; board.columns = COLUMNS_MIN ; board.rows = ROWS_MIN ; size_hints.flags = 0 ; if ( geometry != NULL ) { int flags , x , y ; unsigned int w , h ; flags = XParseGeometry ( geometry , &x , &y , &w , &h ) ; if ( WidthValue & flags ) { if ( w < COLUMNS_MIN ) { board.columns = COLUMNS_MIN ; fprintf ( stderr , "%d columns is too small! Using %d columns instead.\n" , w , COLUMNS_MIN ) ; } else { board.columns = w ; width = BASE_WIDTH + board.columns * WIDTH_INC ; } } if ( HeightValue & flags ) { if ( h < ROWS_MIN ) { board.rows = ROWS_MIN ; fprintf ( stderr , "%d rows is too small! Using %d rows instead.\n" , h , ROWS_MIN ) ; } else { board.rows = h ; height = BASE_HEIGHT + board.rows * HEIGHT_INC ; } } if ( XValue & flags ) { size_hints.flags = USPosition ; if ( XNegative & flags ) { x_pos = DisplayWidth ( display , screen ) - width + x ; } else { x_pos = x ; } } if ( YValue & flags ) { size_hints.flags = USPosition ; if ( YNegative & flags ) { y_pos = DisplayHeight ( display , screen ) - height + y ; } else { y_pos = y ; } } } window = XCreateSimpleWindow ( display , RootWindow ( display , screen ) , x_pos , y_pos , width , height , 1 , BlackPixel ( display , screen ) , WhitePixel ( display , screen ) ) ; XStringListToTextProperty ( &window_title , 1 , &window_name ) ; XStringListToTextProperty ( &icon_title , 1 , &icon_name ) ; size_hints.flags |= USSize | PMinSize | PMaxSize | PResizeInc | PBaseSize ; size_hints.min_width = size_hints.max_width = width ; size_hints.min_height = size_hints.max_height = height ; size_hints.width_inc = WIDTH_INC ; size_hints.height_inc = HEIGHT_INC ; size_hints.base_width = BASE_WIDTH ; size_hints.base_height = BASE_HEIGHT ; icon_bitmap = XCreateBitmapFromData ( display , RootWindow ( display , screen ) , xdemineur_bits , xdemineur_width , xdemineur_height ) ; wm_hints.flags = InputHint | StateHint | IconPixmapHint | WindowGroupHint; wm_hints.input = True ; wm_hints.initial_state = NormalState ; wm_hints.icon_pixmap = icon_bitmap ; wm_hints.window_group = window ; class_hints.res_name = argv[0] ; class_hints.res_class = "XDémineur" ; XSetWMProperties ( display , window , &window_name , &icon_name , argv , argc , &size_hints , &wm_hints , &class_hints ) ; XSetCommand ( display , window , argv , argc ) ; protocol[0] = XInternAtom ( display , "WM_DELETE_WINDOW" , False ) ; XSetWMProtocols ( display , window , protocol , 1 ) ; values.foreground = BlackPixel ( display , screen ) ; values.background = WhitePixel ( display , screen ) ; values.graphics_exposures = False ; gc = XCreateGC ( display , window , GCForeground | GCBackground | GCGraphicsExposures , &values ) ; XSelectInput ( display , window , KeyPressMask | ButtonPressMask | ButtonReleaseMask | ExposureMask | VisibilityChangeMask | StructureNotifyMask ) ; xdemineur_colors ( ) ; xdemineur_pixmaps ( ) ; XMapWindow ( display , window ) ; } /* ------------------------------------------------------------------------- */ void xdemineur_colors ( ) { Colormap default_colormap ; XColor color ; default_colormap = DefaultColormap ( display , screen ) ; XParseColor ( display , default_colormap , "black" , &color ) ; XAllocColor ( display , default_colormap , &color ) ; black = color.pixel ; XParseColor ( display , default_colormap , "white" , &color ) ; XAllocColor ( display , default_colormap , &color ) ; white = color.pixel ; XParseColor ( display , default_colormap , "gray50" , &color ) ; XAllocColor ( display , default_colormap , &color ) ; gray = color.pixel ; XParseColor ( display , default_colormap , "gray70" , &color ) ; XAllocColor ( display , default_colormap , &color ) ; light_gray = color.pixel ; XSetWindowBackground ( display , window , light_gray ) ; } /* ------------------------------------------------------------------------- */ void xdemineur_pixmaps ( ) { xdemineur_xpm ( xpm_face_normal , &face_normal ) ; xdemineur_xpm ( xpm_face_click , &face_click ) ; xdemineur_xpm ( xpm_face_play , &face_play ) ; xdemineur_xpm ( xpm_face_happy , &face_happy ) ; xdemineur_xpm ( xpm_face_sad , &face_sad ) ; xdemineur_xpm ( xpm_digit_0 , &digit[0] ) ; xdemineur_xpm ( xpm_digit_1 , &digit[1] ) ; xdemineur_xpm ( xpm_digit_2 , &digit[2] ) ; xdemineur_xpm ( xpm_digit_3 , &digit[3] ) ; xdemineur_xpm ( xpm_digit_4 , &digit[4] ) ; xdemineur_xpm ( xpm_digit_5 , &digit[5] ) ; xdemineur_xpm ( xpm_digit_6 , &digit[6] ) ; xdemineur_xpm ( xpm_digit_7 , &digit[7] ) ; xdemineur_xpm ( xpm_digit_8 , &digit[8] ) ; xdemineur_xpm ( xpm_digit_9 , &digit[9] ) ; xdemineur_xpm ( xpm_square_0 , &square[0] ) ; xdemineur_xpm ( xpm_square_1 , &square[1] ) ; xdemineur_xpm ( xpm_square_2 , &square[2] ) ; xdemineur_xpm ( xpm_square_3 , &square[3] ) ; xdemineur_xpm ( xpm_square_4 , &square[4] ) ; xdemineur_xpm ( xpm_square_5 , &square[5] ) ; xdemineur_xpm ( xpm_square_6 , &square[6] ) ; xdemineur_xpm ( xpm_square_7 , &square[7] ) ; xdemineur_xpm ( xpm_square_8 , &square[8] ) ; xdemineur_xpm ( xpm_relief , &relief ) ; xdemineur_xpm ( xpm_flag , &flag ) ; xdemineur_xpm ( xpm_question , &question ) ; xdemineur_xpm ( xpm_mine , &mine ) ; xdemineur_xpm ( xpm_mine_lost , &mine_lost ) ; xdemineur_xpm ( xpm_mine_false , &mine_false ) ; } /* ------------------------------------------------------------------------- */ void xdemineur_xpm ( char **data , Pixmap *pixmap_return ) { int xpm_status ; xpm_status = XpmCreatePixmapFromData ( display , window , data , pixmap_return , NULL , NULL ) ; if ( xpm_status != XpmSuccess ) { fprintf ( stderr , "XpmError: %s\n" , XpmGetErrorString ( xpm_status ) ) ; exit ( EX_OSERR ) ; } } /* ------------------------------------------------------------------------- */ void xdemineur_event_loop ( ) { fd_set readfds ; XEvent event ; Region region ; XRectangle rectangle ; item_t item ; previous_t previous ; FD_ZERO ( &readfds ) ; region = XCreateRegion ( ) ; for ( ; ; ) { int row , column ; if ( XPending ( display ) == 0 ) /* no more events to handle */ { FD_SET ( ConnectionNumber ( display ) , &readfds ) ; if ( select ( ConnectionNumber ( display ) + 1 , &readfds , NULL , NULL , NULL ) == -1 ) /* wait for events or signal */ { if ( errno == EINTR ) /* interrupted by signal */ { xdemineur_timer ( ) ; XFlush ( display ) ; continue ; } } /* an event occurred, proceed to XNextEvent() */ } XNextEvent ( display , &event ) ; switch ( event.type ) { case KeyPress : switch ( XLookupKeysym ( &event.xkey , event.xkey.state ) ) { case XK_Escape : case XK_Q : case XK_q : XDestroyRegion ( region ) ; xdemineur_end ( ) ; return ; } break ; case ButtonPress : switch ( mouse ( event.xbutton.x , event.xbutton.y , &row , &column ) ) { case ITEM_SQUARE : if ( state != PLAYING ) { previous.state = STATE_NONE ; break ; } switch ( event.xbutton.button ) { case Button1 : /* uncover square */ if ( board.board[row][column].state == HIDDEN ) { xdemineur_face_play ( ) ; xdemineur_square_play ( row , column ) ; previous.row = row ; previous.column = column ; previous.state = STATE_UNCOVER ; } else { previous.state = STATE_NONE ; } break ; case Button2 : /* uncover squares around */ if ( board.board[row][column].state == UNCOVERED ) { if ( demineur_hidden ( row , column ) != 0 && board.board[row][column].around == demineur_flags ( row , column ) ) { xdemineur_face_play ( ) ; xdemineur_squares_clear ( row , column ) ; previous.row = row ; previous.column = column ; previous.state = STATE_CLEAR ; } else { previous.state = STATE_NONE ; } } break ; case Button3 : /* put flag or question mark */ if ( board.board[row][column].state == UNCOVERED ) { previous.state = STATE_NONE; break ; } xdemineur_face_play ( ) ; demineur_flag_question ( row , column ) ; xdemineur_mines ( ) ; xdemineur_square ( row , column ) ; previous.state = STATE_FLAG_QUESTION ; break ; } break ; case ITEM_FACE : xdemineur_face_click ( ) ; previous.state = STATE_FACE ; break ; case ITEM_NOTHING : previous.state = STATE_NONE ; break ; } break ; case ButtonRelease : item = mouse ( event.xbutton.x , event.xbutton.y , &row , &column ) ; switch ( previous.state ) { case STATE_NONE : break ; case STATE_UNCOVER : if ( row == previous.row && column == previous.column ) { demineur_play ( row , column ) ; } else { xdemineur_square ( previous.row , previous.column ) ; } xdemineur_face ( ) ; break ; case STATE_CLEAR : if ( row == previous.row && column == previous.column ) { demineur_clear ( row , column ) ; } else { xdemineur_squares ( previous.row , previous.column ) ; } xdemineur_face ( ) ; break ; case STATE_FLAG_QUESTION : xdemineur_face ( ) ; break ; case STATE_FACE : if ( item == ITEM_FACE ) /* new game */ { demineur_end ( ) ; demineur_initialize ( 0 ) ; xdemineur_display ( ) ; demineur_start_timer ( ) ; } else { xdemineur_face ( ) ; } break ; } previous.state = STATE_NONE ; break ; case Expose : rectangle.x = ( short ) event.xexpose.x ; rectangle.y = ( short ) event.xexpose.y ; rectangle.width = ( unsigned short ) event.xexpose.width ; rectangle.height = ( unsigned short ) event.xexpose.height ; XUnionRectWithRegion ( &rectangle , region , region ) ; if ( event.xexpose.count == 0 ) { XSetRegion ( display , gc , region ) ; xdemineur_display ( ) ; XSetClipMask ( display , gc , None ) ; XDestroyRegion ( region ) ; region = XCreateRegion ( ) ; } break ; case VisibilityNotify : switch ( event.xvisibility.state ) { case VisibilityUnobscured : if ( state == PLAYING ) { demineur_start_timer ( ) ; } break ; case VisibilityPartiallyObscured : break ; case VisibilityFullyObscured : if ( state == PLAYING ) { demineur_stop_timer ( ) ; } break ; } break ; case UnmapNotify : /* the window has been iconified */ if ( state == PLAYING ) { demineur_stop_timer ( ) ; } break ; case MapNotify : /* the window has been deiconified */ if ( state == PLAYING ) { demineur_start_timer ( ) ; } break ; case ClientMessage : if ( event.xclient.data.l[0] == protocol[0] ) { XDestroyRegion ( region ) ; xdemineur_end ( ) ; return ; } break ; } } } /* ------------------------------------------------------------------------- */ item_t mouse ( int x , int y , int *row , int *column ) { int board_width = board.columns * WIDTH_INC , board_height = board.rows * HEIGHT_INC , x_face = ( BASE_WIDTH + board.columns * WIDTH_INC - FACE_WIDTH ) / 2 ; *row = *column = 0 ; if ( x > X_BOARD && x < X_BOARD + board_width && y > Y_BOARD && y < Y_BOARD + board_height ) { if ( ( x - X_BOARD ) % WIDTH_INC == 0 || ( y - Y_BOARD ) % HEIGHT_INC == 0 ) { return ITEM_NOTHING ; } else { *column = 1 + ( x - X_BOARD ) / WIDTH_INC ; *row = 1 + ( y - Y_BOARD ) / HEIGHT_INC ; return ITEM_SQUARE ; } } else if ( x >= x_face && x <= x_face + FACE_WIDTH && y >= Y_FACE && y <= Y_FACE + FACE_HEIGHT ) { return ITEM_FACE ; } else { return ITEM_NOTHING ; } } /* ------------------------------------------------------------------------- */ void xdemineur_display ( ) { int row , column ; xdemineur_frames ( ) ; xdemineur_face ( ) ; xdemineur_mines ( ) ; xdemineur_timer ( ) ; xdemineur_grid ( ) ; for ( row = 1 ; row <= board.rows ; row ++ ) { for ( column = 1 ; column <= board.columns ; column ++ ) { xdemineur_square ( row , column ) ; } } } /* ------------------------------------------------------------------------- */ void xdemineur_frames ( ) { int board_width = board.columns * WIDTH_INC ; int board_height = board.rows * HEIGHT_INC ; int window_width = BASE_WIDTH + board_width ; int window_height = BASE_HEIGHT + board_height ; xdemineur_frame ( 0 , 0 , window_width - 1 , window_height - 1 , RELIEF_WIDTH , RAISED , INSIDE) ; xdemineur_frame ( X_BOARD , Y_BOARD , X_BOARD + board_width , Y_BOARD + board_height , RELIEF_WIDTH , SUNKEN , OUTSIDE) ; xdemineur_frame ( EDGE , EDGE , window_width - 1 - EDGE , Y_BOARD - EDGE , RELIEF_WIDTH , SUNKEN , OUTSIDE ) ; } /* ------------------------------------------------------------------------- */ void xdemineur_frame ( int x1 , int y1 , int x2 , int y2 , int width , relief_t relief , inout_t inoutside ) { int coord ; if ( inoutside == OUTSIDE ) { x1 -= width ; x2 += width ; y1 -= width ; y2 += width ; } XSetForeground ( display , gc , ( relief == RAISED ) ? white : gray ) ; for ( coord = 0 ; coord < width ; coord ++ ) { XDrawLine ( display , window , gc , x1 , y1 + coord , x2 - coord , y1 + coord ) ; XDrawLine ( display , window , gc , x1 + coord , y1 , x1 + coord , y2 - coord ) ; } XSetForeground ( display , gc , ( relief == RAISED ) ? gray : white ) ; for ( coord = 0 ; coord < width ; coord ++ ) { XDrawLine ( display , window , gc , x1 + 1 + coord , y2 - coord , x2 , y2 - coord ) ; XDrawLine ( display , window , gc , x2 - coord , y1 + 1 + coord , x2 - coord , y2 ) ; } } /* ------------------------------------------------------------------------- */ void xdemineur_face ( ) { switch ( state ) { case PLAYING : xdemineur_face_display ( face_normal ) ; break ; case WON : xdemineur_face_display ( face_happy ) ; break ; case LOST : xdemineur_face_display ( face_sad ) ; break ; } } /* ------------------------------------------------------------------------- */ void xdemineur_face_click ( ) { xdemineur_face_display ( face_click ) ; } /* ------------------------------------------------------------------------- */ void xdemineur_face_play ( ) { xdemineur_face_display ( face_play ) ; } /* ------------------------------------------------------------------------- */ void xdemineur_face_display ( Pixmap face ) { XCopyArea ( display , face , window , gc , 0 , 0 , FACE_WIDTH , FACE_HEIGHT , ( BASE_WIDTH + board.columns * WIDTH_INC - FACE_WIDTH ) / 2 , Y_FACE ) ; } /* ------------------------------------------------------------------------- */ void xdemineur_mines ( ) { xdemineur_digits ( mines , 4 , X_DIGITS , Y_DIGITS ) ; } /* ------------------------------------------------------------------------- */ void xdemineur_timer ( ) { int x = BASE_WIDTH + board.columns * WIDTH_INC - X_DIGITS - 4 * DIGIT_WIDTH ; xdemineur_digits ( elapsed , 4 , x , Y_DIGITS ) ; } /* ------------------------------------------------------------------------- */ void xdemineur_digits ( int number , int digits , int x , int y ) { int i , remainder = number ; for ( i = digits - 1 ; i >= 0 ; i -- , remainder /= 10 ) { XCopyArea ( display , digit[remainder % 10] , window , gc , 0 , 0 , DIGIT_WIDTH , DIGIT_HEIGHT , x + i * DIGIT_WIDTH , y ) ; } xdemineur_frame ( x , y , x + digits * DIGIT_WIDTH - 1 , y + DIGIT_HEIGHT - 1 , 1 , SUNKEN , OUTSIDE ) ; } /* ------------------------------------------------------------------------- */ void xdemineur_grid ( ) { int coord , board_width = board.columns * WIDTH_INC + 1 , board_height = board.rows * HEIGHT_INC + 1 ; XSetForeground ( display , gc , black ) ; for ( coord = X_BOARD ; coord < X_BOARD + board_width ; coord += WIDTH_INC ) { XDrawLine ( display , window , gc , coord , Y_BOARD , coord , Y_BOARD + board_height - 1 ) ; } for ( coord = Y_BOARD ; coord < Y_BOARD + board_height ; coord += HEIGHT_INC ) { XDrawLine ( display , window , gc , X_BOARD , coord , X_BOARD + board_width - 1 , coord ) ; } } /* ------------------------------------------------------------------------- */ void xdemineur_square ( int row , int column ) { int x = X_BOARD + 1 + ( column - 1 ) * ( SQUARE_WIDTH + 1 ) , y = Y_BOARD + 1 + ( row - 1 ) * ( SQUARE_HEIGHT + 1 ) ; if ( row < 1 || row > board.rows || column < 1 || column > board.columns ) { return ; } switch ( board.board[row][column].state ) { case HIDDEN : if ( state == LOST && board.board[row][column].mine ) { XCopyArea ( display , mine , window , gc , 0 , 0 , SQUARE_WIDTH , SQUARE_HEIGHT , x , y ) ; } else { XCopyArea ( display , relief , window , gc , 0 , 0 , SQUARE_WIDTH , SQUARE_HEIGHT , x , y ) ; } break ; case FLAGGED : if ( state == LOST && ! board.board[row][column].mine ) { XCopyArea ( display , mine_false , window , gc , 0 , 0 , SQUARE_WIDTH , SQUARE_HEIGHT , x , y ) ; } else { XCopyArea ( display , flag , window , gc , 0 , 0 , SQUARE_WIDTH , SQUARE_HEIGHT , x , y ) ; } break ; case QUESTION : if ( state == LOST && board.board[row][column].mine ) { XCopyArea ( display , mine , window , gc , 0 , 0 , SQUARE_WIDTH , SQUARE_HEIGHT , x , y ) ; } else { XCopyArea ( display , question , window , gc , 0 , 0 , SQUARE_WIDTH , SQUARE_HEIGHT , x , y ) ; } break ; case UNCOVERED : if ( ! board.board[row][column].mine ) { XCopyArea ( display , square[board.board[row][column].around] , window , gc , 0 , 0 , SQUARE_WIDTH , SQUARE_HEIGHT , x , y ) ; } else { XCopyArea ( display , mine_lost , window , gc , 0 , 0 , SQUARE_WIDTH , SQUARE_HEIGHT , x , y ) ; } break ; } } /* ------------------------------------------------------------------------- */ void xdemineur_square_play ( int row , int column ) { int x = X_BOARD + 1 + ( column - 1 ) * ( SQUARE_WIDTH + 1 ) , y = Y_BOARD + 1 + ( row - 1 ) * ( SQUARE_HEIGHT + 1 ) ; if ( row < 1 || row > board.rows || column < 1 || column > board.columns ) { return ; } XCopyArea ( display , square[0] , window , gc , 0 , 0 , SQUARE_WIDTH , SQUARE_HEIGHT , x , y ) ; } /* ------------------------------------------------------------------------- */ void xdemineur_squares_clear ( int row , int column ) { int r , c ; for ( r = row - 1 ; r <= row + 1 ; r ++ ) { for ( c = column - 1 ; c <= column + 1 ; c ++ ) { if ( board.board[r][c].state == HIDDEN ) { xdemineur_square_play ( r , c ) ; } } } } /* ------------------------------------------------------------------------- */ void xdemineur_squares ( int row , int column ) { int r , c ; for ( r = row - 1 ; r <= row + 1 ; r ++ ) { for ( c = column - 1 ; c <= column + 1 ; c ++ ) { xdemineur_square ( r , c ) ; } } } /* ------------------------------------------------------------------------- */ void xdemineur_end ( ) { int i ; XFreePixmap ( display , face_normal ) ; XFreePixmap ( display , face_click ) ; XFreePixmap ( display , face_play ) ; XFreePixmap ( display , face_happy ) ; XFreePixmap ( display , face_sad ) ; for ( i = 0 ; i <= 9 ; i ++ ) { XFreePixmap ( display , digit[i] ) ; } for ( i = 0 ; i <= 8 ; i ++ ) { XFreePixmap ( display , square[i] ) ; } XFreePixmap ( display , relief ) ; XFreePixmap ( display , flag ) ; XFreePixmap ( display , question ) ; XFreePixmap ( display , mine ) ; XFreePixmap ( display , mine_lost ) ; XFreePixmap ( display , mine_false ) ; XFreeGC ( display , gc ) ; XFreePixmap ( display , icon_bitmap ) ; XDestroyWindow ( display , window ) ; XCloseDisplay ( display ) ; } xdemineur-2.1.1/xdemineur.h100644 1750 1750 3774 6750143316 14710 0ustar babafouskiff/* * Copyright © 1993-1999 Marc Baudoin * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permission * notice appear in supporting documentation. The author makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied * warranty. * */ /* $Id: xdemineur.h,v 1.1.1.1.2.1 1999/07/29 21:25:34 babafou Exp $ */ #ifndef _XDEMINEUR_H_ #define _XDEMINEUR_H_ #define ROWS_MIN 16 #define COLUMNS_MIN 30 #define EDGE 15 /* edge around the game board */ #define RELIEF_WIDTH 3 /* width of the relief */ #define INFO 50 #define SQUARE_WIDTH 20 /* width of a square */ #define SQUARE_HEIGHT 20 /* height of a square */ #define BASE_WIDTH ( EDGE + 1 + EDGE ) #define BASE_HEIGHT ( EDGE + INFO + EDGE + 1 + EDGE ) #define WIDTH_INC ( SQUARE_WIDTH + 1 ) #define HEIGHT_INC ( SQUARE_HEIGHT + 1 ) #define MIN_WIDTH ( BASE_WIDTH + COLUMNS_MIN * WIDTH_INC ) #define MIN_HEIGHT ( BASE_HEIGHT + ROWS_MIN * HEIGHT_INC ) #define X_BOARD EDGE #define Y_BOARD ( EDGE + INFO + EDGE ) #define FACE_WIDTH 40 #define FACE_HEIGHT 40 #define Y_FACE ( ( Y_BOARD - FACE_HEIGHT ) / 2 ) #define DIGIT_WIDTH 20 #define DIGIT_HEIGHT 30 #define X_DIGITS ( ( Y_BOARD - DIGIT_WIDTH ) / 2 ) #define Y_DIGITS ( ( Y_BOARD - DIGIT_HEIGHT ) / 2 ) /* ------------------------------------------------------------------------- */ void xdemineur_initialize ( int argc , char **argv , char *display_name , char *geometry ) ; void xdemineur_event_loop ( ) ; void xdemineur_display ( ) ; void xdemineur_face ( ) ; void xdemineur_timer ( ) ; void xdemineur_square ( int row , int column ) ; #endif /* _XDEMINEUR_H_ */ xdemineur-2.1.1/xdemineur.man100644 1750 1750 5761 6750143317 15233 0ustar babafouskiff.TH XDEMINEUR 6 .SH NAME xdemineur \- X11 minesweeper game .SH SYNOPSIS \fBxdemineur\fP [\fB\-v\fP] [\fB\-display\fP \fIdisplayname\fP] [\fB\-geometry\fP \fIgeom\fP] [\fB\-m\fP \fImines\fP] .SH DESCRIPTION \fIXdemineur\fP is a minesweeper game for the X Window System. .PP The object of this game is to find the location of the mines hidden in the minefield and to mark their location by placing a warning flag. You have exactly as many flags as there are mines. The number of flags that remain to be placed is displayed in the top left corner of the window and a timer is displayed in the top right corner. .PP The game is played using a three buttons mouse, as usual with the X Window System. The left button (button 1) is used to uncover the square on which you click (hoping that a mine is not hidden there). The number displayed in an uncovered square indicates how many mines are located around this square (for example, a 3 means that there are three mines within the 8 surrounding squares). The whole game relies on the right use of these numbers. The right button (button 3) is used to place a flag on a square (this indicates that there is a mine here). If you click again with the right button on a square that has a flag, the flag is changed into a question mark: this is useful if you are trying to guess the possible location of some mine, you can use question marks to think about it. One more click with the right button and the question mark disappears. Clicking with the middle button (button 2) on an uncovered square which has all its flags placed around uncovers the surrounding cells which have no flags (this will save a lot of time). .PP Finally, to start a new game, just click on the yellow face above the minefield. .SH OPTIONS .TP 8 .B \-v Print out version number and copyright notice then exit. .TP 8 .B \-display \fIdisplayname\fP This option specifies the name of the X server to use. See X(1). .TP 8 .B \-geometry \fIgeom\fP This option specifies the initial size and location of the window. See X(1). .TP 8 .B \-m \fImines \fP This option specifies the number of mines in the minefield. If there are more mines than squares in the minefield, the default mine number is used. .SH BUGS Please report any bug you could find in xdemineur to . Also, you should tell me the customizations you may have done, such as adding new functions to the game or making modifications to allow the game to run on your system. .SH COPYRIGHT Copyright (C) 1993-1999 Marc Baudoin .PP Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The author makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. .SH AUTHOR Marc Baudoin xdemineur-2.1.1/xdemineur.xbm100644 1750 1750 3552 6467111061 15236 0ustar babafouskiff#define xdemineur_width 48 #define xdemineur_height 48 static unsigned char xdemineur_bits[] = { 0xff, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0xfe, 0x1f, 0x00, 0x00, 0x00, 0xf0, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x78, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x3c, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x1e, 0xf0, 0xff, 0x00, 0x01, 0x00, 0x0f, 0xe0, 0xff, 0x81, 0x02, 0x00, 0x0f, 0xc0, 0xff, 0x83, 0x02, 0x80, 0x07, 0xc0, 0xff, 0x43, 0x04, 0xc0, 0x03, 0x80, 0xff, 0x47, 0x04, 0xe0, 0x01, 0x00, 0xc3, 0x4f, 0x04, 0x80, 0x00, 0x00, 0x1a, 0x23, 0x08, 0xb0, 0x00, 0x00, 0x6a, 0x18, 0x30, 0x2c, 0x00, 0x00, 0x90, 0x07, 0xc0, 0x13, 0x00, 0x00, 0x10, 0x50, 0x00, 0x10, 0x00, 0x00, 0xa0, 0xaa, 0x00, 0x0a, 0x00, 0x00, 0x20, 0x55, 0x00, 0x09, 0x00, 0x00, 0xa0, 0xaa, 0x80, 0x0a, 0x00, 0x00, 0x20, 0x55, 0x41, 0x09, 0x00, 0x00, 0x90, 0xaa, 0xa2, 0x10, 0x00, 0x00, 0x10, 0x55, 0x51, 0x10, 0x00, 0x00, 0x08, 0x2a, 0x28, 0x20, 0x00, 0x00, 0x07, 0x94, 0x53, 0xc0, 0x01, 0xc0, 0x00, 0x48, 0x24, 0x00, 0x06, 0x20, 0x00, 0x54, 0x15, 0x00, 0x08, 0xc0, 0x00, 0x48, 0x24, 0x00, 0x06, 0x00, 0x07, 0x94, 0x53, 0xc0, 0x01, 0x00, 0x08, 0x28, 0xa8, 0x20, 0x00, 0x00, 0x10, 0x14, 0x55, 0x11, 0x00, 0x00, 0x10, 0x8a, 0xaa, 0x12, 0x00, 0x00, 0x20, 0x05, 0x55, 0x09, 0x00, 0x00, 0xa0, 0x02, 0xaa, 0x0a, 0x00, 0x00, 0x20, 0x01, 0x55, 0x09, 0x00, 0x00, 0xa0, 0x00, 0xaa, 0x0a, 0x00, 0x00, 0x10, 0x00, 0x14, 0x10, 0x00, 0x00, 0x90, 0x07, 0xc0, 0x13, 0x00, 0x00, 0x68, 0x18, 0x30, 0x2c, 0x00, 0x00, 0x1a, 0x20, 0x88, 0xb1, 0x00, 0x00, 0x02, 0x40, 0xe4, 0x87, 0x01, 0x00, 0x0f, 0x40, 0xc4, 0xff, 0x03, 0x80, 0x07, 0x40, 0xc4, 0xff, 0x03, 0xc0, 0x03, 0x80, 0x82, 0xff, 0x07, 0xe0, 0x01, 0x80, 0x02, 0xff, 0x0f, 0xe0, 0x01, 0x00, 0x01, 0xfe, 0x1f, 0xf0, 0x00, 0x00, 0x00, 0xfe, 0x1f, 0x78, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0x3c, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x1e, 0x00, 0x00, 0x00, 0xf0, 0xff}; xdemineur-2.1.1/pixmaps/ 40755 1750 1750 0 6754625505 14121 5ustar babafouskiffxdemineur-2.1.1/pixmaps/background.xpm100644 1750 1750 1076 6467076550 17070 0ustar babafouskiff/* XPM */ static char *xpm_fond[] = { /* width height ncolors chars_per_pixel */ "16 16 2 1" , /* colors */ "* c gray70 m black" , ". c gray70 m white" , /* pixels */ "*.*.*.*.*.*.*.*." , ".*.*.*.*.*.*.*.*" , "*.*.*.*.*.*.*.*." , ".*.*.*.*.*.*.*.*" , "*.*.*.*.*.*.*.*." , ".*.*.*.*.*.*.*.*" , "*.*.*.*.*.*.*.*." , ".*.*.*.*.*.*.*.*" , "*.*.*.*.*.*.*.*." , ".*.*.*.*.*.*.*.*" , "*.*.*.*.*.*.*.*." , ".*.*.*.*.*.*.*.*" , "*.*.*.*.*.*.*.*." , ".*.*.*.*.*.*.*.*" , "*.*.*.*.*.*.*.*." , ".*.*.*.*.*.*.*.*" , } ; xdemineur-2.1.1/pixmaps/digit_0.xpm100644 1750 1750 1775 6467076547 16304 0ustar babafouskiff/* XPM */ static char *xpm_digit_0[] = { /* width height ncolors chars_per_pixel */ "20 30 2 1" , /* colors */ "- c red m white" , "# c black" , /* pixels */ "####################" , "####################" , "###--------------###" , "##-#------------#-##" , "##--#----------#--##" , "##---#--------#---##" , "##----########----##" , "##----########----##" , "##----########----##" , "##----########----##" , "##----########----##" , "##---##########---##" , "##--############--##" , "##-##############-##" , "####################" , "##-##############-##" , "##--############--##" , "##---##########---##" , "##----########----##" , "##----########----##" , "##----########----##" , "##----########----##" , "##----########----##" , "##----########----##" , "##---#--------#---##" , "##--#----------#--##" , "##-#------------#-##" , "###--------------###" , "####################" , "####################" , } ; xdemineur-2.1.1/pixmaps/digit_1.xpm100644 1750 1750 1775 6467076550 16277 0ustar babafouskiff/* XPM */ static char *xpm_digit_1[] = { /* width height ncolors chars_per_pixel */ "20 30 2 1" , /* colors */ "- c red m white" , "# c black" , /* pixels */ "####################" , "####################" , "####################" , "#################-##" , "################--##" , "###############---##" , "##############----##" , "##############----##" , "##############----##" , "##############----##" , "##############----##" , "###############---##" , "################--##" , "#################-##" , "####################" , "#################-##" , "################--##" , "###############---##" , "##############----##" , "##############----##" , "##############----##" , "##############----##" , "##############----##" , "##############----##" , "###############---##" , "################--##" , "#################-##" , "####################" , "####################" , "####################" , } ; xdemineur-2.1.1/pixmaps/digit_2.xpm100644 1750 1750 1775 6467076546 16305 0ustar babafouskiff/* XPM */ static char *xpm_digit_2[] = { /* width height ncolors chars_per_pixel */ "20 30 2 1" , /* colors */ "- c red m white" , "# c black" , /* pixels */ "####################" , "####################" , "###--------------###" , "####------------#-##" , "#####----------#--##" , "######--------#---##" , "##############----##" , "##############----##" , "##############----##" , "##############----##" , "##############----##" , "###############---##" , "#####----------#--##" , "####------------#-##" , "###--------------###" , "##-#------------####" , "##--#----------#####" , "##---###############" , "##----##############" , "##----##############" , "##----##############" , "##----##############" , "##----##############" , "##----##############" , "##---#--------######" , "##--#----------#####" , "##-#------------####" , "###--------------###" , "####################" , "####################" , } ; xdemineur-2.1.1/pixmaps/digit_3.xpm100644 1750 1750 1775 6467076546 16306 0ustar babafouskiff/* XPM */ static char *xpm_digit_3[] = { /* width height ncolors chars_per_pixel */ "20 30 2 1" , /* colors */ "- c red m white" , "# c black" , /* pixels */ "####################" , "####################" , "###--------------###" , "####------------#-##" , "#####----------#--##" , "######--------#---##" , "##############----##" , "##############----##" , "##############----##" , "##############----##" , "##############----##" , "###############---##" , "#####----------#--##" , "####------------#-##" , "###--------------###" , "####------------#-##" , "#####----------#--##" , "###############---##" , "##############----##" , "##############----##" , "##############----##" , "##############----##" , "##############----##" , "##############----##" , "######--------#---##" , "#####----------#--##" , "####------------#-##" , "###--------------###" , "####################" , "####################" , } ; xdemineur-2.1.1/pixmaps/digit_4.xpm100644 1750 1750 1775 6467076546 16307 0ustar babafouskiff/* XPM */ static char *xpm_digit_4[] = { /* width height ncolors chars_per_pixel */ "20 30 2 1" , /* colors */ "- c red m white" , "# c black" , /* pixels */ "####################" , "####################" , "####################" , "##-##############-##" , "##--############--##" , "##---##########---##" , "##----########----##" , "##----########----##" , "##----########----##" , "##----########----##" , "##----########----##" , "##---##########---##" , "##--#----------#--##" , "##-#------------#-##" , "###--------------###" , "####------------#-##" , "#####----------#--##" , "###############---##" , "##############----##" , "##############----##" , "##############----##" , "##############----##" , "##############----##" , "##############----##" , "###############---##" , "################--##" , "#################-##" , "####################" , "####################" , "####################" , } ; xdemineur-2.1.1/pixmaps/digit_5.xpm100644 1750 1750 1775 6467076546 16310 0ustar babafouskiff/* XPM */ static char *xpm_digit_5[] = { /* width height ncolors chars_per_pixel */ "20 30 2 1" , /* colors */ "- c red m white" , "# c black" , /* pixels */ "####################" , "####################" , "###--------------###" , "##-#------------####" , "##--#----------#####" , "##---#--------######" , "##----##############" , "##----##############" , "##----##############" , "##----##############" , "##----##############" , "##---###############" , "##--#----------#####" , "##-#------------####" , "###--------------###" , "####------------#-##" , "#####----------#--##" , "###############---##" , "##############----##" , "##############----##" , "##############----##" , "##############----##" , "##############----##" , "##############----##" , "######--------#---##" , "#####----------#--##" , "####------------#-##" , "###--------------###" , "####################" , "####################" , } ; xdemineur-2.1.1/pixmaps/digit_6.xpm100644 1750 1750 1775 6467076550 16304 0ustar babafouskiff/* XPM */ static char *xpm_digit_6[] = { /* width height ncolors chars_per_pixel */ "20 30 2 1" , /* colors */ "- c red m white" , "# c black" , /* pixels */ "####################" , "####################" , "###--------------###" , "##-#------------####" , "##--#----------#####" , "##---#--------######" , "##----##############" , "##----##############" , "##----##############" , "##----##############" , "##----##############" , "##---###############" , "##--#----------#####" , "##-#------------####" , "###--------------###" , "##-#------------#-##" , "##--#----------#--##" , "##---##########---##" , "##----########----##" , "##----########----##" , "##----########----##" , "##----########----##" , "##----########----##" , "##----########----##" , "##---#--------#---##" , "##--#----------#--##" , "##-#------------#-##" , "###--------------###" , "####################" , "####################" , } ; xdemineur-2.1.1/pixmaps/digit_7.xpm100644 1750 1750 1775 6467076546 16312 0ustar babafouskiff/* XPM */ static char *xpm_digit_7[] = { /* width height ncolors chars_per_pixel */ "20 30 2 1" , /* colors */ "- c red m white" , "# c black" , /* pixels */ "####################" , "####################" , "###--------------###" , "####------------#-##" , "#####----------#--##" , "######--------#---##" , "##############----##" , "##############----##" , "##############----##" , "##############----##" , "##############----##" , "###############---##" , "################--##" , "#################-##" , "####################" , "#################-##" , "################--##" , "###############---##" , "##############----##" , "##############----##" , "##############----##" , "##############----##" , "##############----##" , "##############----##" , "###############---##" , "################--##" , "#################-##" , "####################" , "####################" , "####################" , } ; xdemineur-2.1.1/pixmaps/digit_8.xpm100644 1750 1750 1775 6467076546 16313 0ustar babafouskiff/* XPM */ static char *xpm_digit_8[] = { /* width height ncolors chars_per_pixel */ "20 30 2 1" , /* colors */ "- c red m white" , "# c black" , /* pixels */ "####################" , "####################" , "###--------------###" , "##-#------------#-##" , "##--#----------#--##" , "##---#--------#---##" , "##----########----##" , "##----########----##" , "##----########----##" , "##----########----##" , "##----########----##" , "##---##########---##" , "##--#----------#--##" , "##-#------------#-##" , "###--------------###" , "##-#------------#-##" , "##--#----------#--##" , "##---##########---##" , "##----########----##" , "##----########----##" , "##----########----##" , "##----########----##" , "##----########----##" , "##----########----##" , "##---#--------#---##" , "##--#----------#--##" , "##-#------------#-##" , "###--------------###" , "####################" , "####################" , } ; xdemineur-2.1.1/pixmaps/digit_9.xpm100644 1750 1750 1775 6467076546 16314 0ustar babafouskiff/* XPM */ static char *xpm_digit_9[] = { /* width height ncolors chars_per_pixel */ "20 30 2 1" , /* colors */ "- c red m white" , "# c black" , /* pixels */ "####################" , "####################" , "###--------------###" , "##-#------------#-##" , "##--#----------#--##" , "##---#--------#---##" , "##----########----##" , "##----########----##" , "##----########----##" , "##----########----##" , "##----########----##" , "##---##########---##" , "##--#----------#--##" , "##-#------------#-##" , "###--------------###" , "####------------#-##" , "#####----------#--##" , "###############---##" , "##############----##" , "##############----##" , "##############----##" , "##############----##" , "##############----##" , "##############----##" , "######--------#---##" , "#####----------#--##" , "####------------#-##" , "###--------------###" , "####################" , "####################" , } ; xdemineur-2.1.1/pixmaps/face_click.xpm100644 1750 1750 4232 6467111074 17000 0ustar babafouskiff/* XPM */ static char *xpm_face_click[] = { /* width height ncolors chars_per_pixel */ "40 40 6 1" , /* colors */ " c white" , "# c black" , "X c gray50 m black" , "* c gray70 m black" , ". c gray70 m white" , "- c yellow m white" , /* pixels */ "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" , "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX " , "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX " , "XXX*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*. " , "XXX.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.* " , "XXX*.*.*.*.*.*.*########.*.*.*.*.*.*. " , "XXX.*.*.*.*.*###--------###.*.*.*.*.* " , "XXX*.*.*.*.##--------------##*.*.*.*. " , "XXX.*.*.*.#------------------#*.*.*.* " , "XXX*.*.*.#--------------------#*.*.*. " , "XXX.*.*.#----------------------#*.*.* " , "XXX*.*.#------------------------#*.*. " , "XXX.*.*#------------------------#.*.* " , "XXX*.*#-------##--------##-------#.*. " , "XXX.*.#------####------####------#*.* " , "XXX*.*#------####------####------#.*. " , "XXX.*#--------##--------##--------#.* " , "XXX*.#----------------------------#*. " , "XXX.*#----------------------------#.* " , "XXX*.#----------------------------#*. " , "XXX.*#----------------------------#.* " , "XXX*.#----------------------------#*. " , "XXX.*#----------------------------#.* " , "XXX*.#----------------------------#*. " , "XXX.*.#------#------------#------#*.* " , "XXX*.*#-------#----------#-------#.*. " , "XXX.*.#--------##------##--------#*.* " , "XXX*.*.#---------######---------#*.*. " , "XXX.*.*#------------------------#.*.* " , "XXX*.*.*#----------------------#.*.*. " , "XXX.*.*.*#--------------------#.*.*.* " , "XXX*.*.*.*#------------------#.*.*.*. " , "XXX.*.*.*.*##--------------##.*.*.*.* " , "XXX*.*.*.*.*.###--------###*.*.*.*.*. " , "XXX.*.*.*.*.*.*.########*.*.*.*.*.*.* " , "XXX*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*. " , "XXX.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.* " , "XXX " , "XX " , "X " , } ; xdemineur-2.1.1/pixmaps/face_happy.xpm100644 1750 1750 4232 6467111075 17035 0ustar babafouskiff/* XPM */ static char *xpm_face_happy[] = { /* width height ncolors chars_per_pixel */ "40 40 6 1" , /* colors */ " c white" , "# c black" , "X c gray50 m black" , "* c gray70 m black" , ". c gray70 m white" , "- c yellow m white" , /* pixels */ " " , " X" , " XX" , " *.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.XXX" , " .*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*XXX" , " *.*.*.*.*.*.*########.*.*.*.*.*.*.XXX" , " .*.*.*.*.*###--------###.*.*.*.*.*XXX" , " *.*.*.*.##--------------##*.*.*.*.XXX" , " .*.*.*.#------------------#*.*.*.*XXX" , " *.*.*.#--------------------#*.*.*.XXX" , " .*.*.#----------------------#*.*.*XXX" , " *.*.#------------------------#*.*.XXX" , " .*.*#----################----#.*.*XXX" , " *.*#----##################----#.*.XXX" , " .*.#---#-################-#---#*.*XXX" , " *.*#--#--#######--#######--#--#.*.XXX" , " .*#--#---######----######---#--#.*XXX" , " *.#-#-----####------####-----#-#*.XXX" , " .*##-------##--------##-------##.*XXX" , " *.#----------------------------#*.XXX" , " .*#----------------------------#.*XXX" , " *.#----------------------------#*.XXX" , " .*#----------------------------#.*XXX" , " *.#----------------------------#*.XXX" , " .*.#------#------------#------#*.*XXX" , " *.*#-------#----------#-------#.*.XXX" , " .*.#--------##------##--------#*.*XXX" , " *.*.#---------######---------#*.*.XXX" , " .*.*#------------------------#.*.*XXX" , " *.*.*#----------------------#.*.*.XXX" , " .*.*.*#--------------------#.*.*.*XXX" , " *.*.*.*#------------------#.*.*.*.XXX" , " .*.*.*.*##--------------##.*.*.*.*XXX" , " *.*.*.*.*.###--------###*.*.*.*.*.XXX" , " .*.*.*.*.*.*.########*.*.*.*.*.*.*XXX" , " *.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.XXX" , " .*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*XXX" , " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" , " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" , " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" , } ; xdemineur-2.1.1/pixmaps/face_normal.xpm100644 1750 1750 4233 6467111076 17206 0ustar babafouskiff/* XPM */ static char *xpm_face_normal[] = { /* width height ncolors chars_per_pixel */ "40 40 6 1" , /* colors */ " c white" , "# c black" , "X c gray50 m black" , "* c gray70 m black" , ". c gray70 m white" , "- c yellow m white" , /* pixels */ " " , " X" , " XX" , " *.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.XXX" , " .*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*XXX" , " *.*.*.*.*.*.*########.*.*.*.*.*.*.XXX" , " .*.*.*.*.*###--------###.*.*.*.*.*XXX" , " *.*.*.*.##--------------##*.*.*.*.XXX" , " .*.*.*.#------------------#*.*.*.*XXX" , " *.*.*.#--------------------#*.*.*.XXX" , " .*.*.#----------------------#*.*.*XXX" , " *.*.#------------------------#*.*.XXX" , " .*.*#------------------------#.*.*XXX" , " *.*#-------##--------##-------#.*.XXX" , " .*.#------####------####------#*.*XXX" , " *.*#------####------####------#.*.XXX" , " .*#--------##--------##--------#.*XXX" , " *.#----------------------------#*.XXX" , " .*#----------------------------#.*XXX" , " *.#----------------------------#*.XXX" , " .*#----------------------------#.*XXX" , " *.#----------------------------#*.XXX" , " .*#----------------------------#.*XXX" , " *.#----------------------------#*.XXX" , " .*.#------#------------#------#*.*XXX" , " *.*#-------#----------#-------#.*.XXX" , " .*.#--------##------##--------#*.*XXX" , " *.*.#---------######---------#*.*.XXX" , " .*.*#------------------------#.*.*XXX" , " *.*.*#----------------------#.*.*.XXX" , " .*.*.*#--------------------#.*.*.*XXX" , " *.*.*.*#------------------#.*.*.*.XXX" , " .*.*.*.*##--------------##.*.*.*.*XXX" , " *.*.*.*.*.###--------###*.*.*.*.*.XXX" , " .*.*.*.*.*.*.########*.*.*.*.*.*.*XXX" , " *.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.XXX" , " .*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*XXX" , " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" , " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" , " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" , } ; xdemineur-2.1.1/pixmaps/face_play.xpm100644 1750 1750 4231 6467076546 16675 0ustar babafouskiff/* XPM */ static char *xpm_face_play[] = { /* width height ncolors chars_per_pixel */ "40 40 6 1" , /* colors */ " c white" , "# c black" , "X c gray50 m black" , "* c gray70 m black" , ". c gray70 m white" , "- c yellow m white" , /* pixels */ " " , " X" , " XX" , " *.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.XXX" , " .*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*XXX" , " *.*.*.*.*.*.*########.*.*.*.*.*.*.XXX" , " .*.*.*.*.*###--------###.*.*.*.*.*XXX" , " *.*.*.*.##--------------##*.*.*.*.XXX" , " .*.*.*.#------------------#*.*.*.*XXX" , " *.*.*.#--------------------#*.*.*.XXX" , " .*.*.#----------------------#*.*.*XXX" , " *.*.#------------------------#*.*.XXX" , " .*.*#------##--------##------#.*.*XXX" , " *.*#------####------####------#.*.XXX" , " .*.#-----######----######-----#*.*XXX" , " *.*#-----######----######-----#.*.XXX" , " .*#-------####------####-------#.*XXX" , " *.#--------##--------##--------#*.XXX" , " .*#----------------------------#.*XXX" , " *.#----------------------------#*.XXX" , " .*#----------------------------#.*XXX" , " *.#----------------------------#*.XXX" , " .*#----------------------------#.*XXX" , " *.#-------------##-------------#*.XXX" , " .*.#-----------#--#-----------#*.*XXX" , " *.*#----------#----#----------#.*.XXX" , " .*.#----------#----#----------#*.*XXX" , " *.*.#----------#--#----------#*.*.XXX" , " .*.*#-----------##-----------#.*.*XXX" , " *.*.*#----------------------#.*.*.XXX" , " .*.*.*#--------------------#.*.*.*XXX" , " *.*.*.*#------------------#.*.*.*.XXX" , " .*.*.*.*##--------------##.*.*.*.*XXX" , " *.*.*.*.*.###--------###*.*.*.*.*.XXX" , " .*.*.*.*.*.*.########*.*.*.*.*.*.*XXX" , " *.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.XXX" , " .*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*XXX" , " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" , " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" , " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" , } ; xdemineur-2.1.1/pixmaps/face_sad.xpm100644 1750 1750 4230 6467111077 16463 0ustar babafouskiff/* XPM */ static char *xpm_face_sad[] = { /* width height ncolors chars_per_pixel */ "40 40 6 1" , /* colors */ " c white" , "# c black" , "X c gray50 m black" , "* c gray70 m black" , ". c gray70 m white" , "- c yellow m white" , /* pixels */ " " , " X" , " XX" , " *.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.XXX" , " .*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*XXX" , " *.*.*.*.*.*.*########.*.*.*.*.*.*.XXX" , " .*.*.*.*.*###--------###.*.*.*.*.*XXX" , " *.*.*.*.##--------------##*.*.*.*.XXX" , " .*.*.*.#------------------#*.*.*.*XXX" , " *.*.*.#--------------------#*.*.*.XXX" , " .*.*.#----------------------#*.*.*XXX" , " *.*.#------------------------#*.*.XXX" , " .*.*#------------------------#.*.*XXX" , " *.*#------#--#------#--#------#.*.XXX" , " .*.#-------##--------##-------#*.*XXX" , " *.*#-------##--------##-------#.*.XXX" , " .*#-------#--#------#--#-------#.*XXX" , " *.#----------------------------#*.XXX" , " .*#----------------------------#.*XXX" , " *.#----------------------------#*.XXX" , " .*#----------------------------#.*XXX" , " *.#----------------------------#*.XXX" , " .*#----------------------------#.*XXX" , " *.#----------------------------#*.XXX" , " .*.#----------######----------#*.*XXX" , " *.*#--------##------##--------#.*.XXX" , " .*.#-------#----------#-------#*.*XXX" , " *.*.#-----#------------#-----#*.*.XXX" , " .*.*#------------------------#.*.*XXX" , " *.*.*#----------------------#.*.*.XXX" , " .*.*.*#--------------------#.*.*.*XXX" , " *.*.*.*#------------------#.*.*.*.XXX" , " .*.*.*.*##--------------##.*.*.*.*XXX" , " *.*.*.*.*.###--------###*.*.*.*.*.XXX" , " .*.*.*.*.*.*.########*.*.*.*.*.*.*XXX" , " *.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.XXX" , " .*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*XXX" , " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" , " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" , " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" , } ; xdemineur-2.1.1/pixmaps/flag.xpm100644 1750 1750 1504 6467076547 15664 0ustar babafouskiff/* XPM */ static char *xpm_flag[] = { /* width height ncolors chars_per_pixel */ "20 20 6 1" , /* colors */ " c white" , "# c black" , "X c gray50 m black" , "* c gray70 m black" , ". c gray70 m white" , "- c red m black" , /* pixels */ " " , " X" , " XX" , " *.*.*.*.*.*.*.XXX" , " .*.*.*--.*.*.*XXX" , " *.*.----*.*.*.XXX" , " .*------.*.*.*XXX" , " *-------*.*.*.XXX" , " .*------.*.*.*XXX" , " *.*.----*.*.*.XXX" , " .*.*.*--.*.*.*XXX" , " *.*.*.*#*.*.*.XXX" , " .*.*.*.#.*.*.*XXX" , " *.*.*####.*.*.XXX" , " .*.########*.*XXX" , " *.##########*.XXX" , " .*.*.*.*.*.*.*XXX" , " XXXXXXXXXXXXXXXXX" , " XXXXXXXXXXXXXXXXXX" , " XXXXXXXXXXXXXXXXXXX" , } ; xdemineur-2.1.1/pixmaps/mine.xpm100644 1750 1750 1366 6467076547 15711 0ustar babafouskiff/* XPM */ static char *xpm_mine[] = { /* width height ncolors chars_per_pixel */ "20 20 3 1" , /* colors */ " c white" , "# c black" , ". c gray70 m white" , /* pixels */ "...................." , ".........##........." , ".........##........." , "...#....####....#..." , "....#.########.#...." , ".....##########....." , "....############...." , "....### ######...." , "...#### #######..." , ".###### #########." , ".##################." , "...##############..." , "....############...." , "....############...." , ".....##########....." , "....#.########.#...." , "...#....####....#..." , ".........##........." , ".........##........." , "...................." , } ; xdemineur-2.1.1/pixmaps/mine_false.xpm100644 1750 1750 1460 6467076547 17056 0ustar babafouskiff/* XPM */ static char *xpm_mine_false[] = { /* width height ncolors chars_per_pixel */ "20 20 5 1" , /* colors */ " c white" , "# c black" , "* c black m white" , ". c gray70 m white" , "- c red m black" , /* pixels */ "...................." , ".--......#*......--." , ".---.....*#.....---." , "..---...*#*#...---.." , "...---#*#*#*#*---..." , "....---#*#*#*---...." , "....#---#*#*---*...." , "....*#--- *---*#...." , "...*#*#------*#*#..." , ".#*#*#* ----*#*#*#*." , ".*#*#*#*----#*#*#*#." , "...#*#*------#*#*..." , "....#*---*#---#*...." , "....*---*#*#---#...." , "....---*#*#*#---...." , "...---*#*#*#*#---..." , "..---...#*#*...---.." , ".---.....#*.....---." , ".--......*#......--." , "...................." , } ; xdemineur-2.1.1/pixmaps/mine_lost.xpm100644 1750 1750 1412 6467076547 16742 0ustar babafouskiff/* XPM */ static char *xpm_mine_lost[] = { /* width height ncolors chars_per_pixel */ "20 20 3 1" , /* colors */ " c white m black" , "# c black m white" , ". c red m black" , /* pixels */ "...................." , ".........##........." , ".........##........." , "...#....####....#..." , "....#.########.#...." , ".....##########....." , "....############...." , "....### ######...." , "...#### #######..." , ".###### #########." , ".##################." , "...##############..." , "....############...." , "....############...." , ".....##########....." , "....#.########.#...." , "...#....####....#..." , ".........##........." , ".........##........." , "...................." , } ; xdemineur-2.1.1/pixmaps/question.xpm100644 1750 1750 1456 6467076547 16630 0ustar babafouskiff/* XPM */ static char *xpm_question[] = { /* width height ncolors chars_per_pixel */ "20 20 5 1" , /* colors */ " c white" , "# c black" , "X c gray50 m black" , "* c gray70 m black" , ". c gray70 m white" , /* pixels */ " " , " X" , " XX" , " *.*.*.*.*.*.*.XXX" , " .*.*######.*.*XXX" , " *.*########.*.XXX" , " .*###*.*.###.*XXX" , " *.###.*.*###*.XXX" , " .*.*.*.*###*.*XXX" , " *.*.*.*###*.*.XXX" , " .*.*.*.###.*.*XXX" , " *.*.*.###.*.*.XXX" , " .*.*.*.*.*.*.*XXX" , " *.*.*.###.*.*.XXX" , " .*.*.*###*.*.*XXX" , " *.*.*.###.*.*.XXX" , " .*.*.*.*.*.*.*XXX" , " XXXXXXXXXXXXXXXXX" , " XXXXXXXXXXXXXXXXXX" , " XXXXXXXXXXXXXXXXXXX" , } ; xdemineur-2.1.1/pixmaps/relief.xpm100644 1750 1750 1433 6467076546 16221 0ustar babafouskiff/* XPM */ static char *xpm_relief[] = { /* width height ncolors chars_per_pixel */ "20 20 4 1" , /* colors */ " c white" , "X c gray50 m black" , "* c gray70 m black" , ". c gray70 m white" , /* pixels */ " " , " X" , " XX" , " *.*.*.*.*.*.*.XXX" , " .*.*.*.*.*.*.*XXX" , " *.*.*.*.*.*.*.XXX" , " .*.*.*.*.*.*.*XXX" , " *.*.*.*.*.*.*.XXX" , " .*.*.*.*.*.*.*XXX" , " *.*.*.*.*.*.*.XXX" , " .*.*.*.*.*.*.*XXX" , " *.*.*.*.*.*.*.XXX" , " .*.*.*.*.*.*.*XXX" , " *.*.*.*.*.*.*.XXX" , " .*.*.*.*.*.*.*XXX" , " *.*.*.*.*.*.*.XXX" , " .*.*.*.*.*.*.*XXX" , " XXXXXXXXXXXXXXXXX" , " XXXXXXXXXXXXXXXXXX" , " XXXXXXXXXXXXXXXXXXX" , } ; xdemineur-2.1.1/pixmaps/square_0.xpm100644 1750 1750 1330 6467076547 16467 0ustar babafouskiff/* XPM */ static char *xpm_square_0[] = { /* width height ncolors chars_per_pixel */ "20 20 1 1" , /* colors */ ". c gray70 m white" , /* pixels */ "...................." , "...................." , "...................." , "...................." , "...................." , "...................." , "...................." , "...................." , "...................." , "...................." , "...................." , "...................." , "...................." , "...................." , "...................." , "...................." , "...................." , "...................." , "...................." , "...................." , } ; xdemineur-2.1.1/pixmaps/square_1.xpm100644 1750 1750 1362 6467076547 16475 0ustar babafouskiff/* XPM */ static char *xpm_square_1[] = { /* width height ncolors chars_per_pixel */ "20 20 2 1" , /* colors */ ". c gray70 m white" , "- c blue m black" , /* pixels */ "...................." , "...................." , "..........--........" , ".........---........" , "........----........" , ".......-----........" , "......------........" , ".....-------........" , "........----........" , "........----........" , "........----........" , "........----........" , "........----........" , "........----........" , "........----........" , ".....----------....." , ".....----------....." , ".....----------....." , "...................." , "...................." , } ; xdemineur-2.1.1/pixmaps/square_2.xpm100644 1750 1750 1374 6467076547 16501 0ustar babafouskiff/* XPM */ static char *xpm_square_2[] = { /* width height ncolors chars_per_pixel */ "20 20 2 1" , /* colors */ ". c gray70 m white" , "- c forestgreen m black" , /* pixels */ "...................." , "...................." , "......--------......" , ".....----------....." , "....------------...." , "....---......---...." , "....---.....----...." , "...........----....." , "..........----......" , ".........----......." , "........----........" , ".......----........." , "......----.........." , ".....----..........." , "....----............" , "....------------...." , "....------------...." , "....------------...." , "...................." , "...................." , } ; xdemineur-2.1.1/pixmaps/square_3.xpm100644 1750 1750 1362 6467076547 16477 0ustar babafouskiff/* XPM */ static char *xpm_square_3[] = { /* width height ncolors chars_per_pixel */ "20 20 2 1" , /* colors */ ". c gray70 m white" , "- c red m black" , /* pixels */ "...................." , "...................." , "....----------......" , "....-----------....." , "....------------...." , "............----...." , "............----...." , "............----...." , "........-------....." , "........------......" , "........-------....." , "............----...." , "............----...." , "............----...." , "....------------...." , "....-----------....." , "....----------......" , "...................." , "...................." , "...................." , } ; xdemineur-2.1.1/pixmaps/square_4.xpm100644 1750 1750 1362 6467076547 16500 0ustar babafouskiff/* XPM */ static char *xpm_square_4[] = { /* width height ncolors chars_per_pixel */ "20 20 2 1" , /* colors */ ". c gray70 m white" , "- c navy m black" , /* pixels */ "...................." , "...................." , ".......---.----....." , "......----.----....." , "......----.----....." , ".....----..----....." , ".....----..----....." , "....----...----....." , "....----...----....." , "....------------...." , "....------------...." , "....------------...." , "...........----....." , "...........----....." , "...........----....." , "...........----....." , "...........----....." , "...........----....." , "...................." , "...................." , } ; xdemineur-2.1.1/pixmaps/square_5.xpm100644 1750 1750 1362 6467076547 16501 0ustar babafouskiff/* XPM */ static char *xpm_square_5[] = { /* width height ncolors chars_per_pixel */ "20 20 2 1" , /* colors */ ". c gray70 m white" , "- c orchid m black" , /* pixels */ "...................." , "...................." , "....------------...." , "....------------...." , "....------------...." , "....---............." , "....---............." , "....---............." , "....----------......" , "....-----------....." , "....------------...." , ".............---...." , ".............---...." , "....---......---...." , "....------------...." , ".....----------....." , "......--------......" , "...................." , "...................." , "...................." , } ; xdemineur-2.1.1/pixmaps/square_6.xpm100644 1750 1750 1366 6467076550 16500 0ustar babafouskiff/* XPM */ static char *xpm_square_6[] = { /* width height ncolors chars_per_pixel */ "20 20 2 1" , /* colors */ ". c gray70 m white" , "- c seagreen m black" , /* pixels */ "...................." , "...................." , "......----------...." , ".....-----------...." , "....------------...." , "....---............." , "....---............." , "....---............." , "....----------......" , "....-----------....." , "....------------...." , "....---......---...." , "....---......---...." , "....---......---...." , "....------------...." , ".....----------....." , "......--------......" , "...................." , "...................." , "...................." , } ; xdemineur-2.1.1/pixmaps/square_7.xpm100644 1750 1750 1362 6467076550 16475 0ustar babafouskiff/* XPM */ static char *xpm_square_7[] = { /* width height ncolors chars_per_pixel */ "20 20 2 1" , /* colors */ ". c gray70 m white" , "- c sienna m white" , /* pixels */ "...................." , "...................." , "....------------...." , "....------------...." , "....------------...." , "............---....." , "............---....." , "...........---......" , "...........---......" , "..........---......." , "..........---......." , ".........---........" , ".........---........" , "........---........." , "........---........." , ".......---.........." , ".......---.........." , ".......---.........." , "...................." , "...................." , } ; xdemineur-2.1.1/pixmaps/square_8.xpm100644 1750 1750 1366 6467076550 16502 0ustar babafouskiff/* XPM */ static char *xpm_square_8[] = { /* width height ncolors chars_per_pixel */ "20 20 2 1" , /* colors */ ". c gray70 m white" , "- c deeppink m white" , /* pixels */ "...................." , "...................." , "......--------......" , ".....----------....." , "....------------...." , "....-----..-----...." , "....----....----...." , "....-----..-----...." , ".....----------....." , "......--------......" , ".....----------....." , "....-----..-----...." , "....----....----...." , "....-----..-----...." , "....------------...." , ".....----------....." , "......--------......" , "...................." , "...................." , "...................." , } ;