Created
October 29, 2009 23:45
-
-
Save unnu/221945 to your computer and use it in GitHub Desktop.
This file contains 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
IDEA 1 | |
(1..100).each {|i| puts [i,('foo' if i%3==0),('bar' if i%5==0)].join} | |
IDEA 2 | |
(1..100).each {|i| puts "#{i}#{'foo' if i%3==0}#{'bar' if i%5==0}"} | |
(1..100).each{|i|puts"#{i}#{'foo'if i%3==0}#{'bar'if i%5==0}"} #shortened | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment