Skip to content

Instantly share code, notes, and snippets.

@bryanbibat
Created May 21, 2019 17:14
Show Gist options
  • Save bryanbibat/24d7223f4fabe701a6aaa4ebacd7bd0f to your computer and use it in GitHub Desktop.
Save bryanbibat/24d7223f4fabe701a6aaa4ebacd7bd0f to your computer and use it in GitHub Desktop.
deck = []
13.times { deck << 0 }
39.times { deck << 1 }
result = Hash.new(0)
1000000.times do
deck = deck.shuffle
count = 0
deck.each_slice(2).each do |x, y|
count += 1 if x == 0 && y == 0
end
result[count] += 1
end
puts result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment