Your output should start by [.... ].

Every tick, you should wait 100 ms, then move each dots by one character right. if the dot is on the tenth character, move it to the first. Notice that you should clear the screen before outputting again. The output is ordered as the following:

[....      ]
[ ....     ]
[  ....    ]
[   ....   ]
[    ....  ]
[     .... ]
[      ....]
[.      ...]
[..      ..]
[...      .]


..Then it loops forever.

# Rules

• This is , so the shortest answer wins I doubt I would even accept a winning answer tho
• Can we output, say, twenty newlines before each output to 'clear' the screen? – Okx May 12 '17 at 11:11
• @Okx Yes, if your language has no other way of clearing the screen. – Matthew Roh May 12 '17 at 11:13
• How much error can the delay be?(e.g. +- 0.5 seconds) I'd suggest 250 milliseconds error.... – stevefestl May 12 '17 at 12:50
• Can 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 May 12 '17 at 20:23
• Is the use of \r allowed, instead of literally clearing the screen? – phyrfox May 12 '17 at 21:06

# S.I.L.O.S, 282 bytes

canvas # #
def # 1000 ! Obj N new M move > 10
newObj 0 # #
pen 255 255 255
N! 0 > >0
M! 1 > >
N! 0 > >0
M! 2 560 >
x=8
lblx
x-1
N! 0 > >
if x x
M! 3 20 >
M! 4 20 >0
M! 5 550 >
M! 6 550 >0
lbla
x=4
lbly
A=6+x
B=60+50*(((x-1)+a)%>)
M! A B 50
x-1
if x y
refresh
a+1
a%>
wait >0
GOTO a


TIO currently does not support graphical output, but the official interpreter does. I think this is the first time I have gotten a chance to test out the graphical output functionality of SILOS.

# TI-Basic (TI-84 Plus CE), 58 bytes

"....      (6 spaces)
Ans+Ans
While 1
For(X,11,2,-1
ClrHome
Disp "["+sub(Ans,X,10)+"]
Wait .1
End
End


• I wanted to submit a 68k version but realized that 1) None of my TI-92 Plus have a new enough AMS to use the clock, and 2) even if they did, the granularity is in seconds – Fox May 18 '17 at 1:24

# APL (Dyalog), 44 bytes

{∇r⊣⎕DL.1⊣⎕←⎕TC[20⍴2],1⌽'][',r←¯1⌽⍵}10↑4⍴'.'


Try it online with a slightly modified version: ⎕← replaced by ∆_ which outputs with timestamps.

4⍴'.' four periods

10↑ take the first ten characters of that (pads with spaces)

{} apply the following function

¯1⌽ rotate one character from the tail to the head

r← assign that to r

'][', prepend the brackets

1⌽ rotate one character from the head to the tail

⎕TC[] index the list of Terminal Control characters with

20⍴2 twenty repetitions of the number two (the second element is the newline)

⎕← output that

.1⊣ discard that in favour of the number 0.1

⎕DLDelay that many seconds (returns elapsed time)

r⊣ discard that in favour of r (which is then returned by the function)

∇ recurse (tail calls do not work up a stack, and can thus be repeated forever)

# Japt, 31 22 bytes

Saved 9 bytes thanks to @obakaron

Li@O¬OpT=T?Té :'.²²+6î


Try it online!

• p4  can be shortened to ²², Sp6 can be replaced by 6î, and Oq  can be replaced by O¬ – Oliver May 17 '17 at 13:23
• You're missing the enclosing []. – Shaggy Sep 16 '20 at 22:52

import Control.Concurrent
main=mapM_(\x->putStrLn("\27[H\27[J["++x++"]")>>threadDelay(10^5))$iterate(\x->last x:init x)".... "  First, we define a function r to rotate a string to the right. We begin with ".... " and construct an infinite list of its right-rotations, then for each x of these, print: • An ANSI escape sequence to clear the screen, • A left-bracket, • x itself, • A right-bracket, • And a newline character so the terminal will flush. Then threadDelay waits 100000 microseconds before continuing onto the next element. Since we are applying these operations to an infinite list, it will continue forever. • f x=last x:init x should be shorter than using reverse. – Laikoni May 17 '17 at 19:07 • @Laikoni Wow, thanks for that! Saved a whole dozen bytes – Fox May 17 '17 at 19:13 • Save another byte by moving the $ to the position of the .. Also is the newline needed if the screen is cleared anyway? If not then putStrLn can be shortened to putStr. – Laikoni May 17 '17 at 19:27
• @Laikoni Right, don't know why I didn't see that. In my case, the Ln is needed, else the terminal never displays anything. I think that's terminal-dependent though — else I would just use a carriage return instead of the ANSI escape – Fox May 17 '17 at 19:28

# shortC, 8572716665 64 bytes

f(i){Udprintf(2,"\r[%-10.10s]","....      ...."+i%10)<<13);f(i+9


Explanation:

f(i){                                                           function that takes integer
U                                                          sleep
dprintf(2,                                                print unbuffered
"\r[%-10.10s]",                                 string with exactly 10 characters, wrapped with spaces
"....    ...."                   a string that, when printed with exactly 10 characters, will always have output that is in the loading screen
+i%10              scroll through the string
)<<13);       sleep 10<<13 microseconds
f(i+9  recursion :D


# VBA (Excel), 109 bytes

Using Immediate Window and Cell A1 as output

a="...      .":Do:b=Right(a,1):a=b &Left(a,9):[A1]="["& a &"]":c=Timer+.1:Do While Timer<c:DoEvents:Loop:Loop

• Do While:...:Loop -> While:...:Wend for -3 bytes – Taylor Scott Mar 7 '19 at 14:18

# CJam, 39 bytes

'.4*S6*+{_a'"-oDcoes{es1$m100<}g;1m>}h  Can't make a GIF right now... How it works '.4*S6*+ e# Push a string containing 4 dots and 6 spaces { e# Do: _ e# Copy the string a e# Wrap it in an array and take its string representation: [".... "] '"- e# Remove quote characters from it: [.... ] o e# Print it Dco e# Print a carriage return (ASCII 13), moving the cursor back to the start es e# Push the current time in milliseconds {es1$m100<}g  e#  Loop until the current time is at least 100 more than that time
;             e#  Delete the old time
1m>           e#  Rotate the string 1 space to the right
}h             e# Repeat while the TOS is truthy. The string being printed is non-empty, so
e#   it is always truthy, and will repeat forever.


# Pyth, 28 bytes

J+*4\.*6d#.d.1p"\r"pj=.>J1Y


# Perl 6, 61 bytes

$_='.... ';loop {"^M[$_]".print;s/(.*)(.)/$1$0/;sleep .1}


(That ^M is a single carriage return character.)

I really tried to base the output on a lazy infinite list, but couldn't nearly approach the terseness of this solution.

## C, 74 73 bytes

i;f(){usleep(printf("\r[%-10.10s]","....      ...."+i%10)*7692);f(i+=9);}


Modified and improved version of https://codegolf.stackexchange.com/a/120321.

Displays correct output on MinGW.

## C, 98 93 Bytes

main(){char b[]="x...      .";for(;;)*b=b[10],usleep(12<<printf("\r[%s]",memcpy(b+1,b,10)));}


View Video

• @MDXF, Besides screwing up the pointer arithmetics, gcc does not allow the following on the global scope: b[]="x... ."; – Johan du Toit May 15 '17 at 17:46

# Octave, 71 bytes

s="...       ."';do;printf('[%s]\r',s=circshift(s,1));pause(.1);until 0


For once my Octave answer is not MATLAB compatible. Specifically this solution uses

• Both " and ' for quotes, to transpose a string
• MATLAB: ('asd')'
• Octave: "asd"'
• Octave specific do ... until 0 structure, one char shorter than while 1 ... end
• Octave's printf,one char shorter than the fprintf in MATLAB

# C, 91 bytes

main(i){for(char*s="....      ....    ";;i+=9)usleep(dprintf(2,"[%.10s]\r",s+i%10-1)<<13);}


If it doesn't have to begin at the left: (89 bytes)

main(i){for(char*s="....      ....    ";;i+=9)usleep(dprintf(2,"[%.10s]\r",s+i%10)<<13);}

• Something not quite right with this, sometimes it displays [a.... ] – cleblanc May 15 '17 at 13:51
• -7 bytes: eliminate char*s= and use the raw string in dprintf, e.g. ".... .... "+i%10-1. – MD XF May 15 '17 at 17:11

## R, 100 bytes

z="....      "
repeat{flush.console()
cat("\r[",z,"]",sep="")
z=sub("(.)(.+)(.)","\\3\\1\\2",z)
Sys.sleep(.1)}


# F# (Mono), 122114118 110 bytes

let rec t s=printf"[%s]\r"s;System.Threading.Thread.Sleep(100);t((string s.[8])+s.Substring(0,8))
t"      ..."


Try it online!

# JS (ES6), 179 bytes

x=[....      ]
[ ....     ]
[  ....    ]
[   ....   ]
[    ....  ]
[     .... ]
[      ....]
[.      ...]
[..      ..]
[...      .].split
;c=0;setTimeout(y=>alert(x[++c]),100)


# Powershell, 64 bytes

for(){cls;"[$('... .'*2|% s*g(9-$i++%10)10)]";sleep -m 100}


Where $string|% s*g$From $Length is a shortcut to summon $string.SubString($From,$Length)

This solution has one small disadvantage:

• there will be an overflow exception after the Windows style Loading bar has worked for 988 million years.

# Powershell, 65 bytes

for(){9..0|%{cls;"[$('... .'*2|% s*g$_ 10)]";sleep -m 100}}


# Japt, 22 bytes

Oq"[{'.²²úA éU°}]"Lt@ß


Test it

# Stax, 18 bytes

Θo░a↑▐»xr←9hV╣ä&N╞
`

Run and debug it