Last active
October 2, 2015 08:58
-
-
Save taiansu/2215605 to your computer and use it in GitHub Desktop.
The Kid back in town.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def char_to_block(sentence_ary, &block) | |
if block_given? then | |
sentence_ary.each do |sentence| | |
sentence.split(//).each do |char| | |
block.call(char) | |
end | |
puts | |
end | |
else | |
puts sentence_ary.join("\n"); | |
end | |
puts | |
end | |
if __FILE__ == $0 | |
sentence = ["Hello word, again. Here's the kid back in town.", | |
"I know, it's bee a pretty while.", "I know."] | |
char_to_block(sentence) { |char| | |
sleep(0.2) | |
print char | |
} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment