6 kyu

Covered pawns

181 of 305mdandre

Description:

Given a list of white pawns on a chessboard (any number of them, meaning from 0 to 64 and with the possibility to be positioned everywhere), determine how many of them have their backs covered by another. Pawns attacking upwards since we have only white ones.

Please remember that a pawn attack(and defend as well) only the 2 square on the sides in front of him. https://en.wikipedia.org/wiki/Pawn_(chess)#/media/File:Pawn_(chess)_movements.gif

This is how the chess board coordinates are defined:

ABCDEFGH
8
7
6
5
4
3
2
1
Fundamentals

More By Author:

Check out these other kata created by mdandre

Stats:

CreatedJul 29, 2017
PublishedJul 29, 2017
Warriors Trained906
Total Skips11
Total Code Submissions2130
Total Times Completed305
Python Completions181
JavaScript Completions111
Ruby Completions30
Total Stars14
% of votes with a positive feedback rating88% of 85
Total "Very Satisfied" Votes66
Total "Somewhat Satisfied" Votes17
Total "Not Satisfied" Votes2
Total Rank Assessments6
Average Assessed Rank
6 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • mdandre Avatar
  • Blind4Basics Avatar
  • FArekkusu Avatar
Ad