# Desktop Python teaching example. Numerical inputs are illustrative.
def should_stop(contact, boundary, fresh):
    return not fresh or contact or boundary

for contact, boundary, fresh in [(False, False, True), (True, False, True),
                                  (False, True, True), (False, False, False)]:
    print(contact, boundary, fresh, "stop", should_stop(contact, boundary, fresh))
