commit aa543b55bafa48fee8bf51d7276800393efa8802
parent d31d755055ba94255b776c0a4571885485b50fe8
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Mon, 12 Jun 2023 10:07:51 -0700
fix colors
Diffstat:
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/pkg/web/handlers/interceptors/chess.go b/pkg/web/handlers/interceptors/chess.go
@@ -634,28 +634,28 @@ func CalcAdvantage(position *chess.Position) (string, string) {
diff := m[chess.WhiteQueen] - m[chess.BlackQueen]
whiteScore += diff * 9
blackScore += -diff * 9
- whiteAdvantage += strings.Repeat("♕", utils.MaxInt(diff, 0))
- blackAdvantage += strings.Repeat("♛", utils.MaxInt(-diff, 0))
+ whiteAdvantage += strings.Repeat("♛", utils.MaxInt(diff, 0))
+ blackAdvantage += strings.Repeat("♕", utils.MaxInt(-diff, 0))
diff = m[chess.WhiteRook] - m[chess.BlackRook]
whiteScore += diff * 5
blackScore += -diff * 5
- whiteAdvantage += strings.Repeat("♖", utils.MaxInt(diff, 0))
- blackAdvantage += strings.Repeat("♜", utils.MaxInt(-diff, 0))
+ whiteAdvantage += strings.Repeat("♜", utils.MaxInt(diff, 0))
+ blackAdvantage += strings.Repeat("♖", utils.MaxInt(-diff, 0))
diff = m[chess.WhiteBishop] - m[chess.BlackBishop]
whiteScore += diff * 3
blackScore += -diff * 3
- whiteAdvantage += strings.Repeat("♗", utils.MaxInt(diff, 0))
- blackAdvantage += strings.Repeat("♝", utils.MaxInt(-diff, 0))
+ whiteAdvantage += strings.Repeat("♝", utils.MaxInt(diff, 0))
+ blackAdvantage += strings.Repeat("♗", utils.MaxInt(-diff, 0))
diff = m[chess.WhiteKnight] - m[chess.BlackKnight]
whiteScore += diff * 3
blackScore += -diff * 3
- whiteAdvantage += strings.Repeat("♘", utils.MaxInt(diff, 0))
- blackAdvantage += strings.Repeat("♞", utils.MaxInt(-diff, 0))
+ whiteAdvantage += strings.Repeat("♞", utils.MaxInt(diff, 0))
+ blackAdvantage += strings.Repeat("♘", utils.MaxInt(-diff, 0))
diff = m[chess.WhitePawn] - m[chess.BlackPawn]
whiteScore += diff * 1
blackScore += -diff * 1
- whiteAdvantage += strings.Repeat("♙", utils.MaxInt(diff, 0))
- blackAdvantage += strings.Repeat("♟", utils.MaxInt(-diff, 0))
+ whiteAdvantage += strings.Repeat("♟", utils.MaxInt(diff, 0))
+ blackAdvantage += strings.Repeat("♙", utils.MaxInt(-diff, 0))
if whiteScore > 0 {
whiteAdvantage += fmt.Sprintf("+%d", whiteScore)
}