int getHeuristic(GameState* gs, int player, int other_player) { int toR = 0; int x, y; for (x = 0; x < gs->width; x++) { for (y = 0; y < gs->height; y++) { toR += countAt(gs, x, y, player); toR -= countAt(gs, x, y, other_player); } } return toR; }
void AMBeamlineParallelActionsList::puke(){ AMBeamlineNumberAction *nAction; QString stageString, tmpStr; for(int x = 0; x < stageCount(); x++){ stageString = ""; for(int y = 0; y < countAt(x); y++){ if((nAction = qobject_cast<AMBeamlineNumberAction*>(action(x, y)))) tmpStr.setNum(nAction->getNumber()); else tmpStr.setNum( qint64(action(x,y)) ); stageString.append(tmpStr+" "); } if(x != stageCount()-1) stageString.append("--V"); // qdebug() << stageString; } }
int AMBeamlineParallelActionsList::count(){ int totalActions = 0; for(int x = 0; x < stageCount(); x++) totalActions += countAt(x); return totalActions; }