Exemplo n.º 1
0
void SummarizePlayer(int player_id) {
    for (int i = 0; i < player_database.size(); i++) {
        if (player_id == player_database[i].getId()) {
            cout << "" << endl;
            cout << "Player Name: " << getPlayerName(player_id) << endl;
            cout << "" << endl;
            cout << "  " << setw(20) << left << "Game Name" << setw(20) << left << "Game IGN" << endl;
            PrintGame(player_id);
            cout << "" << endl;
            PrintFriends(player_id);
            cout << "" << endl;
        }
    }
    cout << "Total gamer points: " << sumGamerPoints(player_id);
}
Exemplo n.º 2
0
void GameTree::PrintGame(FILE* f){
    int i;
    char pre[100];
    for(i=0;i<currDepth;i++) pre[i]=' ';
    sprintf(pre+i, "%3ld %2d", currIdx, currDepth);
    
    if(currIdx==0){
        fprintf(f,"Size=%zu\n",size);
        fprintf(f,"%s %d %d %0.1f\n",pre,MoveValue(),val,IsWin());
    }else{
        fprintf(f,"%s %d %d %0.1f\n",pre,MoveValue(),val,IsWin());
    }
    if(currDepth<depth)
        for(int i=0;i<breath;i++){
            DoMove(i);
            PrintGame(f);
            UndoMove();
        }
}