Skip to content
This repository was archived by the owner on Apr 26, 2025. It is now read-only.

Commit 50708c0

Browse files
Add files via upload
1 parent 5d74284 commit 50708c0

File tree

1 file changed

+22
-19
lines changed

1 file changed

+22
-19
lines changed

mayhem.hpp

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1711,14 +1711,16 @@ struct Evaluation {
17111711

17121712
void bonus_knbk_w() {
17131713
this->score += 2 * CloseBonus(this->wk, this->bk) +
1714-
10 * ((g_board->white[2] & 0xaa55aa55aa55aa55ULL) ? std::max(CloseBonus(0, this->bk), CloseBonus(63, this->bk)) :
1715-
std::max(CloseBonus(7, this->bk), CloseBonus(56, this->bk)));
1714+
10 * ((g_board->white[2] & 0xaa55aa55aa55aa55ULL) ?
1715+
std::max(CloseBonus(0, this->bk), CloseBonus(63, this->bk)) :
1716+
std::max(CloseBonus(7, this->bk), CloseBonus(56, this->bk)));
17161717
}
17171718

17181719
void bonus_knbk_b() {
17191720
this->score -= 2 * CloseBonus(this->wk, this->bk) +
1720-
10 * ((g_board->black[2] & 0xaa55aa55aa55aa55ULL) ? std::max(CloseBonus(0, this->wk), CloseBonus(63, this->wk)) :
1721-
std::max(CloseBonus(7, this->wk), CloseBonus(56, this->wk)));
1721+
10 * ((g_board->black[2] & 0xaa55aa55aa55aa55ULL) ?
1722+
std::max(CloseBonus(0, this->wk), CloseBonus(63, this->wk)) :
1723+
std::max(CloseBonus(7, this->wk), CloseBonus(56, this->wk)));
17221724
}
17231725

17241726
Evaluation* bonus_tempo() {
@@ -1961,7 +1963,9 @@ void SetMoveAndPv(const int ply, const int move_i) {
19611963
}
19621964

19631965
int CalcLMR(const int depth, const int move_i) {
1964-
return depth <= 0 || move_i <= 0 ? 1 : std::clamp<int>(0.25 * std::log(depth) * std::log(move_i), 1, 6);
1966+
return depth <= 0 || move_i <= 0 ?
1967+
1 :
1968+
std::clamp<int>(0.25 * std::log(depth) * std::log(move_i), 1, 6);
19651969
}
19661970

19671971
// a >= b -> Minimizer won't pick any better move anyway.
@@ -2386,14 +2390,13 @@ void UciPosition() {
23862390
}
23872391

23882392
void UciSetoption() {
2389-
if (TokenPeek("name") && TokenPeek("value", 2)) {
2390-
if ( TokenPeek("UCI_Chess960", 1)) { g_chess960 = TokenPeek("true", 3); }
2391-
else if (TokenPeek("Hash", 1)) { SetHashtable(TokenNumber(3)); }
2392-
else if (TokenPeek("Level", 1)) { g_level = std::clamp(TokenNumber(3), 0, 100); }
2393-
else if (TokenPeek("MoveOverhead", 1)) { g_move_overhead = std::clamp(TokenNumber(3), 0, 10000); }
2394-
else if (TokenPeek("EvalFile", 1)) { SetNNUE(TokenNth(3)); }
2395-
else if (TokenPeek("BookFile", 1)) { SetBook(TokenNth(3)); }
2396-
}
2393+
if (!TokenPeek("name") || !TokenPeek("value", 2)) return;
2394+
if ( TokenPeek("UCI_Chess960", 1)) g_chess960 = TokenPeek("true", 3);
2395+
else if (TokenPeek("Hash", 1)) SetHashtable(TokenNumber(3));
2396+
else if (TokenPeek("Level", 1)) g_level = std::clamp(TokenNumber(3), 0, 100);
2397+
else if (TokenPeek("MoveOverhead", 1)) g_move_overhead = std::clamp(TokenNumber(3), 0, 10000);
2398+
else if (TokenPeek("EvalFile", 1)) SetNNUE(TokenNth(3));
2399+
else if (TokenPeek("BookFile", 1)) SetBook(TokenNth(3));
23972400
}
23982401

23992402
void PrintBestMove() {
@@ -2508,8 +2511,8 @@ void UciPerft(const std::string &depth2, const std::string &fen) {
25082511
// > bench
25092512
// Result: 60 / 60
25102513
// Nodes: 241185678
2511-
// Time(ms): 17027
2512-
// NPS: 14164895
2514+
// Time(ms): 16914
2515+
// NPS: 14259529
25132516
// > bench inf 10000
25142517
// Result: 60 / 60
25152518
// Nodes: 7565765060
@@ -2574,12 +2577,12 @@ void UciHelp() {
25742577
"go wtime [int] btime [int] winc [int] binc [int] ...\n" <<
25752578
" movestogo [int] movetime [int] depth [int] [infinite]\n" <<
25762579
" Search the current position with the provided settings\n\n" <<
2577-
"p [fen]\n Print ASCII art board\n\n" <<
2578-
"position [startpos | fen] [moves]?\n" <<
2580+
"p [fen = startpos]\n Print ASCII art board\n\n" <<
2581+
"position [startpos | fen] [moves]\n" <<
25792582
" Sets the board position via an optional FEN and optional move list\n\n" <<
2580-
"perft [depth] [fen]\n" <<
2583+
"perft [depth = 6] [fen = startpos]\n" <<
25812584
" Calculate perft split numbers\n\n" <<
2582-
"bench [depth] [time]\n" <<
2585+
"bench [depth = 14] [time = inf]\n" <<
25832586
" Bench signature and speed of the program" << std::endl;
25842587
}
25852588

0 commit comments

Comments
 (0)