Valid Chess Moves - MATLAB Cody - MATLAB Central

Problem 315. Valid Chess Moves

Difficulty:Rate
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

29.55% Correct | 70.45% Incorrect
Last Solution submitted on Mar 24, 2025

Problem Comments

Solution Comments

Show comments
PIVlab surpasses 100K all-time File Exchange downloads
During the past twelve months, PIVlab, a MATLAB Community Toolbox for particle...
2
4
LLMs with MATLAB updated to support the latest OpenAI Models
Large Languge model with MATLAB, a free add-on that lets you access...
2
4

Problem Recent Solvers76

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Go to top of page