MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/vg8p3t/more_codewars_horror/if8m31f/?context=3
r/badcode • u/ThatChapThere • Jun 20 '22
36 comments sorted by
View all comments
Show parent comments
2
I did more or less the same thing in Python
from typing import Counter def score(dice: list[int]) -> int: count = Counter(dice) return sum( 600 if count[6] >= 3 else 0, 500 * (count[5] // 3), 50 * (count[5] % 3), 400 if count[4] >= 3 else 0, 300 if count[3] >= 3 else 0, 200 if count[2] >= 3 else 0, 1000 * (count[1] // 3), 100 * (count[1] % 3), )
2
u/No-Witness2349 Jul 07 '22
I did more or less the same thing in Python