alpha_beta.c
changeset 87 b2f1756c17ca
parent 77 49e0babccb23
child 96 810acedf60d8
equal deleted inserted replaced
86:86b83a979d9e 87:b2f1756c17ca
    72     }
    72     }
    73 
    73 
    74     board[stack_end->data->target] = EMPTY;
    74     board[stack_end->data->target] = EMPTY;
    75 
    75 
    76     actual = stack_end->prev;
    76     actual = stack_end->prev;
       
    77     free (stack_end->data);
    77     free (stack_end);
    78     free (stack_end);
    78 
    79 
    79     stack_end = actual;
    80     stack_end = actual;
    80 }
    81 }
    81 
    82 
   338 
   339 
   339         board[bestMove->target] = 'O';
   340         board[bestMove->target] = 'O';
   340         print ();
   341         print ();
   341 
   342 
   342         if ((estimateFunction () * estimateFunction ()) == 2500) {
   343         if ((estimateFunction () * estimateFunction ()) == 2500) {
       
   344             free (actual);
   343             return EXIT_SUCCESS;
   345             return EXIT_SUCCESS;
   344         }
   346         }
   345 
   347 
   346         if (game_over ())
   348         if (game_over ())
   347             break;
   349             break;
   348     }
   350     }
   349 
   351 
   350     print ();
   352     print ();
       
   353     free (actual);
   351 
   354 
   352     return EXIT_SUCCESS;
   355     return EXIT_SUCCESS;
   353 }
   356 }