Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
DSL solution in Clear category for Berserk Rook by veky
def berserk_rook(rook, enemies):
def aligned(target, origin): return len(set(target) & set(origin)) == 1
def order(start, middle, end):
def before(*r): return aligned(*r) and all(map(str.__le__, *r))
return before(start, middle) and before(middle, end)
aim = {T for T in enemies if aligned(T, rook) and not
any(order(rook, balk, T) or order(T, balk, rook) for balk in enemies)}
return len(aim) and 1 + max(berserk_rook(T, enemies - {T}) for T in aim)
July 30, 2014
Comments: