Skip to main content
added 94 characters in body
Source Link
noodle person
  • 10.3k
  • 1
  • 22
  • 76

Uiua, 29 bytes

∧(◿10≡/+◫2&p⊂↯:@ ⊙⊸/$"_ _")°⊏

Try it

°⊏          # range of 0 to the input's length
∧(          # fold over this (N), with the input as the initial value:
  ⊙⊸/$"_ _" #   jointo the value, without consuming it: join on spaces
  &p⊂↯:@    #   prepend N spaces to this string and print with newlineit
  ◿10≡/+◫2  #   nexttake value:the sums of pairwise windows, mod 1010;
)           #     this is the next value for the loop

Uiua, 29 bytes

∧(◿10≡/+◫2&p⊂↯:@ ⊙⊸/$"_ _")°⊏

Try it

°⊏          # range of 0 to the input's length
∧(          # fold N, with the input as the initial value:
  ⊙⊸/$"_ _" #   join the value on spaces
  &p⊂↯:@    #   prepend N spaces and print with newline
  ◿10≡/+◫2  #   next value: sums of pairwise windows mod 10
)

Uiua, 29 bytes

∧(◿10≡/+◫2&p⊂↯:@ ⊙⊸/$"_ _")°⊏

Try it

°⊏          # range of 0 to the input's length
∧(          # fold over this (N), with the input as the initial value:
  ⊙⊸/$"_ _" #   to the value, without consuming it: join on spaces
  &p⊂↯:@    #   prepend N spaces to this string and print it
  ◿10≡/+◫2  #   take the sums of pairwise windows, mod 10;
)           #     this is the next value for the loop
Add a code explanation
Source Link
noodle person
  • 10.3k
  • 1
  • 22
  • 76

Uiua, 29 bytes

∧(◿10≡/+◫2&p⊂+◫2&p⊂↯:@ ⊙⊸/$"_ _",↯:@ )°⊏

Try itTry it

°⊏          # range of 0 to the input's length
∧(          # fold N, with the input as the initial value:
  ⊙⊸/$"_ _" #   join the value on spaces
  &p⊂↯:@    #   prepend N spaces and print with newline
  ◿10≡/+◫2  #   next value: sums of pairwise windows mod 10
)

Uiua, 29 bytes

∧(◿10≡/+◫2&p⊂:/$"_ _",↯:@ )°⊏

Try it

Uiua, 29 bytes

∧(◿10≡/+◫2&p⊂↯:@ ⊙⊸/$"_ _")°⊏

Try it

°⊏          # range of 0 to the input's length
∧(          # fold N, with the input as the initial value:
  ⊙⊸/$"_ _" #   join the value on spaces
  &p⊂↯:@    #   prepend N spaces and print with newline
  ◿10≡/+◫2  #   next value: sums of pairwise windows mod 10
)
Source Link
noodle person
  • 10.3k
  • 1
  • 22
  • 76

Uiua, 29 bytes

∧(◿10≡/+◫2&p⊂:/$"_ _",↯:@ )°⊏

Try it