isValidMove

fun isValidMove(board: Board, myPiece: Piece): Boolean

Checks if placing a piece at the specified coordinates is a valid move. A move is considered valid if it results in capturing at least one of the opponent's pieces.

Return

True if the move is valid, false otherwise.

Parameters

board

The current state of the board.

myPiece

The piece being placed on the board.

Throws

if the position is out of bounds