getCapturablePieces

fun getCapturablePieces(board: Board, myPiece: Piece, direction: Coordinate): List<Coordinate>

Gets a list of capturable pieces in a specified direction from the given piece. A piece is considered capturable if it is of the opposite type and is followed by a piece of the same type as myPiece in the specified direction.

Return

A list of coordinates of capturable pieces in the specified direction.

Parameters

board

The current state of the board.

myPiece

The piece being placed on the board.

direction

The direction to check in (should be one of the 8 possible directions).

Throws

if the position is out of bounds