fork download
  1. class Smile
  2.  
  3. def self.loop(string)
  4. i = 0
  5. word = string.split("")
  6. while i <= word.length
  7. print $/ * (0) + "" * (i) + "#{word[i]}"
  8. i = i + 1
  9. sleep(0.25)
  10. end
  11. end
  12.  
  13. def self.foo(count,string)
  14. c = 0
  15. while c < count
  16. (c+1).times { Smile.loop(string) }
  17. puts
  18. c = c + 1
  19. end
  20. end
  21. end
  22.  
  23. Smile.foo(3,"Smile!")
Success #stdin #stdout 0.06s 9696KB
stdin
Standard input is empty
stdout
Smile!
Smile!Smile!
Smile!Smile!Smile!