Fix a possiblity where viewport_set_default left the viewport unchanged. Improve...
[kugel-rb.git] / apps / plugins / reversi / reversi-strategy.h
blob97f3c94127bed00bcaa32ec657757db0c187da6b
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (c) 2006 Alexander Levin
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #ifndef _REVERSI_STRATEGY_H
23 #define _REVERSI_STRATEGY_H
25 #include "reversi-game.h"
28 /* Function for making a move. Is called only for robots.
29 Should return the game history entry for the advised move if
30 a move has been considered or HISTORY_INVALID_ENTRY if no move
31 has been considered. The board should not be modified. */
32 typedef move_t (*move_func_t)(const reversi_board_t *game, int color);
33 typedef void (*init_func_t)(const reversi_board_t *game);
35 /* A playing party/strategy */
36 typedef struct _game_strategy_t {
37 const bool is_robot; /* Is the player a robot or does it require user input? */
38 init_func_t init_func; /* Initialise strategy */
39 move_func_t move_func; /* Make a move */
40 } game_strategy_t;
43 /* --- Possible playing strategies --- */
44 extern const game_strategy_t strategy_human;
45 extern const game_strategy_t strategy_naive;
46 extern const game_strategy_t strategy_simple;
47 //extern const game_strategy_t strategy_ab;
49 #define CHAOSNOISE 0.05 /**< Changerate of heuristic-value */
50 #define CHAOSPROB 0.1 /**< Probability of change of the heuristic-value */
52 #endif