Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
danilofaria committed Apr 30, 2015
1 parent e24ff1a commit 194ad80
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions main.cpp
Expand Up @@ -290,8 +290,10 @@ int minmax(int current_table[N_ROWS][N_COLUMNS], int origin_is_max){
}

int value = 0;
if (lose) value = -1;
if (!is_max) value = -value;
if (lose)
value = -1;
if (!is_max)
value = -value;
if (all_children_accounted_for)
value = current_state.node_value;

Expand All @@ -306,7 +308,8 @@ int minmax(int current_table[N_ROWS][N_COLUMNS], int origin_is_max){
if (parent_value > value){

s.data[parent_index].node_value = value;
best_move = current_move;
if(current_depth == 1)
best_move = current_move;

if (parents_parent_index != -1){
int alpha = s.data[parents_parent_index].node_value;
Expand All @@ -324,7 +327,8 @@ int minmax(int current_table[N_ROWS][N_COLUMNS], int origin_is_max){
if (parent_value < value){

s.data[parent_index].node_value = value;
best_move = current_move;
if(current_depth == 1)
best_move = current_move;

if (parents_parent_index != -1){
int beta = s.data[parents_parent_index].node_value;
Expand Down

0 comments on commit 194ad80

Please sign in to comment.