Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
コンプガチャをシミュレートしてみよう
r = Array.new(12).fill(0) ; while (r.include?(0)) do r[rand(r.count)] += 1 ; end ; puts "#{r.count}個のガチャをコンプするために #{r.inject(:+)}回抽選しました。"
@kwappa

This comment has been minimized.

Copy link
Owner Author

@kwappa kwappa commented May 10, 2012

@kwappa

This comment has been minimized.

Copy link
Owner Author

@kwappa kwappa commented May 11, 2012

countとlengthが揺れていたので統一

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment