Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Forseeing position solution in Clear category for Pawn Brotherhood by Bartlomiej_Szal
def isSafe(pawnNo,pawns):
lPawn = chr(ord(pawnNo[0]) - 1) + str(int(pawnNo[1]) - 1)
rPawn = chr(ord(pawnNo[0]) + 1) + str(int(pawnNo[1]) - 1)
if((lPawn in pawns) or (rPawn in pawns)):
return True
else:
return False
def safe_pawns(pawns):
safe = 0
for pawnCoords in pawns:
if(isSafe(pawnCoords,pawns)):
safe += 1
return safe
Oct. 8, 2016
Comments: