Using standard Algebraic notation ('' for a pawn), given previous move and a next move, output true if it is a valid move or false otherwise. Assume there are no other pieces on the chess board, that the piece can be either black or white (whichever generates a valid result) and the previous move was valid. Examples:
Moving a pawn one space: ('c5','c6') -> true
Moving a bishop non-diagonally: ('Bb7','Bd7') -> false
Hard !
this doesn't take into account captures or moving a pawn 2 moves from its starting position. should it?
and the occasional other weird rules...
Captures and pawn 2 moves and castling and such aren't possible based upon the assumptions I stated (i.e. no other pieces on the board, the previous move was valid, etc)
Matrix indexing with two vectors of indices
406 Solvers
692 Solvers
357 Solvers
141 Solvers
477 Solvers