After a long time i was stuck on a simple issue . Hope this solution would help for some one searching on google or ruby-api for instant .
Here is the solution for jumbling array elements
Non-optimal Ruby 1.8.6 code :
array.sort_by { rand }
Ruby 1.8.7+ have an optimised version built in:
array.shuffle
Enjoy
Advertisement