• Pawn brotherhood - count


I would like to give some feedback about ...

From: http://www.checkio.org/mission/pawn-brotherhood/solve/


Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.155 Safari/537.36


In reading the directions the problem states: A pawn is safe if another pawn can capture a unit on that square.

Pawn capture rules: A pawn may capture an opponent's piece on a square diagonally in front of it on an adjacent file, by moving to that square. (typo BTW file/tile)

I assume this means if two other pawns can capture a single pawn then the count would still be 1 not 2. With that assumption, this assertion says there should be 6 safe pawns: assert safe_pawns({"b4", "d4", "f4", "c3", "e3", "g5", "d2"}) == 6

But from what the directions say this should be 4. If there's a pawn to the back left or back right of a given pawn's space then that should count for 1 (again not 2).

The pawn at the head is safe (d2) The two behind it (c3 and e3) that each have three behind them and the one with an extra pawn behind it (f4)

The rest of the pawns, while being mostly safe in the back don't meet the directions. If we drop the assumption that if two pawns can capture the same space where 1 pawn exists, this should then be 7 not 6.

I'm either misunderstanding something or there is a bug either in the directions or the assertion.