asciicinema config

This commit is contained in:
Ivan Malison 2015-11-20 19:04:36 -08:00
parent fb8cbc551c
commit d5e862f37a
2 changed files with 9 additions and 2 deletions

View File

@ -0,0 +1,2 @@
[api]
token = 417ba97c-b532-4e4b-86df-a240314ae840

View File

@ -1,6 +1,9 @@
import operator import operator
def generate_decreasing_n_sequence_with_bounded_sum(sequence_length, sum_bound, value_bound=float('inf')):
def generate_decreasing_n_sequence_with_bounded_sum(
sequence_length, sum_bound, value_bound=float('inf'),
):
if sequence_length == 0: if sequence_length == 0:
yield [] yield []
return return
@ -8,7 +11,9 @@ def generate_decreasing_n_sequence_with_bounded_sum(sequence_length, sum_bound,
bound_for_current = min(sum_bound - min_remaining, value_bound) bound_for_current = min(sum_bound - min_remaining, value_bound)
for value in range(sequence_length, bound_for_current): for value in range(sequence_length, bound_for_current):
for sequence in generate_decreasing_n_sequence_with_bounded_sum(sequence_length - 1, sum_bound - value, value_bound=value): for sequence in generate_decreasing_n_sequence_with_bounded_sum(
sequence_length - 1, sum_bound - value, value_bound=value,
):
yield [value] + sequence yield [value] + sequence