Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Random Groups of X
LISTOFNAMES = %{...}
GROUPSIZE = 5
names = LISTOFNAMES.split("\n")
shufflednames = names.shuffle
shufflednames.each_slice(GROUPSIZE).with_index do |group, i|
puts "\nGroup " + i.to_s
group.each {|name| puts name}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.