Last active
August 20, 2018 20:12
-
-
Save flemdizzle/e8c3d81ff7fcdd3d7eb9806a2b675975 to your computer and use it in GitHub Desktop.
Readable
This file contains hidden or 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
p Array | |
.new(10000){Array.new(6){rand(1..6)}} | |
.reject do |roll| | |
roll.include?(1) || | |
roll.include?(5) || | |
roll.select{ |die| roll.count(die) > 2 }.any? || | |
roll.sort.chunk_while{ |previous_die, current_die| previous_die == current_die }.count != 4 } | |
end | |
.count.to_f/10000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment