forked from colonelpanic/dotfiles
asciicinema config
This commit is contained in:
parent
fb8cbc551c
commit
d5e862f37a
2
dotfiles/config/asciinema/config
Normal file
2
dotfiles/config/asciinema/config
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[api]
|
||||||
|
token = 417ba97c-b532-4e4b-86df-a240314ae840
|
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user