14
2
In any programming language, create a program that takes input and animates the text being typed on a keyboard.
The delay between each character should be varying to simulate true typing on a keyboard. The delay shall be 0.1, 0.1, 0.5, 0.1, 0.1, 0.5 ...
seconds, until the last character is printed. The final output shall be left on the screen.
You must overwrite the current line of text you can't have the text be printed on new rows.
Example, the input "Hello, PPCG! Goodbye Earth!" should result in the following animation (note that the sampling rate of the gif-maker was low, so the true result is slightly different):
Since this is code golf, the smallest amount of bytes win.
"You must overwrite the current line of text you can't have the text be printed on new rows." - is this implying that the program must clear the input and produce output in it's place? (Side note: your animation looks faster than specified.) – Jonathan Allan – 2017-02-18T18:26:13.530
Can we assume there is always input? – Metoniem – 2017-02-18T18:39:37.573
And can we exit with an error after the animation is done? – Metoniem – 2017-02-18T18:41:44.137
1Is the delay supposed to be random, or a repeating pattern of 0.1, 0.1, 0.5? – 12Me21 – 2017-02-18T18:42:17.877
2Should there be a delay before printing the first character? – user41805 – 2017-02-18T18:45:31.340
1It's that pattern yes @12Me21 – Metoniem – 2017-02-18T18:47:22.657
I'm not sure if I can time stuff that accurately on the Commodore 64 (without a SuperCPU, I might be able to with) or Sinclair ZX81, would it be okay if I don't hit these timings on that basis? – Shaun Bebbers – 2017-02-20T15:34:21.293
I should have added Commodore and Sinclair ZX81 BASIC - assembly would be a different beast – Shaun Bebbers – 2017-02-20T20:11:20.453