Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmsilva committed Sep 23, 2016
1 parent 4a2fd4a commit a5b8ac2
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions domino.c
Original file line number Diff line number Diff line change
Expand Up @@ -836,28 +836,28 @@ void bot_ia(piece **bot, piece **table, piece **lot,bool *comprar,bool *player_t
num[l->right]++;
}
// JOGANDO TRANCANDO O PLAYER //
for(i=0;i<7;i++)
if((num[i] > 3) && !(*player_turn))
for(l=*bot;l!=NULL;l=l->prox)
if(!(*player_turn) && ((l->left == i) || (l->right == i)))
{
if((first != NULL) && (first->left == i))
{
*player_turn = true;
if((first != NULL) && (first->left == l->left))
inverter_info(&l);
trocar(table,bot,l->left,l->right,true);
break;
}
else if((last != NULL) && (last->right == i))
{
*player_turn = true;
if((last != NULL) && (last->right == l->right))
inverter_info(&l);
trocar(table,bot,l->left,l->right,false);
break;
}
}
for(i=6;i<=0;i++)
if((num[i] > 3) && !(*player_turn))
for(l=*bot;l!=NULL;l=l->prox)
if(!(*player_turn) && ((l->left == i) || (l->right == i)))
{
if((first != NULL) && (first->left == i))
{
*player_turn = true;
if((first != NULL) && (first->left == l->left))
inverter_info(&l);
trocar(table,bot,l->left,l->right,true);
break;
}
else if((last != NULL) && (last->right == i))
{
*player_turn = true;
if((last != NULL) && (last->right == l->right))
inverter_info(&l);
trocar(table,bot,l->left,l->right,false);
break;
}
}
// JOGANDO NORMAL //
//jogando as buchas primeiro //
if(!(*player_turn))
Expand Down

0 comments on commit a5b8ac2

Please sign in to comment.