| 154 | }; |
| 155 | |
| 156 | static int getPositionScore(int type, int row, int col, bool isRed) |
| 157 | { |
| 158 | // 红方棋子翻转行坐标 |
| 159 | int r = isRed ? (9 - row) : row; |
| 160 | int c = isRed ? (8 - col) : col; |
| 161 | switch (type) { |
| 162 | case 3: return posMA[r][c]; // MA |
| 163 | case 4: return posCHE[r][c]; // CHE |
| 164 | case 5: return posPAO[r][c]; // PAO |
| 165 | case 6: return posBING[r][c]; // BING |
| 166 | default: return 0; |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | int MachineGame::calcScore() |
| 171 | { |