1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (c) 2006 Alexander Levin
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
20 #ifndef _REVERSI_STRATEGY_H
21 #define _REVERSI_STRATEGY_H
23 #include "reversi-game.h"
26 /* Function for making a move. Is called only for robots.
27 Should return the game history entry for the advised move if
28 a move has been considered or HISTORY_INVALID_ENTRY if no move
29 has been considered. The board should not be modified. */
30 typedef move_t (*move_func_t
)(const reversi_board_t
*game
, int color
);
31 typedef void (*init_func_t
)(const reversi_board_t
*game
);
33 /* A playing party/strategy */
34 typedef struct _game_strategy_t
{
35 const bool is_robot
; /* Is the player a robot or does it require user input? */
36 init_func_t init_func
; /* Initialise strategy */
37 move_func_t move_func
; /* Make a move */
41 /* --- Possible playing strategies --- */
42 extern const game_strategy_t strategy_human
;
43 extern const game_strategy_t strategy_naive
;
44 extern const game_strategy_t strategy_simple
;
45 //extern const game_strategy_t strategy_ab;
47 #define CHAOSNOISE 0.05 /**< Changerate of heuristic-value */
48 #define CHAOSPROB 0.1 /**< Probability of change of the heuristic-value */