Guest User

Untitled

a guest
Jul 21st, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. def score(dice)
  2. one_score = dice.count(1)
  3. five_score = dice.count(5)
  4. #setup scoring hash
  5. h = { 1 => 100, 5 => 50 }
  6. scoreboard = 0
  7. if one_score == 3
  8. scoreboard += 1000
  9. scoreboard += (one_score * h[1]) + (five_score * h[5])
  10. return scoreboard
  11. end
  12. end
Add Comment
Please, Sign In to add comment