* @param [in] block * @return Values of cells in block, starting with bottom cell in block. */
| 465 | * @return Values of cells in block, starting with bottom cell in block. |
| 466 | */ |
| 467 | static inline vector<int> getBlockCellValues(const Block block) { |
| 468 | vector<int> scores(WORD_SIZE); |
| 469 | int score = block.score; |
| 470 | Word mask = HIGH_BIT_MASK; |
| 471 | for (int i = 0; i < WORD_SIZE - 1; i++) { |
| 472 | scores[i] = score; |
| 473 | if (block.P & mask) score--; |
| 474 | if (block.M & mask) score++; |
| 475 | mask >>= 1; |
| 476 | } |
| 477 | scores[WORD_SIZE - 1] = score; |
| 478 | return scores; |
| 479 | } |
| 480 | |
| 481 | /** |
| 482 | * Writes values of cells in block into given array, starting with first/top cell. |
no outgoing calls
no test coverage detected