Exemplo n.º 1
0
std::unique_ptr<Board>
CreateGameBoard()
{
	auto gameBoard = std::make_unique<Board>();
	gameBoard->MakeBoard(NUM_PLAYERS);

	return gameBoard;
}
Exemplo n.º 2
0
GemPuzzleState::GemPuzzleState(const char* str):_reward(0),_pjm(WHITE) {
    MakeBoard(str);
    _board = _srcBoard;
    _zeroPos = _srcZeroPos;
    _dstBoard=_srcBoard;
    _fix.resize(_size);
    std::sort(_dstBoard.begin(), _dstBoard.end());
    std::swap(_dstBoard[0],_dstBoard[_size-1]);
    std::fill(_fix.begin(),_fix.end(),-1);
    _srcReward = Evaluate();
    
}
Exemplo n.º 3
0
bool CMine_Sweeper::On_Execute(void)
{
	MakeBoard(Parameters("LEVEL")->asInt());

	GameBoard	= (CSG_Grid *) new CSG_Grid(SG_DATATYPE_Int,Mine_NX,Mine_NY);
	FlagBoard	= (CSG_Grid *) new CSG_Grid(SG_DATATYPE_Int,Mine_NX,Mine_NY);

	First_Click	= true;
	Time		= NULL;	

	return( true );
}
Exemplo n.º 4
0
unsigned int JS_MinimaxBestMove(unsigned int f00, unsigned int f01, unsigned int f02, unsigned int f03,
								unsigned int f10, unsigned int f11, unsigned int f12, unsigned int f13,
								unsigned int f20, unsigned int f21, unsigned int f22, unsigned int f23,
								unsigned int f30, unsigned int f31, unsigned int f32, unsigned int f33) {
	Board board = MakeBoard(
		MakeRow(f00, f01, f02, f03),
		MakeRow(f10, f11, f12, f13),
		MakeRow(f20, f21, f22, f23),
		MakeRow(f30, f31, f32, f33)
	);
	HeuristicParameters parameters;
	GetDefaultHeuristicParameters(&parameters);
	auto p = FindBestMove(board, parameters);
	return p.first;
}