findAround

fun findAround(board: Board, myPiece: Piece, findThis: PieceType?): List<Coordinate>

Finds all coordinates with 1 cell distance from the given piece that contain the specified type of piece.

Return

A list of coordinates where the specified type of piece is found around the given piece.

Parameters

board

The current state of the board.

myPiece

The piece around which to search.

findThis

The type of piece to search for. If null, it will find empty spaces.

Throws

if the position is out of bounds.