Skip to content

Commit

Permalink
Add missing moves in toUCI
Browse files Browse the repository at this point in the history
Change-type: patch
Signed-off-by: Giovanni Garufi <[email protected]>
  • Loading branch information
nazrhom committed Jan 13, 2021
1 parent b2926e6 commit e6f5cd3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Board.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ data Move = Move Position Position | Castle Colour CastleType | Promote Position

toUCI :: Move -> String
toUCI (Move (sCol, sRow) (dCol, dRow)) = (map toLower $ show sCol) ++ (show sRow) ++ (map toLower $ show dCol) ++ (show dRow)
toUCI (Castle White Short) = "e1g1"
toUCI (Castle White Long) = "e1c8"
toUCI (Castle Black Short) = "e8g8"
toUCI (Castle Black Long) = "e8c8"
toUCI (Promote (sCol, sRow) pty) = (map toLower $ show sCol) ++ show sRow ++ (map toLower $ show sCol) ++ show (sRow + 1) ++ show pty


newtype Board = Board (V.Vector (Maybe Piece))

Expand Down

0 comments on commit e6f5cd3

Please sign in to comment.