2023-07-11 20:28:07 +00:00
|
|
|
package chess
|
|
|
|
|
|
|
|
type Violation string
|
|
|
|
|
|
|
|
var (
|
2023-08-12 09:24:40 +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"
|
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
|
|
|
}
|