Created
November 21, 2016 12:57
-
-
Save semanticer/161c6082bee078104e543a94efe26ece to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object MockMiniMax { | |
def mockEval(state: MockState): Int = state match { | |
case MockState(List(false,false,false,false)) => 8 | |
case MockState(List(true,false,false,false)) => 7 | |
case MockState(List(false,true,false,false)) => 3 | |
case MockState(List(true,true,false,false)) => 9 | |
case MockState(List(false,false,true,false)) => 9 | |
case MockState(List(true,false,true,false)) => 8 | |
case MockState(List(false,true,true,false)) => 2 | |
case MockState(List(true,true,true,false)) => 4 | |
case MockState(List(false,false,false,true)) => 1 | |
case MockState(List(true,false,false,true)) => 8 | |
case MockState(List(false,true,false,true)) => 8 | |
case MockState(List(true,true,false,true)) => 9 | |
case MockState(List(false,false,true,true)) => 9 | |
case MockState(List(true,false,true,true)) => 9 | |
case MockState(List(false,true,true,true)) => 3 | |
case MockState(List(true,true,true,true)) => 4 | |
case _ => throw new IllegalArgumentException("No eval for this state") | |
} | |
} | |
case class MockState(road: List[Boolean]) { | |
def nextStates(): List[MockState] = List(MockState(false::road), MockState(true::road)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment