halma/src/Game/Halma/AI/Competitive.hs
Use guards Open
Open
go (Just (currentMax, bestMove)) (option@(rating, move):options) =
if isWin rating then
option
else if newRating <= currentMax then
go (Just (currentMax, bestMove)) options
- Read upRead up
- Exclude checks
Found
go (Just (currentMax, bestMove)) (option@(rating, move) : options)
= if isWin rating then option else
if newRating <= currentMax then
go (Just (currentMax, bestMove)) options else
if boundReached newRating then (newRating, move) else
go (Just (newRating, move)) options
where newRating = fst $ nextLevel option (Just currentMax)
Perhaps
go (Just (currentMax, bestMove)) (option@(rating, move) : options)
| isWin rating = option
| newRating <= currentMax =
go (Just (currentMax, bestMove)) options
| boundReached newRating = (newRating, move)
| otherwise = go (Just (newRating, move)) options
where newRating = fst $ nextLevel option (Just currentMax)