43
7
Many electronic devices, specially old ones, will show a blinking 12:00
when the time has not been set. The purpose of this challenge is to recreate this.
Specifically, the task is to display 12:00
and --:--
alternatively in an infinite loop.
The period should be 1 second, divided evenly in two periods of 0.5 seconds. Here "1 second" and "evenly" can be interpreted loosely. For example, it is acceptable if the code pauses for 0.5 seconds between displaying the strings, even if the resulting period will then be a little higher than 1 second. An initial pause before displaying the first string is acceptable.
Each new string can be displayed either by replacing the former string or in a new line. Trailing whitespace is allowed, except that if each new string is on a different line there should be no empty lines between consecutive strings.
Shortest code in bytes wins.
1does this count as [tag:kolmogorov-complexity]? – FlipTack – 2017-01-02T12:36:37.663
@FlipTack I think so, but I wasn't sure. Thoughts, anyone? – Luis Mendo – 2017-01-02T12:45:38.877
@LuisMendo I don't think so, I think the KG tag is mostly for a fixed string. This has more to it, the waiting and alternating strings. – Rɪᴋᴇʀ – 2017-01-02T13:25:52.780
Can submissions wait 0.5 seconds before showing initial output? – FlipTack – 2017-01-02T18:20:14.210
@FlipTack Yes, edited – Luis Mendo – 2017-01-02T18:33:22.747
1IMHO, the statement "Each new string can be displayed either by replacing the former string or in a new line" made this challenge not fun. – Setop – 2017-01-03T00:53:13.140
@Setop Do you mean that I should have required replacing the strings instead of allowing each string on a new line? Well, some languages or interpreters have difficulty with the concept of clearing the screen or deleting previous output; that's why I gave some flexibility – Luis Mendo – 2017-01-03T01:38:29.227
Question! Would it be okay as answer to use DOS as platform and exploit the text-mode's feature of blinking for this? – z0rberg's – 2017-01-06T12:31:39.440
@z0rberg's I think it would, yes. Please provide a gif with the result – Luis Mendo – 2017-01-06T13:08:29.870