I am still pretty new to Ruby and coding in general and I have been struggling at this particular task for a while a now. I just wanted to know how to add a function in Ruby within a loop. For example:
def main()
name=read_string("What is your name? ")
if name=="Tom"
puts "an awesome name"
else
def print_silly_name(name)
i=0
puts name + " is a #{i}"+"name!"
while i<60
loop do puts " silly"
i=i+1
end
The output should have the word "silly" printed 60 times but I am not sure how to call the loop.