Last active
September 11, 2018 18:37
-
-
Save dschinkel/73b06251a85316d709533d00a4834558 to your computer and use it in GitHub Desktop.
miniMax Algorithm in Elm - Tests - next move wins for row 2
This file contains 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
nextBestMove gameNode = | |
let | |
cells = | |
fromList gameNode | |
nextGameState1 = | |
set 2 'X' cells | |
nextGameState2 = | |
set 5 'X' cells | |
in | |
if (get 0 nextGameState1 == get 1 nextGameState1) && (get 1 nextGameState1 == get 2 nextGameState1) then | |
2 | |
else if (get 3 nextGameState2 == get 4 nextGameState2) && (get 4 nextGameState2 == get 5 nextGameState2) then | |
5 | |
else | |
0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment