Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!

Problem 315. Valid Chess Moves

Created by Alan Chalker

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


Problem Group

Solution Statistics

34 correct solutions 17 incorrect solutions
Last solution submitted on Aug 07, 2015

Problem Comments

Solution Comments