fix analysis near end floating point

This commit is contained in:
Thibault Duplessis 2013-06-03 01:34:18 +02:00
parent 454d3817da
commit 0ff0b1110d
2 changed files with 2 additions and 3 deletions

View file

@ -26,7 +26,7 @@ private[analyse] final class AdvantageChart(advices: InfoAdvices) {
case (_, Some(mate)) Json.arr(move(info, advice), {
val mateDelta = math.abs(mate.toFloat / 100)
val whiteWins = info.color.fold(mate < 0, mate > 0)
scale(whiteWins.fold(max - mateDelta, mateDelta - max))
scale(whiteWins.fold(max - mateDelta, mateDelta - max)).toString
})
case _ Json.arr(move(info, none), scale(0))
}

3
todo
View file

@ -60,8 +60,7 @@ the forum search user:mephostophilis returns no result
check team average elo http://en.lichess.org/inbox/benuegti#bottom
if game ends during move -> bug
LilaError['[analysis] fred65 already analyses ueogn4fr, won't process ueogn4fr']
unload event http://en.lichess.org/forum/redirect/post/lnsqfhli
-> only rated games
challenge friends
---