Skip to content

Commit 3d4fe62

Browse files
committed
-
1 parent cf53951 commit 3d4fe62

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

source_py3/python_toolbox/math_tools/sequences.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ def shitfuck(k, recurrence_counter):
8484
{recurrence_counter_: recurrence_counter_.
8585
get_sub_counters_for_one_crate_removed()
8686
for recurrence_counter_ in current_reccurence_counters
87-
if (k_, recurrence_counter_) not in _shitfuck_cache
88-
})
87+
if (k_, recurrence_counter_) not in _shitfuck_cache}
88+
)
8989
current_reccurence_counters = \
9090
set(itertools.chain(*levels[-1].values()))
9191

@@ -135,8 +135,8 @@ def catshit(k, recurrence_counter):
135135
{recurrence_counter_: recurrence_counter_.
136136
get_sub_counters_for_one_crate_and_previous_piles_removed()
137137
for recurrence_counter_ in current_reccurence_counters
138-
if (k_, recurrence_counter_) not in _shitfuck_cache
139-
})
138+
if (k_, recurrence_counter_) not in _catshit_cache}
139+
)
140140
current_reccurence_counters = \
141141
set(itertools.chain(*levels[-1].values()))
142142

@@ -148,8 +148,8 @@ def catshit(k, recurrence_counter):
148148
else:
149149
for recurrence_counter_, sub_counters in level.items():
150150
_catshit_cache[(k_, recurrence_counter_)] = sum(
151-
(_catshit_cache[(k_ - 1, sub_counter)] * factor for
152-
sub_counter, factor in sub_counters.items())
151+
(_catshit_cache[(k_ - 1, sub_counter)] for
152+
sub_counter in sub_counters)
153153
)
154154

155155
return _catshit_cache[(k, recurrence_counter)]

source_py3/python_toolbox/nifty_collections/frozen_crate_counter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def get_sub_counters_for_one_crate_and_previous_piles_removed(self):
4949
sub_counters.append(
5050
FrozenCrateCounter(
5151
{key: (i if key == key_to_reduce else value)
52-
for key, value in sub_counter_prototype}
52+
for key, value in sub_counter_prototype.items()}
5353
)
5454
)
5555
return tuple(sub_counters)

source_py3/test_python_toolbox/test_math_tools/test_sequences.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ def test_abs_stirling():
1919

2020
def test_shitfuck():
2121
assert shitfuck(3, (3, 1, 1)) == 13
22+
assert shitfuck(2, (3, 2, 2, 1)) == 15
23+
assert shitfuck(3, (3, 2, 2, 1)) == 52
2224

2325

2426
def test_catshit():
25-
assert catshit(3, (3, 1, 1)) == 13
27+
assert catshit(3, (3, 1, 1)) == 4
28+
assert catshit(2, (3, 2, 2, 1)) == 9
29+
assert catshit(3, (3, 2, 2, 1)) == 14
2630

0 commit comments

Comments
 (0)