Antoine Cellerier | b4b34f0 | 2007-06-30 20:04:42 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
| 8 | * $Id$ |
| 9 | * |
| 10 | * Copyright (c) 2006 Alexander Levin |
| 11 | * |
Daniel Stenberg | 2acc0ac | 2008-06-28 18:10:04 +0000 | [diff] [blame^] | 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. |
Antoine Cellerier | b4b34f0 | 2007-06-30 20:04:42 +0000 | [diff] [blame] | 16 | * |
| 17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 18 | * KIND, either express or implied. |
| 19 | * |
| 20 | ****************************************************************************/ |
| 21 | |
| 22 | #ifndef _REVERSI_STRATEGY_H |
| 23 | #define _REVERSI_STRATEGY_H |
| 24 | |
| 25 | #include "reversi-game.h" |
| 26 | |
| 27 | |
| 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); |
Antoine Cellerier | cd82964 | 2007-07-01 20:48:51 +0000 | [diff] [blame] | 33 | typedef void (*init_func_t)(const reversi_board_t *game); |
Antoine Cellerier | b4b34f0 | 2007-06-30 20:04:42 +0000 | [diff] [blame] | 34 | |
| 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? */ |
Antoine Cellerier | cd82964 | 2007-07-01 20:48:51 +0000 | [diff] [blame] | 38 | init_func_t init_func; /* Initialise strategy */ |
| 39 | move_func_t move_func; /* Make a move */ |
Antoine Cellerier | b4b34f0 | 2007-06-30 20:04:42 +0000 | [diff] [blame] | 40 | } game_strategy_t; |
| 41 | |
| 42 | |
| 43 | /* --- Possible playing strategies --- */ |
| 44 | extern const game_strategy_t strategy_human; |
Antoine Cellerier | 9af4289 | 2007-07-01 17:51:38 +0000 | [diff] [blame] | 45 | extern const game_strategy_t strategy_naive; |
| 46 | extern const game_strategy_t strategy_simple; |
Antoine Cellerier | cd82964 | 2007-07-01 20:48:51 +0000 | [diff] [blame] | 47 | //extern const game_strategy_t strategy_ab; |
| 48 | |
| 49 | #define CHAOSNOISE 0.05 /**< Changerate of heuristic-value */ |
| 50 | #define CHAOSPROB 0.1 /**< Probability of change of the heuristic-value */ |
Antoine Cellerier | b4b34f0 | 2007-06-30 20:04:42 +0000 | [diff] [blame] | 51 | |
| 52 | #endif |