group3.c
void g3_backpropogate(g3_MCnode **nodeStack, int *moveStack, int s, int w) {
    // Empty out the stack
    while (s >= 0) {
        int move = moveStack[s];
        nodeStack[s]->scores[move].n_i += 1; // Add 1 to the number of games played
        nodeStack[s]->scores[move].w_i += w; // Add a win if we won
        s--;
    }
}
// Backpropogate the result of a win
Backpropogate the result of a win
Backpropogate the result of a win
void g3_backpropogate(g3_MCnode **nodeStack, int *moveStack, int s, int w) {
    while (s >= 0) {
        int move = moveStack[s];
        nodeStack[s]->scores[move].n_i += 1; 
        nodeStack[s]->scores[move].w_i += w; 
        s--;
    }
}
void g3_backpropogate ( g3_MCnode * * nodeStack , int * moveStack , int s , int w ) { while ( s >= 0 ) { int move = moveStack [ s ] ; nodeStack [ s ] -> scores [ move ] . n_i += 1 ; nodeStack [ s ] -> scores [ move ] . w_i += w ; s -- ; } }
Backpropogate the result of a win
Backpropogate the result of a win
// Empty out the stack // Add 1 to the number of games played // Add a win if we won