Well, the idea is that any reader can understand the code,
thus demonstrating the readability of Ruby. I can’t figure
out what your code does, so I doubt a non-rubyist would.How about?:
99.downto 1 do |x|
puts <<EOH
#{x} bottles of beer on the wall.
#{x} bottles of beer.
Take one down, pass it around.
EOH
end
Would this be readable enough?
99.downto 1 do |x|
puts <<-BEER
#{x} bottle#{“s” if x>1} of beer on the wall.
#{x} bottle#{“s” if x>1} of beer!.
Take one down, pass it around.
BEER
end
puts “No more bottles of beer on the wall!”
The idea is to show some of Ruby’s “#{}” flexibility…
Btw, I really hope the new indent feature of Nobu is approved. This sample
of mine has indents that are tooo far… If I bring the indents down, the
code does not look good in eye…
Daniel Carrera
kind regards -botp
···
sir Daniel Carrera [mailto:dcarrera@math.umd.edu] wrote: