(1..10).select{|x| x % 2 == 0}.map{|x| puts x / 2}
Last active
December 21, 2015 22:38
-
-
Save iambowen/6376181 to your computer and use it in GitHub Desktop.
ruby implementation
zhywang
commented
Aug 29, 2013
(1..10).select{|x| x % 2 == 0}.map{|x| x / 2}
(1..10).select{|x| x % 2 == 0}.map{|x| x / 2}.each{|x| puts x}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment