reset password
Author Message
rabbott
Posts: 1649
Posted 08:27 Oct 27, 2016 |

I realized last night that I hadn't explained my own code correctly. The value field is really the minimax value of that Game board. A minimax value is never unknown -- as long as it's computed. It always tells you the result of the game: 

  •  1 - X wins
  •  0 - tie game
  • -1 - O wins

So I changed the name of the field to minimaxValue and the type to Int, not Maybe Int.

The minimaxValue field is assigned in evaluate, which always gives it an Int value.

Last edited by rabbott at 08:31 Oct 27, 2016.