in csrc/BotUtils.cc [256:288]
void FactorizedBeliefs::updateFromHint(const Move &move, const Hanabi::CardIndices &card_indices, const Server &server) {
handSize = server.sizeOfHandOfPlayer(p_);
assert(move.type == HINT_COLOR || move.type == HINT_VALUE);
for (int j = 0; j < 25; j++) {
Card card = indexToCard(j);
int card_value = move.type == HINT_COLOR ? (int) card.color : (int) card.value;
bool matches = card_value == move.value;
for (int i = 0; i < handSize; i++) {
bool consistent = card_indices.contains(i) ? matches : !matches;
if (!consistent) {
counts[i].set(j, 0);
}
}
}
if (move.type == HINT_COLOR) {
for (int i = 0; i < handSize; ++i) {
if (card_indices.contains(i)) {
colorRevealed.set(i*5 + (int) move.value, 1);
assert(checkSum(colorRevealed, i, 1));
}
}
} else {
int rank = (int) move.value - 1;
assert(rank >= 0 && rank < 5);
for (int i = 0; i < handSize; ++i) {
if (card_indices.contains(i)) {
rankRevealed.set(i*5 + rank, 1);
assert(checkSum(rankRevealed, i, 1));
}
}
}
}