Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Commonmark migration
Source Link

#Bash, 62 bytes

Bash, 62 bytes

c='|/-\';for((;;)){ echo Loading... ${c:d++%4:1}^[M;sleep .25;}

where ^[ represents ESC (ASCII 0x1b), which typically you can get by pressing CtrlV and then ESC.

ESC M is RI, reverse linefeed.

If you don't care about running indefinitely, you can save 2 bytes by using a recursive function:

c='|/-\';f(){ echo Loading... ${c:d++%4:1}^[M;sleep .25;f;};f

#Bash, 62 bytes

c='|/-\';for((;;)){ echo Loading... ${c:d++%4:1}^[M;sleep .25;}

where ^[ represents ESC (ASCII 0x1b), which typically you can get by pressing CtrlV and then ESC.

ESC M is RI, reverse linefeed.

If you don't care about running indefinitely, you can save 2 bytes by using a recursive function:

c='|/-\';f(){ echo Loading... ${c:d++%4:1}^[M;sleep .25;f;};f

Bash, 62 bytes

c='|/-\';for((;;)){ echo Loading... ${c:d++%4:1}^[M;sleep .25;}

where ^[ represents ESC (ASCII 0x1b), which typically you can get by pressing CtrlV and then ESC.

ESC M is RI, reverse linefeed.

If you don't care about running indefinitely, you can save 2 bytes by using a recursive function:

c='|/-\';f(){ echo Loading... ${c:d++%4:1}^[M;sleep .25;f;};f
Source Link
ninjalj
  • 3.1k
  • 1
  • 23
  • 22

#Bash, 62 bytes

c='|/-\';for((;;)){ echo Loading... ${c:d++%4:1}^[M;sleep .25;}

where ^[ represents ESC (ASCII 0x1b), which typically you can get by pressing CtrlV and then ESC.

ESC M is RI, reverse linefeed.

If you don't care about running indefinitely, you can save 2 bytes by using a recursive function:

c='|/-\';f(){ echo Loading... ${c:d++%4:1}^[M;sleep .25;f;};f

AltStyle によって変換されたページ (->オリジナル) /