Cody

Problem 45418. En passant - 01

Solution 2206964

Submitted on 12 Apr 2020 by bainhome
  • Size: 51
  • This is the leading solution.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
assert(isequal(en_passant('b2','c3'),1))

2   Pass
assert(isequal(en_passant('a2','a3'),1))

3   Pass
assert(isequal(en_passant('d3','d5'),0))

4   Pass
assert(isequal(en_passant('e5','d4'),0))

5   Pass
assert(isequal(en_passant('e5','c6'),0))

6   Pass
assert(isequal(en_passant('e5','d6'),1))

7   Pass
assert(isequal(en_passant('b2','b4'),1))

8   Pass
assert(isequal(en_passant('b2','c2'),0))

9   Pass
assert(isequal(en_passant('a1','a2'),0))

10   Pass
assert(isequal(en_passant('g7','g8'),1))

11   Pass
assert(isequal(en_passant('g7','g6'),0))

12   Pass
assert(isequal(en_passant('f5','h6'),0))

Suggested Problems

More from this Author149

Community Treasure Hunt

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

Start Hunting!