En passant - 01 - MATLAB Cody - MATLAB Central

Problem 45418. En passant - 01

Difficulty:Rate

This is white's turn. The player moves his pawn.

The pawn's previous and current positions are given.

Determine whether the move was valid.

 pawn's previous pos = 'b2'
 pawn's previous pos = 'c3'

So this is a valid move provided there was an opponent piece on c3.

But for now, just check the validity of the move. Opponent's pieces will be added in the next problem.

https://en.wikipedia.org/wiki/Chess#Movement

Solution Stats

23.29% Correct | 76.71% Incorrect
Last Solution submitted on Mar 29, 2024

Problem Comments

Solution Comments

Show comments
R2025a Pre-release highlights
This topic is for discussing highlights to the current R2025a Pre-release.
13
5

Problem Recent Solvers15

Suggested Problems

More from this Author165

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