Code Snippet: Slow Printing

From Coder Merlin
Revision as of 16:59, 26 May 2019 by Nerdofcode (talk | contribs)
Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder

Print characters to the terminal slowly[edit]

Swift[edit]

import Foundation

let string = "For the world is hollow, and I have touched the sky!"
for character in string {
    print(character, terminator:"")
    fflush(stdout)
    usleep(50000)
}
print()

Code Demystified on nerdofcode.com here

Python[edit]