7.5

### 1Chess Pieces and Colors

 (require chess/piece) package: chess

A chess piece is a pawn, knight, bishop, rook, queen, or king. They come in two flavors:

• A colored chess piece is a piece associated with a particular player, such as a white bishop or a black king.

• An uncolored chess piece isn’t associated with any player, and only represents a type of piece.

 procedure v : any/c
A predicate for chess pieces.

#### 1.1Uncolored Chess Pieces

 procedure v : any/c
A predicate for uncolored chess pieces. Implies chess-piece?.

 value
 value
 value
 value
 value
 value
Constants representing uncolored chess pieces.

 value
An immutable set of all possible uncolored chess pieces.

#### 1.2Colored Chess Pieces

 procedure v : any/c
A predicate for colored chess pieces. Implies chess-piece?.

 value
 value
 value
 value
 value
 value
 value
 value
 value
 value
 value
 value
Constants representing colored chess pieces.

procedure

 (colored-chess-piece #:type type #:owner owner) → colored-chess-piece?
type : uncolored-chess-piece?
owner : chess-color?
Returns the colored chess piece corresponding to a type piece with owner as its color.

Example:
 > (colored-chess-piece #:type pawn #:owner white) (colored-chess-piece #:owner # #:type #)

 procedure piece : colored-chess-piece?
Returns the type of piece, as an uncolored chess piece.

Example:
 > (colored-chess-piece-type black-knight) #

 procedure piece : colored-chess-piece?
Returns the chess color that owns piece.

Example:
 > (colored-chess-piece-owner white-queen) #

 value
An immutable set of all possible colored chess pieces.

#### 1.3Chess Colors

A chess color is either white or black.

 procedure v : any/c
A predicate for chess colors.

 value
 value
Constants representing the two chess colors.