Skip to content

Instantly share code, notes, and snippets.

@luniki
Created July 15, 2010 13:18
Show Gist options
  • Save luniki/476922 to your computer and use it in GitHub Desktop.
Save luniki/476922 to your computer and use it in GitHub Desktop.
result = []
(1..3).each {|w1|
(1..3).each {|w2|
(1..3).each {|w3|
(1..3).each {|w4|
(1..3).each {|w5|
result << w1 + w2 + w3 + w4 + w5
}}}}}
require "pp"
pp result.find_all{|r| r >= 8 && r <= 11}.length / result.length.to_f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment