Created
June 29, 2017 22:49
-
-
Save woodruffw/19c5a09e5a49dc3b8a5ae780141d5e7b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pairs = gets.chomp.split.map { |p| p.split(/d/i).map(&:to_i) } | |
pairs.each { |s, t| puts "You rolled %s" % [*1..s].sample(t).reduce(:+) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment