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
Solution Stats
Problem Comments
2 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers86
Suggested Problems
-
Project Euler: Problem 16, Sums of Digits of Powers of Two
181 Solvers
-
Sum of first n terms of a harmonic progression
517 Solvers
-
Get the elements of diagonal and antidiagonal for any m-by-n matrix
518 Solvers
-
Side of an equilateral triangle
7070 Solvers
-
Find my daddy long leg (No 's')
2812 Solvers
More from this Author39
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Hard !
This is a good problem, but it needs more test cases. There is no test with the King for instance, and there should be a true and false state test for every piece.