Permalink
Browse files

[fix] strategy level actions of p2 should be reset

  • Loading branch information...
1 parent 47afa62 commit c15b79ec735965ed6d98a94ae30e1bbd84431f56 Mathieu Barbin committed Jul 22, 2011
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/ia.opa
View
@@ -165,10 +165,13 @@ IA_Forced = {{
win = IA_Winning.compute(grid, win)
forced =
match IA_Winning.victory(grid, win, actions, p) with
- | { some = _ } as some -> some
+ | { some = block } as some ->
+ do jlog("force: this force the other to block me in {block}")
+ some
| { none } ->
// a forced may be if anti_victory is a singleton
- anti = IA_Winning.anti_victory(grid, win, actions, p2)
+ p2_actions = GameRules.actions(grid)
+ anti = IA_Winning.anti_victory(grid, win, p2_actions, p2)
ColSet.is_singleton(anti)
match forced with
| {none} ->
@@ -196,6 +199,7 @@ IA_Forced = {{
// the force strategy should be computed in non victory choices
// or in a force place
actions =
+ actions = GameRules.actions(grid)
match IA_Winning.victory(grid, win, actions, p2) with
| { some = p2_force } ->
ColSet.singleton(p2_force)

0 comments on commit c15b79e

Please sign in to comment.