/* * Gnome Nine Mens Morris * Written by Dirk Farin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef NMM_TREE_H #define NMM_TREE_H #include "board.hh" #include "eval.hh" #include class SearchAlgo { public: SearchAlgo() { d_current_board.Init(); } ~SearchAlgo() { } void SetEvaluator(Evaluator& e) { d_eval=&e; } void Init() { d_current_board.Init(); } void SetBoard(const Board& b) { d_current_board=b; } void DoMove(const Move& m) { d_current_board.DoMove(m); } Move ComputerMove(int nNodes); void StopComputer(); bool ComputerStopped() { return stop; } bool CurrentHasLost() const; bool OpponentHasLost() const; protected: Evaluator* d_eval; private: double Recurse(const Board& b,double alpha,double beta,int levels_to_go,Move*); Board d_current_board; int d_nodes_visited; bool stop; }; #endif