Skip to content

Instantly share code, notes, and snippets.

@qwertysmack
qwertysmack / snooker_break.py
Created February 8, 2016 21:39
Calculate maximum available snooker break
def max_break(reds_remaining, colour=0):
"""
:param reds_remaining: number of reds left on table
:param colour: (optional) point value of current colour
:return: return maximum available snooker break
"""
colours = sum(range(2, 8))
if reds_remaining > 0:
reds_and_blacks = reds_remaining * 8