我正在尝试为“墙上的 99 瓶啤酒”这首歌写一个 Ruby 循环,用于“学习编程”一书中的练习。我究竟做错了什么?我有以下内容:
def bottles_of_beer
i = 99
while i < 99 and i > 0
puts "#{a} bottles of beer on the wall. #{a} bottle of beer."
i = i - 1
puts "Take one down, pass it around. #{i} bottle of beer on the wall."
end
end