this is my first post ever to stack overflow so I apologize if this is a poor question and if I incorrectly posted the code below.
I'm fairly new to computer programing and was trying to apply the use of the .each method in from Ruby to write out song lyrics. There is this ridiculous/awesome/idiotic song by Little John called, "Turn down for what?" The song basically repeats the same two lines over and over again.
I wanted to see if I could correctly apply the knowledge of the .each method from Ruby to re-write the song lyrics in the form of code.
The output puts out exactly the way I want to it to appear. However I did feel that I was essentially typing the same lines over and over again. Is there a more efficient way to do this?
Thanks for your help and please let me know if this question needs to be asked differently.
def turn_down_for_what
puts ""
fire_up = "Fire up, your loud, another round of shots!"
chorus = "Turn down for what!!!"
puts ""
puts fire_up
puts ""
4.times do
puts chorus
end
puts ""
puts fire_up
puts ""
4.times do
puts chorus
end
puts ""
3.times do
puts fire_up
end
10.times do
puts "Shots! "
end
puts ""
4.times do
puts chorus
end
end
turn_down_for_what