cpp: Add username to TODO comment

This commit is contained in:
Calcitem 2021-11-14 01:36:27 +08:00
parent aa1852b2cc
commit db72cf783c
No known key found for this signature in database
GPG Key ID: F67E4F8CB7B5EED2
13 changed files with 31 additions and 26 deletions

View File

@ -49,7 +49,7 @@
#define UCI_AUTO_RE_GO
#endif
// Play via network (TODO: Port to Qt 6)
// Play via network (TODO(calcitem): Port to Qt 6)
//#define NET_FIGHT_SUPPORT
/// Qt simple GUI like a mobile app (WIP)

View File

@ -136,7 +136,7 @@ Value Evaluation::value()
piece_on_board_count_future_white -= pos.piece_to_remove_count();
}
// TODO: flyPieceCount?
// TODO(calcitem): flyPieceCount?
if (piece_on_board_count_future_black == 3 || piece_on_board_count_future_white == 3) {
if (abs(value) < VALUE_KNOWN_WIN) {
value = VALUE_DRAW;

View File

@ -160,7 +160,7 @@ public:
void resize(size_t size)
{
// TODO: Resize
// TODO(calcitem): Resize
if (size < 0x1000000) {
// New size is too small, do not resize
return;

View File

@ -373,7 +373,7 @@ void mill_table_init()
void move_priority_list_shuffle()
{
if (gameOptions.getSkillLevel() == 1) {
for (auto i = 8; i < 32; i++) { // TODO: SQ_BEGIN & SQ_END
for (auto i = 8; i < 32; i++) { // TODO(calcitem): SQ_BEGIN & SQ_END
MoveList<LEGAL>::movePriorityList[i - int(SQ_BEGIN)] = (Square)i;
}
if (gameOptions.getShufflingEnabled()) {

View File

@ -64,7 +64,7 @@ void MovePicker::score()
ourMillsCount = pos.potential_mills_count(to, pos.side_to_move(), from);
#ifndef SORT_MOVE_WITHOUT_HUMAN_KNOWLEDGES
// TODO: rule.mayRemoveMultiple adapt other rules
// TODO(calcitem): rule.mayRemoveMultiple adapt other rules
if (type_of(m) != MOVETYPE_REMOVE) {
// all phrase, check if place sq can close mill
if (ourMillsCount > 0) {

View File

@ -620,7 +620,7 @@ bool Position::put_piece(Square s, bool updateRecord)
const Piece pc = board[s] = piece;
byTypeBB[ALL_PIECES] |= byTypeBB[type_of(pc)] |= s;
byColorBB[color_of(pc)] |= s; // TODO: Put ban?
byColorBB[color_of(pc)] |= s; // TODO(calcitem): Put ban?
update_key(s);
@ -805,7 +805,7 @@ bool Position::remove_piece(Square s, bool updateRecord)
Piece pc = board[s];
CLEAR_BIT(byTypeBB[type_of(pc)], s); // TODO: rule.hasBannedLocations and placing need?
CLEAR_BIT(byTypeBB[type_of(pc)], s); // TODO(calcitem): rule.hasBannedLocations and placing need?
CLEAR_BIT(byColorBB[color_of(pc)], s);
updateMobility(MOVETYPE_REMOVE, s);
@ -823,7 +823,7 @@ bool Position::remove_piece(Square s, bool updateRecord)
if (updateRecord) {
snprintf(record, RECORD_LEN_MAX, "-(%1u,%1u)", file_of(s), rank_of(s));
st.rule50 = 0; // TODO: Need to move out?
st.rule50 = 0; // TODO(calcitem): Need to move out?
}
pieceOnBoardCount[them]--;
@ -1011,7 +1011,7 @@ bool Position::check_if_game_is_over()
set_gameover(~sideToMove, GameOverReason::loseReasonNoWay);
return true;
} else {
change_side_to_move(); // TODO: Need?
change_side_to_move(); // TODO(calcitem): Need?
return false;
}
}
@ -1021,7 +1021,7 @@ bool Position::check_if_game_is_over()
int Position::calculate_mobility_diff()
{
// TODO: Deal with rule is no ban location
// TODO(calcitem): Deal with rule is no ban location
int mobilityWhite = 0;
int mobilityBlack = 0;

View File

@ -21,7 +21,6 @@
using Eval::evaluate;
using std::string;
using namespace Search;
Value MTDF(Position* pos, Sanmill::Stack<Position>& ss, Value firstguess, Depth depth, Depth originDepth, Move& bestMove);
@ -117,7 +116,7 @@ int Thread::search()
MoveList<LEGAL>::shuffle();
#if 0
// TODO: Only NMM
// TODO(calcitem): Only NMM
if (rootPos->piece_on_board_count(WHITE) + rootPos->piece_on_board_count(BLACK) <= 1 &&
!rule.hasDiagonalLines && gameOptions.getShufflingEnabled()) {
const uint32_t seed = static_cast<uint32_t>(now());
@ -301,8 +300,8 @@ Value qsearch(Position* pos, Sanmill::Stack<Position>& ss, Depth depth, Depth or
// process leaves
// Check for aborted search
// TODO: and immediate draw
if (unlikely(pos->phase == Phase::gameOver) || // TODO: Deal with hash
// TODO(calcitem): and immediate draw
if (unlikely(pos->phase == Phase::gameOver) || // TODO(calcitem): Deal with hash
depth <= 0 || Threads.stop.load(std::memory_order_relaxed)) {
bestValue = Eval::evaluate(*pos);
@ -337,10 +336,10 @@ Value qsearch(Position* pos, Sanmill::Stack<Position>& ss, Depth depth, Depth or
}
#if 0
// TODO: Weak
// TODO(calcitem): Weak
if (bestMove != MOVE_NONE) {
for (int i = 0; i < moveCount; i++) {
if (mp.moves[i].move == bestMove) { // TODO: need to write value?
if (mp.moves[i].move == bestMove) { // TODO(calcitem): need to write value?
std::swap(mp.moves[0], mp.moves[i]);
break;
}

View File

@ -83,7 +83,7 @@ Thread::~Thread()
void Thread::clear() noexcept
{
// TODO: Reset histories
// TODO(calcitem): Reset histories
return;
}
@ -428,7 +428,7 @@ string Thread::next_move()
if (bestvalue <= -VALUE_KNOWN_WIN) {
Endgame endgame;
endgame.type = rootPos->side_to_move() == WHITE ? EndGameType::blackWin : EndGameType::whiteWin;
Key endgameHash = rootPos->key(); // TODO: Do not generate hash repeatedly
Key endgameHash = rootPos->key(); // TODO(calcitem): Do not generate hash repeatedly
saveEndgameHash(endgameHash, endgame);
}
}

View File

@ -25,7 +25,13 @@
#include "command_channel.h"
#endif
using namespace std;
using std::cin;
using std::istream;
using std::istringstream;
using std::skipws;
using std::string;
using std::stringstream;
using std::vector;
extern vector<string> setup_bench(Position*, istream&);
@ -78,7 +84,7 @@ void position(Position* pos, istringstream& is)
}
}
// TODO: Stockfish does not have this
// TODO(calcitem): Stockfish does not have this
Threads.main()->us = pos->sideToMove;
}

View File

@ -73,7 +73,7 @@ private:
QDataStream in;
QString currentAction;
// TODO: 'QNetworkSession': was declared deprecated
// TODO(calcitem): 'QNetworkSession': was declared deprecated
QNetworkSession* networkSession = nullptr;
uint16_t port {};

View File

@ -95,7 +95,7 @@ Game::Game(
#endif // QT_GUI_LIB
#ifdef NET_FIGHT_SUPPORT
server = new Server(nullptr, 30001); // TODO: WARNING: ThreadSanitizer: data race
server = new Server(nullptr, 30001); // TODO(calcitem): WARNING: ThreadSanitizer: data race
uint16_t clientPort = server->getPort() == 30001 ? 30002 : 30001;
client = new Client(nullptr, clientPort);
@ -367,7 +367,7 @@ void Game::setInvert(bool arg)
}
}
void Game::setRule(int ruleNo, int stepLimited /*= -1*/, int timeLimited /*= 0 TODO: Unused */)
void Game::setRule(int ruleNo, int stepLimited /*= -1*/, int timeLimited /*= 0 TODO(calcitem): Unused */)
{
rule.nMoveRule = stepLimited;

View File

@ -550,7 +550,7 @@ void MillGameWindow::on_actionLimited_T_triggered()
label_step->setText(tr("N-Move Rule:"));
// TODO: Save settings
// TODO(calcitem): Save settings
//comboBox_step->addItem(tr("Infinite"), 0);
comboBox_step->addItem(tr("10 Moves"), 10);
comboBox_step->addItem(tr("30 Moves"), 30);
@ -587,7 +587,7 @@ void MillGameWindow::on_actionLimited_T_triggered()
int dStep = comboBox_step->currentData().toInt();
int dTime = comboBox_time->currentData().toInt();
if (gStep != dStep || gTime != dTime) {
game->setRule(ruleNo, static_cast<int>(dStep), dTime); // TODO: Remove dTime
game->setRule(ruleNo, static_cast<int>(dStep), dTime); // TODO(calcitem): Remove dTime
game->setMoveTime(dTime);
}
}

View File

@ -159,7 +159,7 @@ void Server::sessionOpened()
void Server::setAction(const QString& a)
{
// TODO: WAR
// TODO(calcitem): WAR
if (actions.size() > 256) {
while (!actions.empty()) {
actions.pop();