Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def score(dice)
- one_score = dice.count(1)
- five_score = dice.count(5)
- #setup scoring hash
- h = { 1 => 100, 5 => 50 }
- scoreboard = 0
- if one_score == 3
- scoreboard += 1000
- scoreboard += (one_score * h[1]) + (five_score * h[5])
- return scoreboard
- end
- end
Add Comment
Please, Sign In to add comment