Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

EndgameUtils Namespace Reference

Utilities on endgames: detecting, playing, etc. More...

Functions

bool IsWonGame (const HexBoard &brd, HexColor color, bitset_t &proof)
 Returns true if color wins in this state.
bool IsWonGame (const HexBoard &brd, HexColor color)
bool IsLostGame (const HexBoard &brd, HexColor color, bitset_t &proof)
 Returns true if color loses in this state.
bool IsLostGame (const HexBoard &brd, HexColor color)
bool IsDeterminedState (const HexBoard &brd, HexColor color, HexEval &score, bitset_t &proof)
 Returns true if this is a winning/losing state for color (as defined by IsWonGame() and IsLostGame()), score is set to IMMEDIATE_WIN on win, IMMEDIATE_LOSS on a loss, or 0 otherwise.
bool IsDeterminedState (const HexBoard &brd, HexColor color, HexEval &score)
bool IsDeterminedState (const HexBoard &brd, HexColor color)
HexPoint PlayDeterminedState (const HexBoard &brd, HexColor color)
 Plays the "best" move in a determined state.
bitset_t MovesToConsider (const HexBoard &brd, HexColor color)
 Returns the set of moves that need to be considered from the given boardstate; that is, without the moves that we can provably ignore.

Detailed Description

Utilities on endgames: detecting, playing, etc.


Function Documentation

bool EndgameUtils::IsDeterminedState ( const HexBoard brd,
HexColor  color 
) [inline]

Definition at line 77 of file EndgameUtils.hpp.

References HexEval, and IsDeterminedState().

bool EndgameUtils::IsDeterminedState ( const HexBoard brd,
HexColor  color,
HexEval score 
) [inline]

Definition at line 69 of file EndgameUtils.hpp.

References IsDeterminedState().

bool EndgameUtils::IsDeterminedState ( const HexBoard brd,
HexColor  color,
HexEval score,
bitset_t proof 
)
bool EndgameUtils::IsLostGame ( const HexBoard brd,
HexColor  color 
) [inline]

Definition at line 84 of file EndgameUtils.hpp.

References IsLostGame().

bool EndgameUtils::IsLostGame ( const HexBoard brd,
HexColor  color,
bitset_t proof 
)
bool EndgameUtils::IsWonGame ( const HexBoard brd,
HexColor  color 
) [inline]

Definition at line 90 of file EndgameUtils.hpp.

References IsWonGame().

bool EndgameUtils::IsWonGame ( const HexBoard brd,
HexColor  color,
bitset_t proof 
)
bitset_t EndgameUtils::MovesToConsider ( const HexBoard brd,
HexColor  color 
)
HexPoint EndgameUtils::PlayDeterminedState ( const HexBoard brd,
HexColor  color 
)

Plays the "best" move in a determined state.

Assumes IsDetermined() returns true, but requires that brd.isGameOver() is false. That is, is, it cannot play a move if a solid chain exists on this board.

See also:
Playing in Determined States

Definition at line 304 of file EndgameUtils.cpp.

References HexBoard::GetGroups(), HexAssert, HexColorUtil::isBlackWhite(), IsDeterminedState(), Groups::IsGameOver(), IsLostGame(), and IsWonGame().

Referenced by BenzenePlayer::CheckEndgame().


6 Jan 2011 Doxygen 1.6.3