Skip to content

Commit 7561f7b

Browse files
committed
test added
test spec for minimax
1 parent 560a31f commit 7561f7b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package aima.core.search.adversarial
2+
3+
import aima.core.search.problems.{Player, State, Action, TwoPlyGame}
4+
import org.specs2.mutable.Specification
5+
6+
/**
7+
* @author Aditya Lahiri
8+
*/
9+
class TwoPlyMinimaxSearchSpec extends Specification {
10+
"The two-ply game " should {
11+
"should return action to state 1 from state 0" in {
12+
MinimaxDecision
13+
.minMaxDecision[Player, State, Action](TwoPlyGame, Action(-1))(TwoPlyGame.initialState, TwoPlyGame.Players(1))
14+
.stateNumber must beEqualTo(1) // Action(-1) denotes noAction
15+
}
16+
}
17+
}

0 commit comments

Comments
 (0)