VBA 32-bit, 159 157 143 141 134 Bytes
VBA does not have a built in function that allows for waiting for time periods less than one second so we must declare a function from kernel32.dll
32 Bit Declare Statement (41 Bytes)
Declare Sub Sleep Lib"kernel32"(ByVal M&)
64 Bit Declare Statement (49 Bytes)
Declare PtrSafe Sub Sleep Lib"kernel32"(ByVal M&)
Additionally, we must include a DoEvents
flag to avoid the infinite loop from making Excel appear as non-responsive. The final function is then a subroutine which takes no input and outputs to the VBE immediate window.
Immediate Window function, 93 Bytes
Anonymous VBE immediate window function that takes no input and outputs to the range A1
on the ActiveSheet
s="... .... .":Do:DoEvents:Sleep 100:[A1]="["&Mid(s,10-i,10)&"]":i=(i+1)Mod 10:Loop
Old Version, 109 Bytes
Immediate window function that takes no input and outputs to the VBE immediate window.
s="... .... .":i=0:Do:DoEvents:Sleep 100:Debug.?"["&Mid(s,10-i,10)&"]":i=(i+1) Mod 10:Loop
Ungolfted and formatted
Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal M&)
Sub a()
Dim i As Integer, s As String
s = "... .... ."
i = 0
Do
Debug.Print [REPT(CHAR(10),99]; "["; Mid(s, 10 - i, 10); "]"
DoEvents
Sleep 100
i = (i + 1) Mod 10
Loop
End Sub
-2 Bytes for removing whitespace
-30 Bytes for counting correctly
-14 Bytes for converting to immediate window function
Output
The gif below uses the full subroutine version because I was too lazy to rerecord this with the immediate window function.
![VBA loading Gif](../../I/static/images/e16aa802ad6efe7bc247874fb73c69df9e0cd2d3412270b1d3e82c56a2413e2d.gif)
1Can we output, say, twenty newlines before each output to 'clear' the screen? – Okx – 2017-05-12T11:11:59.700
2@Okx Yes, if your language has no other way of clearing the screen. – Matthew Roh – 2017-05-12T11:13:32.260
How much error can the delay be?(e.g. +- 0.5 seconds) I'd suggest 250 milliseconds error.... – stevefestl – 2017-05-12T12:50:12.017
1Can I suggest not including the fixed time delay on future challenges? I find it's appeared on a lot of recent challenges, and each time I write the same ungolfable boilerplate to make the system wait n milleseconds. – xnor – 2017-05-12T20:23:17.960
2Is the use of
\r
allowed, instead of literally clearing the screen? – phyrfox – 2017-05-12T21:06:25.647