Skip to content

Instantly share code, notes, and snippets.

@na74
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save na74/71886ed888d732d7cf06 to your computer and use it in GitHub Desktop.
Save na74/71886ed888d732d7cf06 to your computer and use it in GitHub Desktop.
code of 最低3ドロップ保証付き陣
# 最低3ドロップ保証付き陣
# ex. @data["to"] = [0,1,2,3,4] # 火〜闇
lambda do |drops|
new_colors = @data["to"] * 3
new_colors += (30 - new_colors.size).times.map do
@data["to"].sample
end
new_colors.shuffle!
drops.each.with_index do |d, i|
d.color = new_colors[i]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment