• API
• FAQ
• Tools
• Archive
SHARE
TWEET

# Farkle

a guest Jan 6th, 2016 104 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1.     ones_bonus = (2000 if rolls.count(1) >= 4 else ( 1000 if rolls.count(1) == 3 else 0 ) )
2.     single_ones_bonus = 100 * max(0, (rolls.count(1) - (4 if ones_bonus == 2000 else 3 if ones_bonus == 1000 else 0)))
3.     fives_bonus = (200 * 5 if rolls.count(5) >= 4 else ( 100 * 5 if rolls.count(5) == 3 else 0 ) )
4.     single_fives_bonus = 50 * max(0, (rolls.count(5) - (4 if fives_bonus == 200*5 else 3 if fives_bonus == 100*5 else 0)))
5.     other_numbers_bonus = sum(100 * i if rolls.count(i) == 3 else (200 * i if rolls.count(i) == 4 else 0) for i in (2, 3, 4, 6))
6.     return ones_bonus + single_ones_bonus + fives_bonus + single_fives_bonus + other_numbers_bonus
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
Not a member of Pastebin yet?