//* ScoreIndex NodetypeRoot::GoToTheAdventure_new( Rucksack& rucksack, Position& pos, Flashlight* pFlashlight,//サーチスタック ScoreIndex alpha, ScoreIndex beta, const Depth depth, const bool cutNode ) const { assert(-ScoreInfinite <= alpha && alpha < beta && beta <= ScoreInfinite); assert(Depth0 < depth); // 途中で goto を使用している為、先に全部の変数を定義しておいた方が安全。 Move movesSearched[64]; StateInfo st; const TTEntry* pTtEntry = nullptr;//(^q^)トランスポジション・テーブル・エントリー☆? SplitedNode* pSplitedNode = nullptr;//(^q^) Key posKey; Move ttMove; Move move; Move excludedMove; Move bestMove; Move threatMove; Depth newDepth; Depth extension; ScoreIndex bestScore; ScoreIndex score; ScoreIndex ttScore; ScoreIndex eval; bool inCheck; bool givesCheck; bool isPVMove; bool singularExtensionNode; bool captureOrPawnPromotion; bool dangerous; bool doFullDepthSearch; int moveCount; int playedMoveCount; // step1 // initialize node Military* pThisThread = pos.GetThisThread(); moveCount = playedMoveCount = 0; inCheck = pos.InCheck(); //bool isGotoSplitPointStart = false; this->DoStep1b( bestScore, &pFlashlight, threatMove, bestMove ); this->DoStep1c( &pThisThread, pFlashlight ); //bool isReturnWithScore = false; //ScoreIndex returnScore = ScoreIndex::ScoreNone; pos.SetNodesSearched(pos.GetNodesSearched() + 1); // step4 this->DoStep4( excludedMove, &pFlashlight, posKey, pos, &pTtEntry,//セットされる☆ rucksack, ttScore ); this->DoStep4x( ttMove, rucksack, pTtEntry, pos ); // step5 bool isGotoIidStart = false;//NonPVのとき使う☆ this->DoStep5( isGotoIidStart, rucksack, eval, &pFlashlight, pos, inCheck, pTtEntry, ttScore, posKey, move ); /* if (isGotoIidStart) { goto iid_start; } */ // 内側の反復深化探索☆?(^q^) //iid_start: // step10 this->DoStep10_InternalIterativeDeepening( depth, ttMove, inCheck, beta, &pFlashlight, rucksack, pos, alpha, &pTtEntry,//セットされるぜ☆ posKey ); //split_point_start: NextmoveEvent videodeck( // 通常の探索 pos, ttMove, depth, rucksack.m_history, pFlashlight, this->GetBetaAtStep11(beta)//PVノードか、そうでないかで初期値を変えるぜ☆(^q^) ); const CheckInfo ci(pos); this->DoStep11a_BeforeLoop_SplitPointStart( ttMove, depth, score, bestScore, singularExtensionNode, excludedMove, pTtEntry//pv,nonPv の2つで、nullptrはダメ☆ ); // step11 // Loop through moves while ( !( // スプリット・ポイントかどうかで、取ってくる指し手が変わる☆ move = this->GetNextMove_AtStep11(videodeck) ).IsNone() ) { // DoStep11b if (move == excludedMove) { // ムーブが一致していれば、次のループへ☆ continue; } bool isContinue = false; this->DoStep11c_LoopHeader( isContinue, pos, move, ci, moveCount, &pSplitedNode ); if (isContinue) { continue; } this->DoStep11d_LoopHeader( isContinue, rucksack, move ); if (isContinue) { continue; } this->DoStep11e_LoopHeader( rucksack, moveCount ); this->DoStep11f_LoopHeader( extension, captureOrPawnPromotion, move, givesCheck, ci, pos, dangerous ); // step12 this->DoStep12( rucksack, givesCheck, pos, move, extension, singularExtensionNode, ttMove, ttScore, ci, depth, &pFlashlight, score, cutNode, beta, newDepth ); this->DoStep13c( isContinue, rucksack, captureOrPawnPromotion, inCheck, dangerous, bestScore, move, ttMove, depth, moveCount, threatMove, pos, &pSplitedNode, newDepth, &pFlashlight, beta, ci, isPVMove, playedMoveCount, movesSearched ); if (isContinue) { continue; } this->DoStep13d( captureOrPawnPromotion, playedMoveCount, movesSearched, move ); // step14 this->DoStep14( pos, move, st, ci, givesCheck, &pFlashlight ); // step15 this->DoStep15( rucksack, depth, isPVMove, captureOrPawnPromotion, move, ttMove, &pFlashlight, moveCount, cutNode, newDepth, alpha, &pSplitedNode, score, pos, doFullDepthSearch ); // step16 this->DoStep16b_NonPVAtukai( rucksack, doFullDepthSearch, score, newDepth, givesCheck, pos, &pFlashlight, alpha, cutNode ); this->DoStep16c(// 静止探索もするぜ☆(^q^) rucksack, isPVMove, alpha, score, beta, newDepth, givesCheck, pos, &pFlashlight ); // step17 this->DoStep17( pos, move ); assert(-ScoreInfinite < score && score < ScoreInfinite); // step18 if (rucksack.m_signals.m_stop || pThisThread->CutoffOccurred()) { return score; } this->DoStep18b( rucksack, move, isPVMove, alpha, score, pos ); bool isBreak = false; this->DoStep18c( isBreak, rucksack, move, isPVMove, alpha, score, pos, bestScore, &pSplitedNode, bestMove, beta ); if (isBreak) { break; } // step19 this->DoStep19( isBreak, rucksack, depth, &pThisThread, bestScore, beta, pos, &pFlashlight, alpha, bestMove, threatMove, moveCount, videodeck, cutNode ); if (isBreak) { break; } } if (this->GetReturnBeforeStep20()) { return bestScore; } // step20 this->DoStep20( moveCount, excludedMove, rucksack, alpha, &pFlashlight, bestScore, playedMoveCount, beta, posKey, depth, bestMove, inCheck, pos, movesSearched ); return bestScore; }