~ml-launchpad/ubuntu/natty/gcompris/fix-for-777349

« back to all changes in this revision

Viewing changes to src/awele-activity/awele_utils.h

  • Committer: Bazaar Package Importer
  • Author(s): Marc Gariepy, Marc Gariepy, Stephane Graber
  • Date: 2010-01-04 17:42:49 UTC
  • mfrom: (1.1.14 upstream)
  • Revision ID: james.westby@ubuntu.com-20100104174249-7bupatd9dtxyhvs4
Tags: 9.0-0ubuntu1
[Marc Gariepy]
* New upstream release (9.0).
* Remove cache.c from POTFILES to avoid FTBFS
* Remove unneeded rm in debian/rules (file no longer exists upstream)

[Stephane Graber]
* Bump Debian standards to 3.8.3
* Add patch system (dpatch)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * gcompris - awele.c
 
3
 *
 
4
 * Copyright (C) 2005, 2008 Frederic Mazzarol
 
5
 *
 
6
 *   This program is free software; you can redistribute it and/or modify
 
7
 *   it under the terms of the GNU General Public License as published by
 
8
 *   the Free Software Foundation; either version 3 of the License, or
 
9
 *   (at your option) any later version.
 
10
 *
 
11
 *   This program is distributed in the hope that it will be useful,
 
12
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 *   GNU General Public License for more details.
 
15
 *
 
16
 *   You should have received a copy of the GNU General Public License
 
17
 *   along with this program; if not, see <http://www.gnu.org/licenses/>.
 
18
 */
 
19
 
 
20
#include "gcompris/gcompris.h"
 
21
 
 
22
#ifndef TRUE
 
23
#define TRUE 1
 
24
#define FALSE 0
 
25
#endif
 
26
 
 
27
#define NBHOLE 12               // Nombre de cases de l'awele
 
28
#define NBTOTALBEAN 48          // Nombre de graines totale de l'awale
 
29
#define NBPLAYER 2              // Nombre de joueur
 
30
#define HUMAN 0                 // Numero du joueur Humain (camp Sud)
 
31
#define COMPUTER 1              // Numero du joueur virtuel (camp nord)
 
32
#define START_HUMAN 0           // Premiere case du camp Sud
 
33
#define START_COMPUTER 6        // Premiere Case du camp Nord
 
34
#define END_HUMAN 5             // Derniere case du camp Sud
 
35
#define END_COMPUTER 11         // Derniere case du camp Nord
 
36
#define NBBEANSPERHOLE 4        // Nbre de graine par case en debut de partie
 
37
#define HALF_SIZE 6             // nbre de case dans un camp
 
38
#define DEF_DEPTH 3             // Profondeur de recherche de l'algo minimax
 
39
#define INFINI 50               // Infini pour alphaBeta
 
40
 
 
41
/*
 
42
*       Code erreur retour des fonctions de test mouvements
 
43
*/
 
44
#define EMPTY_HOLE 51
 
45
#define HUNGRY 52
 
46
#define GAMEOVER 53
 
47
#define NOT_GAMEOVER 54
 
48
 
 
49
#define MSG_FAMINE "declenche une famine"
 
50
#define MSG_AREA "clic dans ton camp"
 
51
#define MSG_EMPTYHOLE "Cette case est vide, selectionne une autre case"
 
52
 
 
53
 
 
54
/**
 
55
*       Definition nouveaux types de variables
 
56
*/
 
57
typedef struct {
 
58
  short int board[NBHOLE];
 
59
  short int CapturedBeans[NBPLAYER];
 
60
  short int player;
 
61
  short int last_play;
 
62
} AWALE;
 
63
 
 
64
 
 
65
 
 
66
 
 
67
 
 
68
/**
 
69
*       Fonction de manipulation de l'awale
 
70
*/
 
71
gboolean diedOfHunger(AWALE *aw);
 
72
AWALE *moveAwale(short int hole, AWALE * aw);
 
73
short int think(AWALE * a, short int level);
 
74
short int randplay(AWALE * a);
 
75
 
 
76
short int switch_player(short int player);
 
77
 
 
78
short int threatenDelta(AWALE * aw);
 
79
short int moveDelta(AWALE * aw);
 
80
gint eval(GNode *node);