[2¾6×2úN._7Ý.Λ,т.W’IEx.Helpers.Ї’.E
If only 05AB1E had a builtin to clear the console.. :/
Starts at frame 6, and rotates indefinitely in reversed order. Uses 0 instead of # as character, although could alternatively use 1/2 for the same byte-count by replacing the ¾ with X/Y respectively. Sleeps for 100 ms between each print, but could alternatively sleep any of these times for the same byte-count: 1/2/3/4/5/6/7/8/9/T (10)/₂ (26)/₆ (36)/₃ (95)/₅ (255)/₁ (256)/₄ (1000), by replacing the т.
Explanation:
[ # Loop indefinitely: 2 # Push 2 ¾ # Push 0 6× # Repeat it 6 times as string: "000000" 2ú # Pad with 2 leading spaces: " 000000" N._ # Rotate the string the loop-index amount of times towards the left 7Ý # Push list [0,1,2,3,4,5,6,7] .Λ # Use the modifiable Canvas builtin with these three options , # Pop and print it with trailing newline т.W # Sleep for 100 ms ’IEx.Helpers.Ї’ # Push dictionary string "IEx.Helpers.clear" .E # Evaluate and execute it as Elixir code
The Canvas Builtin uses three arguments to draw a shape:
- Length of the lines we want to draw
- Character/string to draw
- The direction to draw in, where each digit represents a certain direction:
7 0 1 ↖ ↑ ↗ 6 ← X → 2 ↙ ↓ ↘ 5 4 3
2¾6×2úN._7Ý creates the following Canvas arguments:
- Length:
2 - Characters: " 000000" (potentially rotated)
- Directions:
[0,1,2,3,4,5,6,7], which translate to \$[↑,↗,→,↘,↓,↙,←,↖]\$
Try the first two steps online.
Step 1: Draw 2 characters (" ") in direction 0/↑:
Step 2: Draw 2-1 characters ("0") in direction 1/↗:
0
Step 3: Draw 2-1 character ("0") in direction 2/→:
00
Step 4: Draw 2-1 character ("0") in direction 3/↘:
00 0
etc.
Step 7: Draw 2-1 character ("0") in direction 6/←:
00 0 0 00
Step 8: Draw 2-1 character (" ") in direction 7/↖:
00 0 0 00
I don't have a gif to see it in action, because IEx.Helpers.clear (or any clear through Elixir-eval for that matter) doesn't seem to work on Windows machines.. I tried to enable ANSI escape codes in the Windows Console by modifying the Registry on my PC, but wasn't able to get it to work. This should work as intended on a non-Windows machines, though.
As alternative, here the outputs where the clear-command is ignored and the infinite loop [ is replaced with a loop of eight 8F: Try it online.