Last active
May 2, 2024 05:27
-
-
Save caseywatts/604ae11e4211acb0d3bc to your computer and use it in GitHub Desktop.
Random Groups of X
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
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