sudo rm ~/Library/Application\ Support/Dock/*.db
sudo killall Dock
def score(dice)
result = 0;
(1..6).each do |digit|
multiplier = 100
multiplier = 1000 if digit == 1
triple = dice.count(digit) / 3 # принять во внимание [1, 1, 1, 1, 1, 1]
result += digit * multiplier * triple
end
result += dice.count(1) % 3 * 100
result += dice.count(5) % 3 * 50
end
return 0 if dice.empty?