2023-07-11 20:28:07 +00:00
|
|
|
package chess
|
|
|
|
|
|
|
|
type Violation string
|
|
|
|
|
|
|
|
var (
|
2024-04-09 17:26:48 +00:00
|
|
|
InvalidMove Violation = "invalid move"
|
|
|
|
NoPieceAtStartSquare Violation = "no piece at start square"
|
|
|
|
WrongColorMoved Violation = "wrong color moved"
|
|
|
|
TargetSquareIsOccupied Violation = "target square is occupied"
|
|
|
|
KingInCheck Violation = "king would be in check after move"
|
|
|
|
SomethingWentWrong Violation = "something went wrong"
|
|
|
|
CastlingThroughCheck Violation = "king would move through check"
|
|
|
|
CastlingWhileKingInCheck Violation = "king cannot castle while in check"
|
2024-05-10 00:29:11 +00:00
|
|
|
CastlingKingMovedBefore Violation = "king cannot caslte because he moved before"
|
2023-07-11 20:28:07 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func (v Violation) String() string {
|
2023-08-12 09:24:40 +00:00
|
|
|
return string(v)
|
2023-07-11 20:28:07 +00:00
|
|
|
}
|