Post History
Uiua, 38 bytes (SBCS) Full program, prints diamond to STDOUT. Some nifty tricks turned out to be longer than some straightforward ways. Uses one leading whitespace even on the longest line to make...
#1: Initial revision
# [Uiua], 38 bytes (SBCS)
Full program, prints diamond to STDOUT. Some nifty tricks turned out to be longer than some straightforward ways. Uses one leading whitespace even on the longest line to make "`⍥@ `" work smoothly even then (it chokes on 0 input).
```uiua
F ← &p⊂⟜(↘₁⇌)+@A&pf⍥@ ˜-26⟜⇡+1
≡F⊂⇡26⇌⇡25
```
[Uiua pad this online](https://uiua.org/pad?src=0_19_0-dev_2__RiDihpAgJnDiioLin5wo4oaY4oKB4oeMKStAQSZwZuKNpUAgy5wtMjbin5zih6ErMQriiaFG4oqC4oehMjbih4zih6EyNQo=)
_Scoring remark: I count "`F ← `" as 2 bytes, as it will be auto-formatted even when entering `F=`._
### Explanation
```
F ← &p⊂⟜(↘₁⇌)+@A&pf⍥@ ˜-26⟜⇡+1 # helper function F: print diamond line
≡F⊂⇡26⇌⇡25 # apply F to range [0 ... 25 ... 0]
```
#### Helper function
```
&p⊂⟜(↘₁⇌)+@A&pf⍥@ ˜-26⟜⇡+1 # argument: diamond line number (0-based)
# example input: 4
+1 # 5 increment
⟜⇡ # 5 [0 .. 4] range, but keep on top
˜-26 # 21 [0 .. 4] subtract from 26
⍥@ # " [...] " [0 .. 4] repeat " " that many times
&pf # [0 .. 4] print string w/o trailing newline
+@A # "ABCDE" convert to character range
⟜(↘₁⇌) # "ABCDE" "DCBA" push reversed shortened character range, but keep original on top
&p⊂ # join both and print them (with newline)
```
#### Main
```
⇌⇡25 # push [24 .. 0]
⇡26 # push [0 .. 25]
⊂ # join both [0 .. 24 25 24 .. 0]
≡F # call F for each element
```
[uiua]: https://uiua.org/
