MCPcopy Create free account
hub / github.com/XMuli/ChineseChess / getPositionScore

Function getPositionScore

MachineGame.cpp:156–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154};
155
156static 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
170int MachineGame::calcScore()
171{

Callers 1

calcScoreMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected