Skip to content

Instantly share code, notes, and snippets.

@arnab
Created March 8, 2010 22:29
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 arnab/325859 to your computer and use it in GitHub Desktop.
Save arnab/325859 to your computer and use it in GitHub Desktop.
randomnize a few players
#!/usr/bin/env ruby -wKU
players = "Parag
Arnab
Vinoth
Sreeram
Ajay
Nazeer
Swapnil
Sridhar
Murali"
shuffled_players = players.split("\n").shuffle
shuffled_players << "Vinay"
puts shuffled_players.join(", ")
# Output:
# Vinoth, Arnab, Ajay, Swapnil, Sreeram, Nazeer, Parag, Murali, Sridhar, Vinay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment