Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Pawn Brotherhood by AdamToth
letters = " abcdefgh "
def safe_pawns(pawns):
c = 0
safe = 0
for p in pawns:
if get_defending_pawn(p, -1) in pawns:
safe += 1
continue
if get_defending_pawn(p, 1) in pawns:
safe += 1
return safe
def get_defending_pawn(pawn, dir):
letter = letters[letters.index(pawn[0]) + dir]
number = str(int(pawn[1]) - 1)
return letter + number
March 4, 2015
Comments: