File: demineur.h

package info (click to toggle)
xdemineur 2.1.1-21
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 436 kB
  • sloc: ansic: 1,314; makefile: 8
file content (72 lines) | stat: -rw-r--r-- 1,867 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
 * Copyright  1993-1999 Marc Baudoin <babafou@babafou.eu.org>
 *
 * 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_ */