class Enumerable def shuffle sort { rand(3) - 1 } end end
DZone > One-line Shuffle In Ruby by Snippets Manager · Mar. 22, 07 · · Code Snippet Like (0) Comment Save Tweet 742 Views Join the DZone community and get the full member experience. Join For Free class Enumerable def shuffle sort { rand(3) - 1 } end end Opinions expressed by DZone contributors are their own. Popular on DZone A Guide to Understanding Vue Lifecycle Hooks How to Use Geofences for Precise Audience Messaging The Most Popular Technologies for Java Microservices Right Now How To Deploy Apache Kafka With Kubernetes Comments Partner Resources
Comments