text:
Generate TeX to typeset Sierpinski Triangle Fractal
Challenge
Write code that outputs TeX (LaTeX) math-equation code (given below) that will typeset Sierpinski Triangle Fractal of 5 levels. Shortest code wins.
Details
TeX (and friends like LaTeX, etc.) is a sophisticated typesetting system. It can render arbitrary nested complex expressions for mathematical formulas. Coincidentally this "nested complex" is also descriptive of fractals. The following is rendered with MathJaX
$${{{{{x^x_x}^{x^x_x}_{x^x_x}}^{{x^x_x}^{x^x_x}_{x^x_x}}_{{x^x_x}^{x^x_x}_{x^x_x}}}^{{{x^x_x}^{x^x_x}_{x^x_x}}^{{x^x_x}^{x^x_x}_{x^x_x}}_{{x^x_x}^{x^x_x}_{x^x_x}}}_{{{x^x_x}^{x^x_x}_{x^x_x}}^{{x^x_x}^{x^x_x}_{x^x_x}}_{{x^x_x}^{x^x_x}_{x^x_x}}}}^{{{{x^x_x}^{x^x_x}_{x^x_x}}^{{x^x_x}^{x^x_x}_{x^x_x}}_{{x^x_x}^{x^x_x}_{x^x_x}}}^{{{x^x_x}^{x^x_x}_{x^x_x}}^{{x^x_x}^{x^x_x}_{x^x_x}}_{{x^x_x}^{x^x_x}_{x^x_x}}}_{{{x^x_x}^{x^x_x}_{x^x_x}}^{{x^x_x}^{x^x_x}_{x^x_x}}_{{x^x_x}^{x^x_x}_{x^x_x}}}}_{{{{x^x_x}^{x^x_x}_{x^x_x}}^{{x^x_x}^{x^x_x}_{x^x_x}}_{{x^x_x}^{x^x_x}_{x^x_x}}}^{{{x^x_x}^{x^x_x}_{x^x_x}}^{{x^x_x}^{x^x_x}_{x^x_x}}_{{x^x_x}^{x^x_x}_{x^x_x}}}_{{{x^x_x}^{x^x_x}_{x^x_x}}^{{x^x_x}^{x^x_x}_{x^x_x}}_{{x^x_x}^{x^x_x}_{x^x_x}}}}}$$
by the following plain-text math-equation code consisting of nested super- and sub-scripts:
{{{{{x^x_x}^{x^x_x}_{x^x_x}}^{{x^x_x}^{x^x_x}_{x^x_x}}_{{x^x_x}^{x^x_x}_{x^x_x}}}^{{{x^x_x}^{x^x_x}_{x^x_x}}^{{x^x_x}^{x^x_x}_{x^x_x}}_{{x^x_x}^{x^x_x}_{x^x_x}}}_{{{x^x_x}^{x^x_x}_{x^x_x}}^{{x^x_x}^{x^x_x}_{x^x_x}}_{{x^x_x}^{x^x_x}_{x^x_x}}}}^{{{{x^x_x}^{x^x_x}_{x^x_x}}^{{x^x_x}^{x^x_x}_{x^x_x}}_{{x^x_x}^{x^x_x}_{x^x_x}}}^{{{x^x_x}^{x^x_x}_{x^x_x}}^{{x^x_x}^{x^x_x}_{x^x_x}}_{{x^x_x}^{x^x_x}_{x^x_x}}}_{{{x^x_x}^{x^x_x}_{x^x_x}}^{{x^x_x}^{x^x_x}_{x^x_x}}_{{x^x_x}^{x^x_x}_{x^x_x}}}}_{{{{x^x_x}^{x^x_x}_{x^x_x}}^{{x^x_x}^{x^x_x}_{x^x_x}}_{{x^x_x}^{x^x_x}_{x^x_x}}}^{{{x^x_x}^{x^x_x}_{x^x_x}}^{{x^x_x}^{x^x_x}_{x^x_x}}_{{x^x_x}^{x^x_x}_{x^x_x}}}_{{{x^x_x}^{x^x_x}_{x^x_x}}^{{x^x_x}^{x^x_x}_{x^x_x}}_{{x^x_x}^{x^x_x}_{x^x_x}}}}}

Note this is just a 5-level nesting. You do not need to generate $...$ or $$...$$ or other markup required to start/end a math equation in TeX & Co. You can preview generated TeX in many online editors, for instance:  http://www.hostmath.com but you can find many others too. This question was inspired by a discussion with friends.
Update
There is a similar question but it much more general and will produce different solutions. I wanted to see really kolmogorov-complexity for a very fixed simple code that in one system (TeX) is completely explicit while in another compressed. This also address the n instead of 5 levels comment.

Why exactly 5 levels? It would be interesting (and probably easier) to implement arbitrary number of levels and to take level number as a parameter.

@ThePirateBay yes, sure, but i did not want to generalize, see my update.

Hello; I closed your question as a duplicate because I believe that answers can be too trivially modified from the other question to answer this question. However, I like the idea and I think it looks pretty cool! :)

For what it's worth, I reopened this question as I do not see the code as being trivially modifiable to translate from one to the other.

That's far too quick to be accepting a solution!

@HyperNeutrino was the question open again?

@Shaggy I removed acceptance for now because there is some confusion with opening and closing the question. Sorry.

@VitaliyKaurov Yes, AdmBorkBork hammered it: For what it's worth, I reopened this question as I do not see the code as being trivially modifiable to translate from one to the other..

@AdmBorkBork thank you for your consideration

Relevant Meta: https://codegolf.meta.stackexchange.com/q/5056/32352

When I saw this challenge, this answer came to my mind... https://codegolf.stackexchange.com/a/6830/67961  and... it was yours

@Jenny_mathy yeah guilty as charged ;-)

Is the challenge just to generate that TeX string, or to generate any TeX string which will have the same output?

@TRiG "any TeX string which will have the same output"

SOGL V0.12, 16 12 bytes
 x5{"{^_}”;∑

Try it Here!
Port of Erik The Outgolfer's Python 2 answer

Python 2, 32 bytes
exec"print'x'"+".join('{^_}')"*5

Try it online!

plain TeX, 29 bytes
\def~#1x{{#1x_#1x^#1x}}~~~~~x

That outputs what others have output. But if we need the code to be compilable it would be 6 bytes more
\def~#1x{{#1x_#1x^#1x}}$~~~~~x$\bye

Explanation
~ is an active character in TeX, so we can give it a (new) definition.
\def~#1x{{#1x_#1x^#1x}} defines ~ as a macro, so that when TeX sees ~, it does the following:

Read everything up to the next x, and call that #1 (pattern-matching).
Replace the whole thing with {#1x_#1x^#1x}

For example, ~ABCx would get replaced with {ABCx_ABCx^ABCx}.
When ~~~~~x is used, #1 is ~~~~, so the whole thing gets replaced with {~~~~x_~~~~x^~~~~x}. And so on.
Once we have the long string, we can print it out to terminal with \message (and ending with a \bye so TeX stops), so \message{~~~~~x}\bye. Or typeset the resulting expression (as a mathematical formula), by surrounding it in $s : so $~~~~~x$\bye.

Sorry if there's anything wrong, first answer here.

For a big n (rather than 5) it could be more efficient to create a macro that outputs a list of n tildes ~ rather than writing ~~~~~. Plus it would look better if the whole expression is typeset under \scriptscriptstyle.

Nice trick… can you add an explanation, or mind if I add one? This illustrates a nice feature of pattern-matching in TeX macros, which is not a feature common to many languages (that I know of).

I will add it, but feel free to edit.

Oops, didn't see your comment… added a very similar explanation; feel free to reject. +1 for the nice answer!

Almost word for word :)

PowerShell,  44  35 bytes
"'x'"+"-replace'x','{x^x_x}'"*5|iex

Try it online!
Uses string multiplication to repeatedly -replace xes with the sub- and super-scripts, then output.
Saved 9 bytes thanks to Joey.

"'x'"+"-replace'x','{x^x_x}'"*5|iex is a bit easier, no?

@Joey Oh, that's a clever way of doing it. Thanks!

05AB1E, 17 bytes
'x5F'x¡"{x^x_x}"ý

Try it online!
Explanation
'x                  # push "x"
  5F                # 5 times do
    'x¡             # split on "x"
       "{x^x_x}"ý   # join on "{x^x_x}"

Other programs at the same byte-count include
"{x^x_x}"©4F'x¡®ý
'x5F'x"{x^x_x}".:

I feel like "{x^x_x}" can be reduced ._.

JavaScript (ES6), 45 42 37 bytes
f=n=>n>4?'x':[...'{^_}'].join(f(-~n))

Edit: Saved 3 2 bytes thanks to @Arnauld. Specifying 5 still costs me 2 bytes; this 41 40 35-byte version takes a parameter instead:
f=n=>n?[...'{^_}'].join(f(n-1)):'x'

Japt, 21 20 18 bytes
5Æ="\{^_}"¬qUª'xÃÌ

Test it

Explanation
5Æ             Ã

Generate an array of length 5 and map over it.
"\{^_}"¬

Split a string to an array of characters
qUª'x

Rejoin (q) to a string using the current value of U or (ª) "x".
=

Assign the result of that to U.
Ì

Get the last element in the array.

Alternatives, 18 bytes
Same as above but reducing the array after it's been created.
5o r@"\{^_}"¬qX}'x

Test it
The recursive option.
>4©'xª"\{^_}"¬qßUÄ

Test it

MATL, 21 20 bytes
'x'XJ5:"J'{x^x_x}'Zt

-1 byte thanks to Giuseppe
Try it online!

20 bytes with 'x'XJ5:"J'{x^x_x}'Zt or even 5pc5:"5pc'{x^x_x}'Zt

05AB1E, 13 bytes
'x5F"{^_}"Ssý

Try it online!
Port of my Python 2 answer.

Jelly, 12 bytes
”x“{^_}”j$5¡

Try it online!
Port of my Python 2 answer.

Java (OpenJDK 8), 179 167 bytes
@Neil port
interface Y{static void main(String[]a){System.out.println(t.apply(1));}java.util.function.Function<Integer,String>t=N->N>0?Y.t.apply(N-1).replace("x","{x^x_x}"):"x";}

Try it online!

I think you it is shorter to write t as a real functio  instead of a lambda

If you use an entire program, t.apply(1) should be t.apply(new Integer(a[0])) instead. But why not just post a method? String t(int n){return n>0?t(n-1).replace("x","{x^x_x}"):"x";} And if the requirement of the challenge would be a full program (which isn't), using a Java 7 recursive method would be shorter than a lambda: interface Y{static void main(String[]a){System.out.print(t(new Integer(a[0])));}static String t(int n){return n>0?t(n-1).replace("x","{x^x_x}"):"x";}}

Wolfram Language (Mathematica) - 40 characters
Summarizing 3 best answers here:
40 bytes:
Nest["{"<>#<>"_"<>#<>"^"<>#<>"}"&,"x",5]

41 bytes:
Nest[StringReplace["x"->"{x^x_x}"],"x",5]

44 bytes:
Last@SubstitutionSystem["x"->"{x^x_x}","x",5]

It is not recommended to answer your own challenge, without leaving others a couple of days first.

Does your first code snippet not require 41 bytes?

@Mr.Xcoder apologies, the editor form suggested as an option to post my own answer. Should I delete my answer?

@VitaliyKaurov I think you should, other users will probably receive this badly.

Pyth, 17 16 13 bytes
jF+\x*5]"{^_}

Try it online!
Python 3 translation:
from functools import*;print(reduce(lambda x,y:x.join(y),["x"]+5*["{^_}"]))

C (gcc), 82 bytes
O(o){o--?_(125,O(o,_(95,O(o,_(94,O(o,_(123))))))):_(120);}main(){O(5);}

Try it online!


text:
Am I an insignificant array?
An insignificant array is an array of positive integers, where the absolute differences between consecutive elements are all smaller than or equal to 1.
For example, the following array is insignificant:
[1, 2, 3, 4, 3, 4, 5, 5, 5, 4]

Because the corresponding (absolute) differences are:
[1, 1, 1, 1, 1, 1, 0, 0, 1]

Which are all smaller than or equal to 1.

Your task is to determine whether a given array of integers is insignificant.

You may assume that the array always contains at least two elements.
Standard input and output rules apply. You may take input (and output) in any reasonable format.
Default Loopholes are forbidden.
The truthy / falsy values have to be distinct and consistent.
This is code-golf, so shortest answer in bytes wins.

Test cases

Input -> Output

[1, 2, 3, 4, 3, 4, 5, 5, 5, 4] -> true
[1, 2, 3, 4, 5, 6, 7, 8, 9, 8] -> true
[3, 3, 3, 3, 3, 3, 3]          -> true
[3, 4, 4, 4, 3, 3, 3, 4, 4, 4] -> true
[1, 2, 3, 4]                   -> true
[5, 4, 3, 2]                   -> true
[1, 3, 5, 7, 9, 7, 5, 3, 1]    -> false
[1, 1, 1, 2, 3, 4, 5, 6, 19]   -> false
[3, 4, 5, 6, 7, 8, 7, 5]       -> false
[1, 2, 4, 10, 18, 10, 100]     -> false
[10, 20, 30, 30, 30]           -> false

I used the values true and false.

Do the truthy/falsy values actually have to be truthy/falsy in our language of choice, or can we use any two distinct and consistent values?

@MartinEnder Any two distinct and consistent values. P.S Sorry for the late response

The text says you'll be given an array of integers, but that only arrays of positive integers can be insignificant. Should we be prepared for an array of negative integers?

Jelly, 3 bytes
IỊẠ

Try it online!
How?
Just the perfect challenge for Jelly.

IỊẠ   Full program.

I     Increments; Get the difference between consecutive elements.
 Ị    Insignificant; return abs(number) ≤ 1.
  Ạ   All; returns 1 if all the elements are truthy, 0 otherwise.

P wouldn't work would it, because if all the differences were 1 it'd output 1, but if one of them was 0 it would output 0? And if one difference was 5 but one was 0 it would still do 0?

What about the "positive integers" requirement?

JavaScript (ES7), 33 29 bytes
Saved 4 bytes thanks to @JohanKarlsson
a=>!a.some(v=>(a-(a=v))**2>1)

How?
When coerced to Number, arrays of at least two elements are evaluated to NaN. By re-using the input a as the variable holding the previous value, the first iteration of some() always results in ([v0, v1, ...] - a[0]) ** 2 = NaN, no matter the value of a[0]. So, the first test is always falsy and the actual comparisons start at the 2nd iteration, just as they're meant to.
Test cases

let f =

(a,p)=>!a.some(v=>(p-(p=v))**2>1)

console.log(f([1, 2, 3, 4, 3, 4, 5, 5, 5, 4])) // true
console.log(f([1, 2, 3, 4, 5, 6, 7, 8, 9, 8])) // true
console.log(f([3, 3, 3, 3, 3, 3, 3]         )) // true
console.log(f([3, 4, 4, 4, 3, 3, 3, 4, 4, 4])) // true
console.log(f([1, 2, 3, 4]                  )) // true
console.log(f([5, 4, 3, 2]                  )) // true
console.log(f([1, 3, 5, 7, 9, 7, 5, 3, 1]   )) // false
console.log(f([1, 1, 1, 2, 3, 4, 5, 6, 19]  )) // false
console.log(f([3, 4, 5, 6, 7, 8, 7, 5]      )) // false
console.log(f([1, 2, 4, 10, 18, 10, 100]    )) // false
console.log(f([10, 20, 30, 30, 30]          )) // false

29 bytes: a=>!a.some(v=>(a-(a=v))**2>1)

@JohanKarlsson Ah yes, the input is guaranteed to contain at least 2 elements, so that's safe. Thanks a lot!

It requires two value than t/f so ! is unnecessary. Also even if 1 element possible p-(p=v) is zero and it works fine

Python 3, 40 bytes
f=lambda n,*t:t==()or-2<n-t[0]<=1==f(*t)

Try it online!

Haskell, 34 33 bytes
all((<2).abs).(zipWith(-)=<<tail)

Try it online! -1 byte thanks to @user1472751

The point-free solution is one two again only one byte (thanks to -1 byte from @Dennis) shorter than the recursive approach:
f(a:b:r)=2>(a-b)^2&&f(b:r)
f _=1>0

Try it online!

Mathematica, 24 bytes
Max@Abs@Differences@#<2&

#==Clip@#&@*Differences is one byte shorter.

Try it online! and 23 bytes by Misha Larov

Octave, 21 bytes
@(x)all(diff(x).^2<2)

Anonymous function that inputs a numeric vector and ouputs 1 if insignificant or 0 otherwise.
Try it online!

Pyth, 6 bytes
._MI.+

Verify all the test cases.

Pyth, 8 bytes
.A<R2aVt

Try it online!
Explanation
._MI.+   Full program.

    .+   Deltas.
   I     Is invariant under...
._M      Mapping with Sign. 0 if n == 0, -1 if n < 0, 1 if n > 0.

.A<R2aVt    Full program.

      Vt    Vectorize function, applied on the input zipped with the tail of the input.
     a      Absolute difference.
  <R2       For each, check if it is smaller than 2.
.A          All.

I have no idea why I thought I# instead of M.

Python 2, 35 bytes
x=input()
while-2<x.pop(0)-x[0]<2:1

Exists with status code 1 for insignificant arrays, with status code 0 otherwise.
Try it online!

Husk, 4 bytes
ΛεẊ-

Try it online!
Explanation:
ΛεẊ- 2-function composition
Λ    (x -> y):f -> [x]:x -> TNum: Check if f returns a truthy result for all elements of x
 ε    f: TNum:x -> TNum: Check if abs(x) <= 1 (shamelessly stolen from Jelly)
  Ẋ   x: (x -> x -> y):f -> [x]:x -> [y]: reduce each overlapping pair of x by f
   -   f: TNum:x -> TNum:y -> TNum: y - x

Japt, 6 bytes
äa e<2

Try it online!
Explanation
ä        Get all pairs of elements
 a       Take absolute difference of each pair
         This results in the deltas of the array
   e     Check if every element...
    <2   Is less than 2

APL, 13 bytes
{×/(|2-/⍵)<2}

First APL answer \o/
Note: I am a bot owned by Hyper Neutrino. I exist mainly for chat testing.
Explanation
{×/(|2-/⍵)<2}
{           }  Function; right argument is ⍵
   (     )     Bracketed Expression
       /       Reduce
     2         Every pair (two elements) of
        ⍵      ⍵
      -        Using subtraction
    |          Magnitude (Absolute Value)
          <2   For each element, is it less than two?
  /            Reduce over
 ×             Multiplication (Product) (All)

11 bytes as tacit - ∧/2>(|2-/⊢)

Vyxal bot how could you betray us like this? :p

05AB1E, 5 bytes
¥Ä2‹P

Try it online!
Explanation
¥        # calculate deltas
 Ä       # absolute values
  2‹     # smaller than 2
    P    # product

@Okx: I'm afraid not. It won't work for [5,2] for example.

2‹ can be ! for -1 byte

Perl 6, 25 bytes
{?(2>all(.[]Z-.skip)>-2)}

Try it online!
This should be pretty readable. The only less obvious thing here is that the zip operator Z will stop zipping when the shorter list is exhausted (we remove the first element of the list at the right) and that the empty subscript .[], so called Zen slice, gives the whole list. .skip returns the list without the first element.

Are those two spaces really necessary?

@JonathanFrech: The right one probably no. Also I just realized that the .rotate is not needed here.

Heck, even the left one could be removed. I really don't understand where the whitespace is required and where it is not...

You could write -2< instead of -1≤ and <2 instead of ≤1 to save four more bytes.

Er, I guess you actually have to reverse the comparisons 2>...>-2 to avoid interpreting the < in an erroneous way.

@Sean, thanks. I missed the fact that the array will contain only positive integers.

I recently discovered the following trick: .[]Z-.skip saves 2 bytes.

@nwellnhof — wow! I mean: I was searching for a method that would do this, and didn't find it. (Apparently the docs need to get even better than they are now.) Many thanks!

While it doesn't change the length, you could use so … instead of ?(…)

@BradGilbertb2gills: That would be probably nicer visually, but that's it. I just tend to use ? everywhere because (I think) it's at worst the same length as so.

Proton, 41 bytes
a=>all(-2<a[i]-a[i+1]<2for i:0..len(a)-1)

Try it online!
-16 bytes thanks to Mr. Xcoder
-2 bytes
-6 bytes thanks to Mr. Xcoder

49 bytes (-16 bytes)

@Mr.Xcoder I think the space in <2 for might be omittable.

@JonathanFrech There is no space there?

@Mr.Xcoder oh yeah I don't know what I was thinking with all those crazy function chainings. Thanks! :D

C# (.NET Core), 51 45 44 + 18 bytes
-1 byte thanks to Jeppe Stig Nielsen
a=>a.Zip(a.Skip(1),(x,y)=>x-y).All(x=>x*x<4)

Byte count also includes:
using System.Linq;

Try it online!
Explanation:
a =>                      // Take an array of integers as input
    a.Zip(                // Combine each element with corresponding one from:
        a.Skip(1),        //     the input array without first element
        (x, y) => x - y   //     get their difference
    )
    .All(x => x * x < 4)  // Check if all differences are less than 2
                          // (We only care about 0 and 1, and so happens that when they're squared, it works like Abs! Magic!)

Little improvement: a=>a.Zip(a.Skip(1),(x,y)=>x-y).All(x=>x*x<4), it avoids the negation !.

@JeppeStigNielsen awesome, thank you!

R, 30 26 bytes
cat(all(diff(scan())^2<2))

Try it online!

I think function(a)all(diff(a)^2<2) saves 3 bytes.

you could take the input from the console: all(diff(scan())^2<2)

@BLT good point!

@flodel There was some recent discussion regarding the need to explicitly  print the output when using scan, but it still saves a byte!

Ohm v2, 4 bytes
Δ2<Å

Try it online!
How?
Δ2<Å   ~ Full program.

Δ      ~ Absolute deltas.
 2<    ~ Is smaller than 2?
   Å   ~ Check if all elements are truthy.

PowerShell, 62 bytes
param($a)$l=$a[0];($a|?{$_-$l-in1..-1;$l=$_}).count-eq$a.count

Try it online!
PowerShell doesn't have a .map or .some or similar command, so here we're individually checking each delta.
We take input $a and set $l equal to the first element. Then we loop through $a and take out each element where |?{...} the difference $_-$l is -in the range 1,0,-1. We then set $l equal to the current element. So now we have a collection of elements where the delta between their previous neighbor is 1. We take the .count of that and check whether it's -equal to the .count of the array as a whole. If it is, then every delta is 1 or less, so it's an insignificant array. That Boolean result is left on the pipeline, and output is implicit.

You can save 1 byte by getting rid of the param and doing $l=($a=$args)[0]

@briantist That doesn't work, though. For example.  This is because it's setting $l to be the whole input array in your suggestion.

I think it just requires changing the way you give arguments in TIO (each element needs to be specified separately). The way you have it now, the first element of $args is itself the whole array. Example

That feels cheaty...

I think that's actually the correct way to use $args. If you called a script or function with a series of arguments separated as spaces, it would come in as separate elements in $args, and for TIO that's how to emulate that. I've personally used it that way many times before, but to each their own :)

Factor, 48 33 bytes
Saved 15 bytes thanks to @chunes!
[ dup rest v- vabs supremum 2 < ]

Try it online! (results are at the bottom)
dup rest makes a copy of the inputted sequence without the first element. v- subtracts that from the original sequence (\$a_n-a_{n-1}\$). Then vabs gets the absolute values of that. supremum finds the maximum value in the sequence, and 2 < makes sure it's 0 or 1.

vabs is shorter than [ abs ] map. supremum is shorter than 0 [ max ] reduce.

@chunes Nice, thanks!

Python 3, 45 bytes
lambda k:all(-2<x-y<2for x,y in zip(k,k[1:]))

Try it online! or Try the test suite.
Thanks to Jonathan Frech for -2 bytes.

abs(x-y)<2 -> -2<x-y<2.

MATL, 6 5 bytes
d|2<A

-1 byte thanks to Giuseppe
Try it online! or Verify all test-cases

I think per meta consensus you can use d|2< instead, as an array with a zero value is falsey in MATL.

Or d|2<A for something closer to your original answer.

@Giuseppe No they can't: The truthy / falsy values have to be distinct and consistent.

@Mr.Xcoder "an array of all 1s for truthy" and "an array containing at least one zero for falsey" isn't distinct and consistent?

@Giuseppe They are distinct, but inconsistent.

@Giuseppe I'll go for d|2<A, thanks!

@Giuseppe "an array of all 1s for truthy" and "an array containing at least one zero for falsey" isn't distinct and consistent? - No, that is not acceptable, because they are inconsistent.

C, 61 56 bytes
Thanks to @scottinet for saving five bytes!
r;f(a,n)int*a;{for(r=1;--n;r=(*a-*++a)/2?0:r);return r;}

Try it online!
C (gcc), 47 bytes
r;f(a,n)int*a;{for(r=1;--n;r=(*a-*++a)/2?0:r);}

Try it online!

And if it is allowed / if you feel like it, you may save 9 more bytes by storing the result in r instead of returning it. :-)

@scottinet I considered that, but it's not valid C even though it happens to work with gcc. It's allowed, though, so I guess I'll just include it as an alternate version.

I'm puzzled as to why using the global r to store the result and printing it in main is not valid C?

@scottinet Assigning a variable at the end of a function puts that value in the function's return adress, making it feel like it is returning the value. However, this behaviour is not part of the C specifications, thereby not guarenteed to work. It can also break with certain optimizing compiler flags.

Indeed, but that is not what I did in my proposal. I also modified the main function to make it print r (a global variable) explicitly instead of a returned value that do not exist anymore. That's why I wondered if that was allowed by rules.

@scottinet Ah, I am sorry. I think that would not be allowed as you cannot simply assign variables in your solution per agreed upon rule. As an example, using globally defined variables instead of function arguments would not be allowed either. Your task is to write a fully functional program / function.

I am not sure, but is this valid?

@JonathanFrech languages are defined by their implementation here, so if you have a compiler which produces consistent results then the answer is valid, even if formally UB.

Java (OpenJDK 8), 60 bytes
a->{int r=1,p=a[0];for(int i:a)r|=(r=p-(p=i))*r;return r<2;}

Try it online!

5 bytes thanks to @Nevay!

You can use r in the loop to calculate (p-n) only once, >>1 can be /2, or removed if you use | instead of +: a->{int r=1,p=a[0];for(int i:a)r|=(r=p-(p=i))*r;return r<2;} (60 bytes).

Cheers @Nevay, thank you! Perfect golfing, as usual ;-)

can you explain me how does it work? thank you!

anyfix, 9 bytes
I€A€2<»/&

Try it online!
I€A€2<»/&  Main Link
I          Deltas
 €         For each element
  A        Take its absolute value
   €  »    For each element
    2<     Is it less than two?
       /   Reduce over
        &  Logical AND

This is mostly a port of the 05AB1E solution except terrible because anyfix doesn't have autovectorization and other cool things

Ruby, 36 35 33 bytes
->b,*a{a.all?{|x|(b-(b=x))**2<2}}

Takes the input array as individual arguments.
-1 byte thanks to MegaTom, -2 bytes thanks to Jordan.
Try it online!

->a{b,=a;a.all?{|x|(b-(b=x))**2<2}} is 35 bytes.

@MegaTom right you are!

->b,*a{a.all?{|x|(b-(b=x))**2<2}} is 33 bytes.

@Jordan Not sure if that works - how are you passing the array into it? Passing the array like in the TIO just gives true for all test cases.

No array, just pass the input as individual arguments.

@Jordan nice, didn't know about that one. Thanks!

Julia 0.6, 21 bytes
~x=all(diff(x).^2.<2)

Try it online!
-1 byte thanks to MarcMush: pass a single argument to all

you can add the missing functionnality yourself to mimic later behaviour (import Base: <; <(x) = i->i<x)

-1 byte (and works in julia 1.0) ~x=all(diff(x).^2 .<2)

Java (OpenJDK 8), 78 bytes
a->{int p=0,i=1;for(;i<a.length;p+=Math.abs(a[i]-a[i++-1])>1?1:0);return p<1;}

Try it online!

JavaScript (ES6), 37 36 bytes
(a,u)=>!a.some(e=>(e-=(u=e))>1|e<-1)

Edit: Saved 1 byte by stealing @Arnauld's trick.

You could use currying: a=>u=>!a.some(e=>(e-=(u=e))>1|e<-1)

@Bálint Sorry for the late response; I don't normally comment on "use currying" comments, but I will here because I'm not sure that's legal here since u is a temporary, not a parameter. (I can't use a global as it needs to start out as undefined and a global would not be reusable.) I guess I could apply the golf that was since applied to his answer of using a instead of u though...

Pyth, 7 bytes
._I#I.+

Test Suite
Returns true/false.
Explanation:
     .+ Deltas, returns differences between consecutive values.
._      Signum, returns the sign of a number (1, 0, or -1).  Note that this should
             be equal to the input for insignificant arrays.
  I     Tests if it is equal to the input...
   #    For each in the input, and filter out those that aren't...
    I   And make sure none have been filtered out.

Mathematica, 34 bytes
Differences@#~MatchQ~{(1|0|-1)..}&

Explanation
                                 & (* Function *)
Differences                        (* which takes the consecutive differences*)
           @#                      (* of the input list *)
             ~MatchQ~              (* and returns whether it matches *)
                     {(1|0|-1)..}  (* a list consisting of one or more 1s, 0s, or -1s *)

Try it online!

TI-Basic, 6 7 bytes
prod(2>abs(ΔList(Ans

or, 5 bytes if errors count as valid return value (returns ERR:ARGUMENT if insignificant, else ERR:DOMAIN)
augment(sin⁻¹(ΔList(Ans

This should probably have abs(ΔList(Ans, or else drops by more than 1 (such as in {5,3,1} or in the test case {3,4,5,6,7,8,7,5}) don't get detected.

@MishaLavrov thanks, you're right!

Swift 4, 52 bytes
{!zip($0.dropFirst(),$0).map(-).contains{1<abs($0)}}

Test suite:
let isInsignificant: (_ array: [Int]) -> Bool = {!zip($0.dropFirst(),$0).map(-).contains{1<abs($0)}}

let testcases: [(input: [Int], expected: Bool)] = [
    (input: [1, 2, 3, 4, 3, 4, 5, 5, 5, 4], expected:  true),
    (input: [1, 2, 3, 4, 5, 6, 7, 8, 9, 8], expected:  true),
    (input: [3, 3, 3, 3, 3, 3, 3],          expected:  true),
    (input: [3, 4, 4, 4, 3, 3, 3, 4, 4, 4], expected:  true),
    (input: [1, 2, 3, 4],                   expected:  true),
    (input: [5, 4, 3, 2],                   expected:  true),
    (input: [1, 3, 5, 7, 9, 7, 5, 3, 1],    expected: false),
    (input: [1, 1, 1, 2, 3, 4, 5, 6, 19],   expected: false),
    (input: [3, 4, 5, 6, 7, 8, 7, 5],       expected: false),
    (input: [1, 2, 4, 10, 18, 10, 100],     expected: false),
    (input: [10, 20, 30, 30, 30],           expected: false),
]

for (caseNumber, testcase) in testcases.enumerated() {
    let actual = isInsignificant(testcase.input)
    assert(actual == testcase.expected,
        "Testcase #\(caseNumber) \(testcase.input) failed. Got \(actual), but expected \(testcase.expected)!")
    print("Testcase #\(caseNumber) passed!")
}
```

Clojure, 35 bytes
#(every? #{-1 0 1}(map -(rest %)%))

How neat is that?

Try it online!

J, 20 19 bytes
i=.[:*/2>[:|2&(-/\)

I defined it as a verb, which adds 3 bytes to the total length.
Explanation
2&(-/\) finds the difference between two consecutive elements
| takes the absolute value
[: caps the fork so that the result is propagated onwards
2> finds if the values are smaller than 2
*/ calculates the product of all the elements, so yields 1 only if all are 1s
[: caps the fork so that the result is propagated onwards

Example:

   i 1 3 5 7 9 7 5 3 1
0

Try it online

[:*/2>2|@-/\] should work for 6? fewer bytes.

@cole Thanks, this is much better than mine!

[:*/2>&|2-/\] for 13: Try it online! EDIT: woops I see cole beat me to it.  I'll leave this here for the TIO.

F#, 56 bytes
let f a=Seq.forall(fun(x,y)->abs(x-y)<2)(Seq.pairwise a)

K (ngn/k), 15 13 bytes
-2 bytes from @ngn's improvements
&/2>#'!'1_-':

Try it online!

-': subtract each value in the (implicit) input from its predecessor
1_ drop the first result
#'!' take the absolute value (literally, take the count of the range of each value; e.g. 1 -> ,0, -2 -> -2 -1)
&/2> are all the absolute values smaller than 2?

here's an idea: abs:{#'!'x}

Makes the literal translation a bit more... nuanced, but saves some bytes! Thanks!

Julia, 17 bytes
!x=diff(x)⊆-1:1

Attempt This Online!

Uiua, 8 bytes
≅±.≡/-◫2

Try it!
≅±.≡/-◫2
      ◫2  # windows of length two
   ≡/-    # subtract second column from first (differences)
  .       # duplicate
 ±        # sign (pervasive across array)
≅         # do they match?

Perl 5, 38 + 2 (-ap) = 40 bytes
$_&&=abs$i-$F[-1]<2while($i=pop@F)&&@F

Try it online!

I don't think -p is needed to be a +1. Does it?

RProgN 2, 8 bytes
{-â2<}á*

Explained
{-â2<}á*
{    }á     # Fold the input by the function
 -          # Subtract, get the difference.
  â         # Absolute
   2<       # Is less than 2.
       *    # Get the product, 1 for truthy, 0 for falsey.

Try it online!

Common Lisp, 53 bytes
(lambda(a)(every(lambda(x y)(< -2(- x y)2))a(cdr a)))

Try it online!

Jq 1.5, 42 41 bytes
all(keys[1:][]as$i|.[$i]-.[$i-1]|.*.;.<2)

Explained
all(                   # true if all values from
    keys[1:][] as $i   # scanning input indices starting at second element
  | .[$i]-.[$i-1]      # calculate differences between successive elements
  | .*.                # square the difference
; . < 2                # are < 2
)

Sample Run
$ jq -Mc 'all(keys[1:][]as$i|.[$i]-.[$i-1]|.*.;.<2)' data.json
true
true
true
true
true
true
false
false
false
false
false

$ echo -n 'all(keys[1:][]as$i|.[$i]-.[$i-1]|.*.;.<2)' | wc -c
  41

Excel VBA, 55 Bytes
Anonymous VBE immediate window function that takes input from range [1:1] and outputs to the VBE immediate window
[2:2]="=IfError(If(B1=0,0,ABS(B1-A1)),0)":?[Max(2:2)>1]

Pushy, 13 bytes
$2d-|v.;Og2<#

Try it online!
                 \ Implicit: Input on stack
$      ;         \ While there are items left on stack:
 2d-|            \   Get the absolute difference of the last two integers
     v           \   Send this to the second stack
      .          \   Pop the last item

        O        \ Go to the second stack (list of differences)
         g       \ Sort ascendingly (largest item last)
          2<#    \ Check if it is smaller than 2 (print 1/0 accordingly)

PHP, 85 bytes
function a($p){$r=1;foreach($p as$k=>$q)if($p[$k+1]&&abs($p[$k+1]-$q)>1)$r=0;echo$r;}

Try it online!
It can probably be golfed some more, but it's a start.

Try it online! (link in answer is broken)

Add++, 16 bytes
L,vbUÑ_€|2ª>

Try it online!
How it works
L,		; Create a lambda function
		; Example argument: 	    ['[1 2 3 4 3 4 5 5 5 4]']
	vbU	; Evaluate as list; STACK = [1 2 3 4 3 4 5 5 5 4]
	Ñ_	; Deltas;	    STACK = [1 1 1 -1 1 1 0 0 -1]
	€|	; Absolute values;  STACK = [1 1 1 1 1 1 0 0 1]
	2ª>	; All less than 2;  STACK = [1]

Regex (ECMAScript), 27 bytes
^(x(x*)(,(?=\2x?x?\b)|$))*$

Try it online!
Input is a list of positive unary numbers separated by ,. Each one is a string of xs whose length represents the number.
^
(
    x(x*)         # \2 = this element - 1
    # Assert that either the next element is in the range \2 to \2+2 inclusive,
    # or that we've reached the end and there are no more elements.
    (
        ,         # Skip to the next element
        (?=       # look ahead to the next element to make the following assertion:
            \2    # subtract \2 from it
            x?x?  # subtract any number from 0 to 2 from it
            \b    # assert that we matched the exact number
        )
    |
        $
    )
)*
$

Regex (ECMAScript), 21 bytes
\b(x+)(xx+,|,xx+)\1\b

Try it online!
Returns a non-match if the array is insignificant, and a match otherwise (i.e., its boolean result is inverted).
If this solution were converted to match=true logic, it would be ^(?!.*\b(x+)(xx+,|,xx+)\1\b) (28 bytes).
           # No anchor; can match starting anywhere
\b         # Assert word boundary, i.e. either the start of the string before
           # an "x", a position after an "x" and before a ",", a position
           # after a "," and before an "x", or the end of the string after an
           # "x".
(x+)       # \1 = any substring of "x"es
(
    xx+,   # 2 or more "x"es followed by ","
|          # or
    ,xx+   # "," followed by 2 or more "x"es
)
\1         # Match what was captured in \1
\b         # Assert word boundary

Desmos, 46 bytes
\left\{max(abs(n[2,...,n.length]-n))<2\right\}

View on Desmos!
This is a rare case where I think using \left\{\right\} is more efficient than not.

A few golfs: 31 bytes. Try It On Desmos!. Try It On Desmos! - Prettified

Vyxal, 5 4 bytes
¯vṅA

Try it Online!
¯vṅA
¯    # delta (consecutive diff)
 vṅ  # abs(a) ≤ 1
   A # all truthy?

-1 thx to @Sʨɠɠan

ȧ1≤ is just ṅ, or in this case, vṅ.

Pyth, 6 bytes
._MI.+

Test suite
Explanation:
._MI.+  | Full code
._MI.+Q | with implicit variables
--------+------------------------------------
    .+Q | Differences of the input
   I    | Is it invariant over:
._M     |  Replace each element with its sign

Rust, 43 bytes
|a|a.windows(2).all(|s|(s[1]-s[0]).abs()<2)

Try it online!
A fn(&[i8])->bool.

Hmm, could you point me to meta consensus on an external type annotation being allowed?

@Maya https://codegolf.meta.stackexchange.com/questions/25156/should-rust-anonymous-functions-fully-specify-parameter-types

@chunes That seems to be about the case when the examples themselves disambiguate it.

@Maya We have a clear answer on that about Java and C#, which IMO applies just as well to Rust https://codegolf.meta.stackexchange.com/questions/11223.

@Maya But you're right that for the purpose of documentation, it's better to put the type in the answer.

@corvus_192 ah, thanks!

Pip, 11 bytes
2>M:BAD_MPg

Attempt This Online!
Explanation
2>M:BAD_MPg
          g  ; List of command-line arguments
        MP   ; Map to each pair of adjacent elements:
     AD      ;  Absolute difference between
    B        ;  the second and
       _     ;  the first
  M:         ; Get the max of that list
2>           ; 1 (truthy) if the max is less than 2; 0 (falsey) otherwise

Thunno, \$ 7 \log_{256}(96) \approx \$ 5.76 bytes
z[ZA2<P

Attempt This Online!
Outputs 0 for False and 1 for True.
Explanation
z[ZA2<P  # Implicit input
z[       # Differences of the input
  ZA     # Absolute value of each
    2<P  # Are they all less than 2?
         # Implicit output

Excel, 35 33 bytes
=AND(ABS(DROP(ζ,1)-DROP(ζ,-1))<2)

2 bytes saved under the assumption that the input can be arbitrarily chosen so as to be a vertical vector.

Welcome to Code Golf, and nice answer!

Pyt, 5 bytes
₋Å2<Π

Try it online!
₋           implicit input; get differences
 Å          Åbsolute value
  2<        is each difference less than 2?
    Π       product; implicit print

Nekomata + -e, 4 bytes
∆A2<

Attempt This Online!
∆A2<
∆       Differences
 A      Absolute value
  2<    Is less than 2?

Nekomata + -e, 4 bytes
∆:±=

A port of @Mr. Xcoder's Pyth answer.
Attempt This Online!
∆:±=
∆       Differences
 :      Duplicate
  ±     Sign
   =    Equal?

Lua, 57 bytes
for i=2,#arg do b=b or 1<(arg[i]-arg[i-1])^2 end print(b)

Try it online!
Outputs false if the array is insignificant, or true if it is not.

Python 3, 54 bytes
2 bytes thanks to Jonathan Frech.
lambda a:all(-2<a[i]-a[i+1]<2for i in range(len(a)-1))

Try it online!

abs(a[i]-a[i+1])<2 -> -2<a[i]-a[-~i]<2.

Clojure, 36 bytes
#(every? #{-1 0 1}(map - %(rest %)))

Try it online!

8th, 66 49 55 bytes
Code
1 >r ( n:- abs dup 1 > if rdrop 0 >r then ) a:y drop r>

SED (Stack Effect Diagram) is: a -- f
Explanation
This code leaves 1 on TOS if array is insignificant, otherwise it leaves 0. Here the ungolfed version:
1 >r                                           \ suppose array is insignificant
( n:- n:abs dup 1 n:> if rdrop 0 >r then ) a:y \ compute corresponding (absolute) differences and check if difference is > 1
drop r>                                        \ clean stack and put result on TOS

We could immediately exit from loop with break when array is significant, but in this case we waste 6 bytes.

Python 3, 49 bytes
lambda l:all(abs(j-i)<=1 for i,j in zip(l,l[1:]))

Unfortunately, this doesn't work for arrays like [1, 1, 3].

Great catch on that edge case!! Updated with another answer. @Dennis

Pyth, 15 12 bytes
Works pretty simply. T or 10 as a boolean is True
V.+Q=&T<N2)T

Explanation:
V.+Q        In the difference map of the input...
    =&T<N2) T = T && the current item is less than 2, and close the loop
T           Print J

Test Suite

Scheme - 89 bytes
(define (f n) (if (not (empty? n)) (and (<= (abs (- (cadr n) (car n))) 1) (f (cdr n))) 1)

Casio-Basic, 28 bytes
judge(max(abs(⊿list(n)))<2

It's nice that the fx-CP400 has a built-in for cumulative differences. Not so nice that you need to use judge to force it to check whether the resulting value is less than 2.
27 bytes for the function (⊿ is two bytes), +1 to enter n in the argument list.

If Jelly uses Unicode characters and just count 1 byte, why wouldn't ⊿ also count just 1 byte?

@LS_ᴅᴇᴠ If by "Unicode" you mean UTF-8, most Jelly programs don't use UTF-8.

@LS_ᴅᴇᴠ Jelly uses its own code page, as linked in the comment above, which means that every single character used in the language counts as one byte, even if it's two in Unicode. On the Casio ClassPad, that character has a character code above 256, which makes it a two-byte character.

@Jordan Yes, you are right, I read something more about Jelly and get it!

It should be measured by how many bytes it takes on the calculator. Which if it's tokenized, could be much less than 26 bytes.

Pxem, Filename: 40 bytes + Content: 0 bytes = 40 bytes.

Filename (escaped): ._\001.-.c._.t.w\001.-._.c.m.-\001.x.d.a.t.c.aY.o
Content: empty

Usage
Input is from STDIN; output from STDOUT.
First positive integer N for input represents number of items in list.
Then integers c1, c2, ..., cN represents each item of the list.
Each input has to be separated by one or more s.
An output of Y represents truthy, and no output falsey.
Input example
List [1, 2, 3, 4, 3, 4, 5, 5, 5, 4] is:
10
1 2 3 4 3 4 5 5 5 4

With comments
XX.z
.a._\001.-.cXX.z # push N; decrement it
.a._.tXX.z # push c1; heap<-c1
.a.w\001.-XX.z # while N!=0; do N--
  .a._.c.m.-\001.xXX.z # push ci; if abs(ci-heap); then
    .a.dXX.z # exit
  .a.aXX.z # fi
  .a.tXX.z # heap=ci
.a.c.aXX.z # done
.aY.oXX.z # putchar o
.a

Link
Try it online!

Factor, 28 bytes
[ [ - [-1,1]? ] monotonic? ]

Try it online!
monotonic? is a combinator that tests if a quotation returns true for every pair of adjacent elements in a sequence.

- Subtract.
[-1,1]? Is it between -1 and 1 inclusive? (This is just the name of a word, like most everything in Factor.)

Arturo, 36 bytes
$[a][n:a\0every? a'x[2>abs n-x n:x]]

Try it

Stax, 8 bytes
┘ε≡}◄ï╖Z

Run and debug it
Link includes all test cases.
Unpacked:
Stax, 10 bytes
:-{|a2<m:*

Run and debug it
:-          # pairwise differences/deltas
  {     m   # mapped by
   |a       # absolute value of n
     2<     # is less than 2
         :* # product of array (essentially all(a))

Kamilalisp, 31 bytes (APL385 SBCS)
$(∧?∘⌹‡⍡ 2 $(> 2)∘abs∘$(⌿⊙← -))

Attempt This Online!

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
2 plus 2 equals fish!
Thank you for you help fixing my calculator's multiply function, but I've found another critical error all calculators seem to share. None of them understand that 2+2=fish. So now I need code to properly add 2 numbers.
Challenge

Take 2 numbers as input (Type doesn't matter, but only 2 items will be passed. This is addition, so order obviously doesn't matter.)
Output sum of both numbers except if they are both 2, then output fish (case insensitive)

PS. I never was really good with counting, so I think only Integers from 0 to 99 are real numbers (Type used doesn't matter)

Fewest bytes per language wins!

(NOTE: The key difference between this challenge and the previous, is that order is now irrelevant, and the return type is not restricted to int, which has major implications for type safe languages like Java. You can also see in the answers already here that in non type strict languages like Python, this rule set can dramatically change the answer code.)

Not sure why this is getting reopen votes - this is clearly a duplicate.

@DigitalTrauma It's a fuzzy line between duplicate, and sufficiently different to be interesting. While answers from the other question COULD be altered to answer this one as well, most of them will not be winning answers. I'm guess the side of the line people are on might be based on if they think they know how they could do it better under these new conditions.

[...] has major implications for type safe languages like Java. I don't think making I/O more annoying is a good thing. It certainly doesn't prevent the challenge from being a duplicate.

@Dennis The fact that this got enough votes to reopen means that a number of people disagree that this is a duplicate. And it's called a "challenge" for a reason, little changes in the obstacles can require dramatically different solutions. So I don't think you can really complain about the added challenge. Compare the 2 answers here to the same language solutions in the other challenge to prove my point.

Python 2, 33 bytes
lambda x,y:x==y==2and"fish"or x+y

Try it online!

32 bytes

C (gcc), 30 bytes
f(x,y){x=x^y&&x^2?x+y:"fish";}

Try it online!

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Draw an S-Chain
Background
When I was younger, I was taught a method of drawing a weird "S" shape, that I (along with my classmates) found fascinating. Today, I rediscovered it, and due to its formulaic approach to drawing it, thought it could lead to an interesting challenge :P
Drawing the "S"
The S can be drawn by following these simple steps:
First, draw 2 rows of three vertical lines like so
| | |

| | |

Next, connect the top left line with the bottom middle line and the top middle with the bottom right line to produce
| | |
 \ \
| | |

Finally, draw a top and bottom on the currently drawn image so that it ends up looking like
  ^
 / \
| | |
 \ \
| | |
 \ /
  v

As you can see, this results in an "S" shape. When extended however (drawing it with more than 2 rows), it produces a very interesting pattern. Your task is reproduce this interesting pattern.
Task
Given an integer where n >= 2, output The S with n rows to be made from it. Output may be returned from a function, and input may be taken in standard methods. Trailing/leading whitespace for both the overall image, as well as each line, is fine. However, leading line spaces must be consistent so that the " isn't broken. You may output as a list of lines.
Test cases
input
output
---

2

  ^
 / \
| | |
 \ \
| | |
 \ /
  v

---

8
  ^
 / \
| | |
 \ \
| | |
 \ \
| | |
 \ \
| | |
 \ \
| | |
 \ \
| | |
 \ \
| | |
 \ \
| | |
 \ /
  v

---

10

  ^
 / \
| | |
 \ \
| | |
 \ \
| | |
 \ \
| | |
 \ \
| | |
 \ \
| | |
 \ \
| | |
 \ \
| | |
 \ \
| | |
 \ \
| | |
 \ /
  v

This is a code-golf so shortest code wins! Good luck,

Wikipedia calls the S the Cool S, and calls an infinite version of the an S Chain

Can we output as a list of lines?

@Mr.Xcoder you may

@Stephen 10 minutes googling and this didn't come up. I'll edit the name of the question

@cairdcoinheringaahing I searched images, that might have been it :P

I guess that leading spaces which break the shape of the S aren't allowed, right?

@EriktheOutgolfer yes, I'll edit that in

There are probably better UTF-8 chars to display the cool S, especially than v and ^.

@EricDuminil yes, but they are most likely multi byte characters, which I'm reluctant to add as it means that languages that don't support those characters can't do the challenge as succinctly

@cairdcoinheringaahing: Fair point.

Python 2, 47 bytes
lambda k:'  ^\n / '+'\\\n| | |\n \ '*k+'/\n  v'

Try it online!

C# (.NET Core), 73 69 66 64 62 bytes
Two less bytes and perl-like appearance thanks to Barodus. Didn't think of using int? for nulls.

n=>$@"  ^
 / {string.Join(@"\
| | |
 \ ",new int?[++n])}/
  v"

Try it online!

If this was a golf of the existing C# answer, I'd never have been able to tell. Well done :-)

Can you explain what the new string[n+1] does? I have never seen it before.

Creates a array of empty strings AFAIK. I've used a hack with string.Join, aka join {"","","",""} with separator "\ \n | | | \n "

@someone Woah, I never acknowledged this trick before. Really cool! (Also my bad, i though the  new string[n+1] was some kind of tricky string constructor and not an array declaration -.-)

SOGL V0.12, 26 25 18 bytes
°I-‘*"∑ūCƨΩ)¹‘@∑5n

Try it Here!
Uses the same strategy as ETHproductions's Japt answer
Explanation:
..‘           push "\|||\"
   *          repeat input times
    "..‘      push " ^ /ŗ/ v ", with ŗ replaced with POP. The reason why there's a trailing
              space is because otherwise it didn't have enough repeating characters to compress
        @∑    join with spaces
          5n  split to line lengths of 5

push "|" and " " what the heck is that builtin

@StevenHewitt those are actually two built-ins, but I joined them together (as I do with other stuff) because I don't think it's not necessary to separate stuff that gets used together soon

Python 3, 48  56 59 61  bytes
lambda k:'  ^\n / %s/\n  v'%('\\\n| | |\n \ '*k)

Try it online!

You can save 2 bytes by unescaping the lone backslashes.

@L3viathan Just updating too

56 bytes; not sure if this is fair game; doesn't work on TIO

@L3viathan That is not correct. Extra \ \.

On TIO: yes. In my terminal: no.

@L3viathan I'll stick with my current solution, thanks though!

05AB1E, 27 26 bytes
…^
/ð"\
| | |
\ "I×…/
vJ.c

Try it online!
Alternate 27 byte version
'^…/ \©IF…| |û…\ \}\®R'v».c

Try it online!
Explanation
'^                             # push "^"
  …/ \©                        # push "/ \" and store a copy in register
       IF                      # input times do:
         …| |û                 # push "| | |"
              …\ \             # push "\ \"
                  }            # end loop
                   \           # discard top of stack (the extra "\ \")
                    ®R         # push "/ \" reversed = "\ /"
                      'v       # push "v"
                        »      # join stack on newlines
                         .c    # center each row

Your code looks a bit like an elephant to me :)

It's literally SCARY how close my answer was to yours: '^…/ \©IF„| ûû„\ û}\®R'v).C without looking.

Japt, 34 25 23 bytes
" ^ /{ç'\²i|³1}/ v"¬¸ò5

Test it online! Outputs as an array of lines; -R flag added to join on newlines. (Thanks @Shaggy)
First Second attempt, might be improvable...
How it works
" ^ /{ ç'\²  i |³  1}/ v"¬ ¸  ò5
" ^ /{Uç'\p2 i'|p3 1}/ v"q qS ò5   Ungolfed
                                   Implicit: U = input number
        '\p2                       Repeat a backslash twice, giving "\\".
             i     1               Insert at index 1
              '|p3                   3 vertical bars. This gives "\|||\".
      Uç                           Make U copies of this string. U = 2: "\|||\\|||\"
" ^ /{              }/ v"          Insert this into this string.    " ^ /\|||\\|||\/ v"
                         q qS      Split into chars; join on spaces."  ^   / \ | | | \ \ | | | \ /   v"
                              ò5   Split into rows of length 5.    ["  ^  "," / \ ","| | |"," \ \ ","| | |"," \ / ","  v"]
                                   Joining on newlines gives "  ^
                                                               / \
                                                              | | |
                                                               \ \
                                                              | | |
                                                               \ /
                                                                v"

Beating Charcoal and tying SOGL? Excellent work!

You can output an array of lines, by the way, so you can ditch the last 2 characters.

@Shaggy That's great, now we're winning!

We've been doing well lately :)

JavaScript (ES6), 60 bytes
n=>`  ^
 / \\
${`| | |
 \\ \\
`.repeat(n-1)}| | |
 \\ /
  v`

Test Snippet

let f=
n=>`  ^
 / \\
${`| | |
 \\ \\
`.repeat(n-1)}| | |
 \\ /
  v`
;(I.oninput=_=>O.innerHTML=I.value+"\n"+f(+I.value))()
<input id=I type=range min=2 max=15 value=2>

57: n=>'  ^\n /${' \\ \\\n| | |\n'.repeat(n).slice(2)} \\ /\n  v' (using backticks and literal newlines)

Beat me by 1 bytes :(

Charcoal, 27 26 25 bytes
-1 byte thanks to Carlos Alejo. -1 byte thanks to ASCII-only.
  ^⸿ / ×\⸿| | |⸿ \ Ｎ/⸿  v

Try it online! Link is to verbose version. #charcoal-verbose-obfucation

You can save 1 byte by just calling Print (instead of adding the strings) and using \r:   ^⸿ / ×\⸿| | |⸿ \ Ｉθ/⸿  v. Verbose version.

Ah... I'll have to remember \r as the way to get newlines the sane way. Thanks!

25 bytes

@ASCII-only :P -

C (gcc), 82 bytes
f(n){for(puts("  ^\n / \\");--n;puts("| | |\n \\ \\"));puts("| | |\n \\ /\n  v");}

Try it online!

Perl 5, 39 37 bytes
say"  ^
 / ".'\
| | |
 \ 'x<>."/
  v"

Try it online!
Shaved two bytes with @DomHastings' suggestion

If you use single quotes, you don't need to escape the backslashes for -2! :)

Actually, 49 bytes
"| | |"@α;lD" \ \"@α@Z♂ii"  v"" \ /"))" / \""  ^"

Try it online!
Explanation:
"| | |"@α;lD" \ \"@α@Z♂ii"  v"" \ /"))" / \""  ^"
"| | |"@α                                          push a list containing n copies of the vertical lines
         ;lD" \ \"@α                               push a list containing n-1 copies of the diagonal connections
                    @Z♂i                           interleave
                        i                          flatten
                         "  v"" \ /"))             make the bottom
                                      " / \""  ^"  make the top

05AB1E, 38 bytes
…| |ûU"  ^
 / \"XI<F„ \2×X}" \ /
  v"»

Try it online!
…| |                         # Push "| |"
    û                        # Palindromize
     U                       # Store in X
      "..."X                 # Push the top three rows
            I<F      }       # One less than input times do:
               „ \           #   Push " \"
                  2×         #   Concatenate that with itself
                    X        #   Push "| | |"
                      "..."  # Push the last two rows
                           » # Join stack with newlines

C# (.NET Core), 101 77 73 bytes
Saved 24 bytes thanks to i cri everytim!
Saved 4 bytes thanks to Kevin Cruijssen!
n=>{var s="  ^\n / ";for(;n-->0;s+="\\\n| | |\n \\ ");return s+"/\n  v";}

Try it online!
As per usual, string repeating in C# is a pain.

77 bytes.

@icrieverytim Ahhh, of course, thats way better.

You can change --n>=0 to n-->0 and s+="/\n  v";return s; to return s+"/\n  v"; to save some bytes.

@KevinCruijssen Thanks, fixed!

Retina, 38 bytes
.+
$*
1
¶|||¶x\\
^
 ^¶x/\
.$
/¶ v
x?

Try it online!
Prints a column of leading spaces and on trailing space on each line.
Explanation
The main byte savings come from omitting the spaces in all the literal parts and inserting them at the end. The figure is structured such that there are never two non-spaces next to each other, so if we just remove them all, we can almost fix the shape by inserting a space at every position at the end:
^
/\
|||
\\
|||
\/
v

becomes:
 ^
 / \
 | | |
 \ \
 | | |
 \ /
 v

That's almost correct, except for indentation. The ^ and v are missing two spaces. That's actually easier to fix, because if we just insert an explicit space in front of each of them, that'll result in two additional spaces at the end. The lines with the slashes are trickier because they require just one additional space. To fix this, we insert a placeholder character there (x). When we insert the spaces at the end, we don't just insert them for every empty match, but we optionally match that x. That means instead of inserting a space in front of the x, the x itself gets replaced. And then there will still be an empty match right after the x. That means, every x adds exactly one space without changing anything else. So what we want to set up is this:
 ^
x/\
|||
x\\
|||
x\/
 v

which will give us the desired result. So here's the code:
.+
$*

Convert the input to unary.
1
¶|||¶x\\

Convert each 1 to two lines with ||| and x\\ (and a leading linefeed).
^
 ^¶x/\

Inser the first two lines with ^ and x/\.
.$
/¶ v

Fix the final x\\ by turning the last \ into / and appending a line with the v.
x?

Replace each x or empty match with a space.

Neat approach. I was trying to figure out a way to use join-on-spaces for my Pip solution, but it didn't quite work due to the different numbers of leading spaces on different rows.

Stax, 21 20 bytes
⌐èüYΩ╜yu╝√♪╪▌yº⌐▌2Σ⌠

Run and debug it
Uses ETHProductions' idea.
-1 after changing 1/ to M (from recursive).

Pyth, 46 bytes
"  ^
 / \\"
+*j[jd*\|3" \ \\"k))Q" \ /
  v

Test suite.

36 bytes: %"  ^\n / %s/\n  v"*Q"\\\n| | |\n \

31 bytes.

Pyth, 40 bytes
K" / \ ""  ^"Kj+b+*2+d\\b*Q]*3"| "_K"  v

Fairly similar to Steven Hewitt's, but developed independently.
Try it Online
Explanation
K" / \ ""  ^"Kj+b+*2+d\\b*Q]*3"| "_K"  v
K" / \ ""                                 Set K = " / \ "
        "  ^"                       "  v  Draw the end points.
             K                    _K      Draw the slants.
                         *Q]*3"| "        Draw the vertical bars...
              j+b+*2+d\\b                 ... interspersed with slants.

Pyth, 33 32 31 bytes
Thanks Mr. Xcoder for one byte.
%"  ^
 / %s/
  v"*tj\|_B" \\
|

Try it online: Demonstration or Test Suite

Very nice answer! You can bring it down to 32 bytes.

31 bytes, in fact.

Retina, 45 bytes
This is a pretty simple solution.
.+
$*
^1
  ^¶ /x
$
 \ /¶  v
1
 \x
x
 \¶| | |¶

Try it online
If the art could be 1-indexed instead, it'd be a bit shorter (44 bytes):
.+
  ^¶ /x$0$*1
$
 \ /¶  v
1
 \x
x
 \¶| | |¶

Pip, 45 42 33 bytes
"  ^
 / "."\
| | |
 \ "Xa."/
  v"

Try it online!
Explanation
The code is really simple, though the newlines make it harder to read. Here's a better way to see the structure:
"prefix" . "repeated" X a . "suffix"

The repeated element in the S-chain is
   \
| | |
 \

Take this as a literal string and repeat it a times (where a is the first command-line argument). Then prepend the prefix:
  ^
 /

and append the suffix:
   /
  v

and print.
(I like how this ended up looking kinda like a ><> program.)

This looks like Lumpy Space Princess from Adventure Time :)

MATL, 47 44 43 bytes
-3 bytes thanks to Giuseppe
'  ^' ' / \ 'XK'| | |'XJGq:"' \'thJ]KP'  v'

Try it online!

'  ^' ' / \ 'XK'| | |'XJ\' \ 'JGq@-]KP'  v'` is 44 bytes.

AsciiDots, 88 bytes
.*$"  ^"$" / \"
/>#?)--*$"| | |"$" \ \"
*#1\ /-~$"| | |"$" \ /"$"  v"
*-{-}*[<]
\#0----/

Try it online!

bash, 67 bytes
printf -v a %\*s $1 \ ;echo '  ^
 / '"${a// /\\
| | |
 \\ }"'/
  v'

Try it online

Ruby, 39 bytes
->n{"  ^
 / #{"\\
| | |
 \\ "*n}/
  v"}

Try it online!

///, 54 bytes
/*/
| | |
b//b>///b/ \\\\ \\\\/  ^
 \/ \\**> \\ \/
  v

Try it online!
For input, change the number of asterisks
 \/ \\**> \\ \/
      ^^

How does this take input? Changing the "Input" field on TIO does nothing

I forgot about that, it takes input in unary. You change the number of asterisks in the middle, the one in the example is 2.(technically I could delete them to save 2 bytes but i dont care)

PowerShell, 83, 57 bytes
"  ^
 / \"
1..--$args[0]|%{"| | |
 \ \"}
"| | |
 \ /
  v"

Try it online!
Per @AdmBorkBork's suggestions,

Simplified for by using a number range.
Replaced ;'s and combined strings.
Removed an unnecessary variable definition.

You can golf your for loop a lot by using 1..--$args[0]|%{ }.

Also, you can use literal newlines between the adjacent strings to save on ";" and it's cheaper to get rid of $s entirely. 57 bytes

Slick. I like the newline save. Funny that I missed the 1..$args opportunity. I'm not sure what the correct etiquette is on this site. Do I make changes to my answer and credit you, or do you post your solution as a separate answer?

Editing in the changes and giving credit is the proper etiquette. Welcome to PPCG.

Haskell, 53 bytes
f n="  ^\n /"++([1..n]>>" \\\n| | |\n \\")++" /\n  v"

Try it online!

Batch, 109 bytes
I believe this isn't completely golfed yet.
@echo   ^^
@echo  / \
@for /l %%G in (2,1,%1)do @echo ^| ^| ^|&@echo  \ \
@echo ^| ^| ^|
@echo  \ /
@echo   v

This script just:

Output the top of the Cool S
Loop n times the chain body
Output the bottom of the Cool S

Java 8, 93 76 bytes
n->{String r="  ^\n / ";for(;n-->0;r+="\\\n| | |\n \\ ");return r+"/\n  v";}

Port of @IanH.'s C# .NET answer after I golfed it a bit more.
Try it here.

It's funny how this is almost exactly identical expect for the string vs var part.

@IanH. And the n-> vs n=> ;)

Excel, 60 bytes
="  ^
 / \
"&REPT("| | |
 \ \
",A1-1)&"| | |
 \ /
  v"

You should consider checking to see if this is a polyglot with Google Sheets

SpecBAS - 74 bytes
1 INPUT n
2  ?"  ^"'" / \"'("| | |"#13" \ \"#13)*(n-1);"| | |"'" \ /"'"  v"

Apostrophe moves to next line, but doesn't work inside the string being repeated, so have to use #13 to insert line feeds in that part.

QBIC, 48 bytes
?@  ^`?@ / \ `[:|?@| | |`~a=b|?_fB|?@  v`\?@ \ \

Explanation
Note that every '?' inserts a linebreak
Also note that @...` creates a string literal and assigns that to A$, B$, ... Z$
?@  ^`      print ^ prefixed with 2 spaces
?@ / \ `    print the other start bit, pre- and postfixed with spaces
[:|         FOR a = 1 to (chain-length given as cmd line param, read as 'b')
?@| | |`    PRINT the pipes
~a=b|       IF we are in the last iteration THEN
?_fB|           print the reversed of B$
                    _f...| flips a string
                    B$ holds " / \ ", which reversed is " \ / "
?@  v`          and print "  v"
\           ELSE
?@ \ \          print the connector to the next section
The final string lit, the IF and the FOR are auto-closed at EOF

Jelly, 32 bytes
Boring port of Lynn's Python solution.
“\¶| | |¶ \ ”ẋṭ“  ^¶ / ”;“/¶  v”

Try it online!
Explanation:
“\¶| | |¶ \ ”ẋṭ“  ^¶ / ”;“/¶  v”    Example input: 5
“\¶| | |¶ \ ”                       Literal string "\¶| | |¶ \ " (¶ = newline). Result: "\¶| | |¶ \ "
             ẋ                      Repeat as many times as the (implicit) input. Result: "\¶| | |¶ \ \¶| | |¶ \ \¶| | |¶ \ \¶| | |¶ \ \¶| | |¶ \ "
              ṭ                     Tack that on the end of...
               “  ^¶ / ”            ...the string "  ^¶ / ". Result: "  ^¶ / \¶| | |¶ \ \¶| | |¶ \ \¶| | |¶ \ \¶| | |¶ \ \¶| | |¶ \ "
                        ;           Append...
                         “/¶  v”    The string "/¶  v". Result: "  ^¶ / \¶| | |¶ \ \¶| | |¶ \ \¶| | |¶ \ \¶| | |¶ \ \¶| | |¶ \ /¶  v"
                                    Implicit print

R, 90 bytes
function(n){cat('  ^
 / \\
| | |
')
for(i in 2:n-1)cat(' \\ \\
| | |
')
cat(' \\ /
  v
')}

Try it online!
pretty lame, but this is the best we've got to work with in R.

Retina, 37 bytes
.*
$*
1
\¶| | |¶ \
^
  ^¶ /
$
/¶  v

Try it online!
I must be missing something, this is a super basic approach...

You did only outgolf Martin by 1 byte, so you probably aren't missing something

Actually, 30 bytes
This works on the same principle as ETHproductions's Japt answer, where extra spaces are added later, and the whole string is split into rows of 5 for implicit printing. Try it online!
"\|||\"*" ^ /"+"/ v"@+#' j5@╪i

Ungolfing
            Implicit input.
"\|||\"*    Add the middle portion and multiply that by the input.
" ^ /"+     Append the top.
"/ v"@+     Append the bottom.
#           Convert into a list of strings
' j         Join with spaces.
5@╪         Split into a list of length-5 strings.
i           Flatten list onto the stack for implicit printing with newlines.

Nice job outgolfing Mego in his own language!

Jelly, 25 23 bytes
This works on the same principle as ETHproductions's Japt answer, where extra spaces are added later, and the whole string is split into strings of length 5 before printing. Try it online!
Edit: I knew there was a way to join the top and bottom of the S-chain in a golfier way. Thanks to Erik the Outgolfer for -2 bytes.
“\|||\”ẋ“ ^ /“/ v”jKs5Y

Ungolfing
                Left argument: n
“\|||\”ẋ        Repeat the middle portion n times.
“ ^ /“/ v”j     Append the top and bottom.
K               Join with spaces.
s5              Split into a list of length-5 strings.
Y               Print the strings with linefeeds.

“\|||\”ẋ“ ^ /“/ v”jKs5Y

Excel VBA, 71 Bytes
Anonymous VBE immediate window function that takes input from cell A1 and outputs to the VBE immediate window
a="| | |":?"  ^":?" / \":For i=2To[A1]:?a:?" \ \":Next:?a:?" \ /":?"  v

Charcoal, 25 bytes
↘^\¶/¶Ｇ→⁵↓⊕⊗Ｎ←⁵|¶ \↗¶\¶v/

Try it online! Link is to verbose version of code.

Funny how the other Charcoal answer is the same byte-count by using an completely different approach. I like yours more, though. The other is close to hard-coded, but yours is actually using Charcoal's strength.

@KevinCruijssen You say strength, but that should really be printing diagonally; sadly the best I could do there was 29 bytes: ↘^\|¶/|\|¶|Ｆ⊖Ｎ↘\|\|¶|↘\|/¶|\v

J, 51 50 48 bytes
'  v',~'  ^','/'(0 1;_1 3)}' \ \ | | |'$~5,~1++:

Try it online!

PHP, 73 bytes
<?='  ^
 / \
'.join('
 \ \
',array_fill(0,$argv[1],'| | |')).'
 \ /
  v';

Try it online!

05AB1E, 22 bytes
…\||û×" ^ /ÿ/ v"Sðý5ô»

Try it online!
…\||û×" ^ /ÿ/ v"Sðý5ô»  # full program
                     »  # split...
      " ^ /ÿ/ v"        # literal...
                        # (implicit) with ÿ replaced by...
…\||                    # literal...
    û                   # concatenated with...
…\||                    # literal...
    û                   # reversed excluding the first character...
     ×                  # repeated...
                        # implicit input...
     ×                  # times...
                  ý     # with each...
                S       # character...
                  ý     # joined by...
                 ð      # spaces...
                     »  # into rows...
                    ô   # of length...
                   5    # literal
                        # implicit output

x86_16 machine code - 76 bytes
8B CB         MOV CX, BX
49            DEC CX
B4 09         MOV AH, 09H
           ATAS:
BA 02 01      MOV DX, OFFSET RANTAI_S_1
CD 21         INT 21H
85 C9         TEST CX, CX
74 09         JE BAWAH
          .LOOP:
BA 15 01      MOV DX, OFFSET RANTAI_LOOP
CD 21         INT 21H
E3 02         JCXZ BAWAH
E2 F7         LOOP .LOOP
          BAWAH:
BA 23 01      MOV DX, OFFSET RANTAI_S_2
CD 21         INT 21H
          EXIT:
B8 00 4C      MOV AX, 4C00H
CD 21         INT 21H

RANTAI_S_1      DB 020H, 020H, 05EH, 00AH, 00DH, 020H, 02FH, 020H, 05CH
                DB 00AH, 00DH, 07CH, 020H, 07CH, 020H, 07CH, 00AH, 00DH
                DB 024H

RANTAI_LOOP     DB 020H, 05CH, 020H, 05CH, 00AH, 00DH, 07CH, 020H, 07CH
                DB 020H, 07CH, 00AH, 00DH, 024H

RANTAI_S_2      DB 020H, 05CH, 020H, 02FH, 00AH, 00DH, 020H, 020H, 076H
                DB 024H

Tested on DOSBox

CSASM v2.1.2.3, 130 bytes
By far the shortest answer I'll submit with this language. (Probably)
Hooray for builtins!
func main:
in ""
conv i32
pop $a
push "  ^\n / \\\n| | |\n"
push " \\ \\\n| | |\n"
push $a
push 1
sub
mul
add
push " \\ /\n  v"
add
print
ret
end

Commented and ungolfed:
func main:
    ; Get the input, convert it to an integer and store it in the accumulator
    in ""
    conv i32
    pop $a

    ; Push the first three rows of the chain
    push "  ^\n / \\\n| | |\n"

    ; Push the next two rows of the chain
    push " \\ \\\n| | |\n"

    ; Duplicate those two rows ($a - 1) times
    push $a
    push 1
    sub
    mul

    ; Append the duplicated rows to the first three rows
    add

    ; Push the final 2 rows
    push " \\ /\n  v"

    ; Append them
    add

    ; Print the result string on the stack
    print
    ret
end

Pyth, 28 bytes
jcjd++" ^ /"*Q"\|||\\""/ v"5

Test suite
Translation of Sherlock9's Jelly answer.

Canvas, 22 bytes
| | |¶\ \＊ｋ^¶/ \：↕└∔∔ｒ

Try it here!

Explanation:
Code                       # Explanation               # Stack visualization
#############################################################################################
                           # Stack starts with input   # <input>
| | |¶\ \                  # Push string literal       # <input>, | | |¶\ \
         ＊                # Repeat vertically n times # | | |¶\ \...| | |¶\ \
           ｋ              # Remove last line          # | | |¶\ \...| | |
             ^¶/ \         # Push string literal       # | | |¶\ \...| | |, ^¶/ \
                  ：       # Duplicate TOS             # | | |¶\ \...| | |, ^¶/ \, ^¶/ \
                    ↕      # Mirror vertically         # | | |¶\ \...| | |, ^¶/ \, \ /¶v
                     └     # Swap 2nd and 3rd in stack # ^¶/ \, | | |¶\ \...| | |, \ /¶v
                      ∔    # Add vertically            # ^¶/ \, | | |¶\ \...| | |¶\ /¶v
                       ∔   # Add vertically            # ^¶/ \¶| | |¶\ \...| | |¶\ /¶v
                        ｒ # Center each line          #   ^¶ / \¶| | |¶ \ \...| | |¶ \ /¶  v
                           # Print TOS                 #

¶ represents a newline in the stack visualization.

GolfScript, 46 bytes
~['
| | |
']*' \\'2**' \\ /
  v'+
'  ^
 / \\'\

Try it online!

Vyxal, 24 bytes
`\||`∞*` ^ /`p`/ v`JṄ5ẇ⁋

Try it Online!


text:
Fill in the Blanks, Please!
(No, not this nor any of these)
Given a string and a list of strings, fill in the all blanks in the input string with corresponding strings.
Input/Output
The input string contains only alphabetic characters, spaces, and underscores. It is nonempty and does not start with an underscore. In other words, the input string matches the regex ^[a-z A-Z]([a-z A-Z_]*[a-z A-Z])?$
Every string in the input list is nonempty and contains only alphanumeric characters and spaces. In other words, they match the regex ^[a-z A-Z]+$.
A blank is a contiguous sequence of underscores (_) which is neither preceded nor proceeded by an underscore.
The input string contains n blanks for some positive integer n, and the list of strings contains exactly n strings.
The output is obtained by replacing each k-th blank in the input string by the k-th string in the input list of strings.
Example
Given an input string "I like _____ because _______ _____ing" and a list of strings ["ice cream", "it is", "satisfy"], we can find the output as follows:

The first blank comes directly after "like ". We fill that in with "ice cream" to get "I like ice cream because ______ _____ing".
The second blank comes directly after "because ". We fill that in with "it is" to get "I like ice cream because it is _____ing".
The third blank comes directly after "is ". We fill that in with "satisfy" to get "I like ice cream because it is satisfying".

We output the final string "I like ice cream because it is satisfying".
Test Cases

input string, input list => output
"Things _____ for those who ____ of how things work out _ Wooden",["work out best","make the best","John"] => "Things work out best for those who make the best of how things work out John Wooden"
"I like _____ because _______ _____ing",["ice cream","it is","satisfy"] => "I like ice cream because it is satisfying"
"If you are ___ willing to risk _____ you will ha_o settle for the ordi_____Jim ______n",["not","the usual","ve t","nary ","Roh"] => "If you are not willing to risk the usual you will have to settle for the ordinary Jim Rohn"
"S____ is walking from ____ to ____ with n_oss of ___ W_____ Churchill",["uccess","failure","failure","o l","enthusiasm","inston"] => "Success is walking from failure to failure with no loss of enthusiasm Winston Churchill"
"If_everyone_is_thinking ____ ____ somebody_isnt_thinking G____e P____n",[" "," "," ","alike","then"," "," ","eorg","atto"] => "If everyone is thinking alike then somebody isnt thinking George Patton"
"Pe_________e __say ____motivation does__ last Well___her doe_ bathing____thats why we rec____nd it daily _ __________lar",["opl","often ","that ","nt"," neit","s","  ","omme","Zig","Zig"] => "People often say that motivation doesnt last Well neither does bathing  thats why we recommend it daily Zig Ziglar"

Convex, 5 bytes
'_%.\

Try it online!
Convex is a CJam-based language, and this answer is almost the same as my CJam answer, except for l~ which is unneeded here, since Convex does automatic argument evaluation at the start of the program.
Explanation:
'_%.\ e# Full program only
'_    e# Push '_'
  %   e# Split and remove empty chunks
   .\ e# Vectorize by Swap

Japt, 8 bytes
r"_+"@Vv

Test it online!
I feel I missed some hidden catch in the rules because this is extremely simple: "replace each run of underscores in the string with the next item in the array."

JavaScript, 35 bytes
a=>b=>a.replace(/_+/g,a=>b.shift())

Try it online

Same thing I had. Alternatively, a=>b=>String.raw({raw:a.split(/_+/)},...b)

Ruby, 28 + 1 = 29 bytes
$_=gsub(/_+/){|i|gets[/.*/]}

Uses -p
The first line is the format string, the rest of the lines are the array.
Try it online!

Proton, 42 bytes
a=>b=>re.sub("_+",_=>b.pop(0),a)
import re

Try it online!
Stupid imports...
Same thing in python:
Python 3, 53 bytes
lambda a,b:re.sub("_+",lambda _:b.pop(0),a)
import re

Try it online!

...How did I frigging miss that. ._.

MATL, 9 bytes
'_+'i1&YX

Try it online!
Explanation
'_+'   % Push this string: regexp pattern
i      % Input cell array of replacement strings
1      % Push 1
&YX    % Four-input regexp replacement. This implicitly inputs the original
       % string, and consecutively replaces each first occurrence of the
       % regexp pattern in that string by one of the replacement strings.
       % Implicitly display

Jelly, 8 7 bytes
ṣ”_¬Ðfż

Try it online! Edit: Saved 1 byte thanks to @Erik the Outgolfer. Explanation:
ṣ”_         Split on underscores
   ¬Ðf      Discard empty values
      ż     Zip with second input
            Implicit concatenated output

CJam, 7 bytes
l~'_%.\

Try it online!
-1 thanks to a clever trick by Martin Ender.
Explanation:
l~'_%.\ e# Full program only
l       e# Input line
 ~      e# Eval
  '_    e# Push '_'
    %   e# Split and remove empty chunks
     .\ e# Vectorize by Swap

.\ instead of \]z.

@MartinEnder That works o_o

Sure, \ is a binary operator. :)

@MartinEnder Seems like I have gotten a bit too much in how mapping works in CJam then.

@MartinEnder OK on second thought how didn't I think of that? Not like I didn't know how mapping behaves e.g. [1 2 3]:_ -> [1 1 2 2 3 3] likewise for ....

Python 2, 61 bytes
import re
s,l=input()
for i in l:s=re.sub('_+',i,s,1)
print s

Try it online!
Damn.
Python 2, 63 bytes
import re
f=lambda s,l:l and f(re.sub('_+',l[0],s,1),l[1:])or s

Try it online!

60 bytes by passing re.sub a function

@Stephen Eh... That's just too close to your solution. I'll just stick to this and find more obscure solutions. :P

53 bytes by using a function to improve @Stephen's proposal.

@JonathanFrech yeah, but that's exactly my answer already :P

@Stephen Oh; did not see your answer... :d

Perl 5, 25 + 1 (-p) = 26 bytes
@a=eval<>;s|_+|shift@a|eg

Try it online!

Came up with basically the same, except using <> to negate the eval and shift: Try it online!. There's got to be a way to avoid the replacing the newlines...

This subroutine also has 26 bytes: sub{shift=~s|_+|shift|egr}. If you reversed the arguments, you could use pop and get it down to 22 bytes.

Pyth, 10 bytes
s.i:E"_+"3

Try it here!
How it works?

s.i:E"_+"3   Full program.

   :E    3   Split the second input on matches of the regex...
     "_+"    The regex "_+" (matches 1 or more underscores)
 .i          Interleave the elements of the split list with the input.
s            Join to a string.

RProgN 2, 11 bytes
x='_+'³[x‘r

Takes a string and a stack of strings on the top of the stack.
The first (top) element of a stack is to the right, hence input is right to left.
Explained
x='_+'³[x‘r
x=          # Set the stack of replacements to x
  '_+'³   r # Replace each chunk of _'s with the function...
       [    # Pop off the group of _'s
        x‘  # Pop the top element off x. Use that.

Try it online!

05AB1E, 12 bytes
„__¤:sv'_y.;

Try it online!
Explanation
„__¤:          # replace all runs of multiple "_" with a single "_"
     sv        # for each y in the list of replacements
       '_y.;   # replace the first instance of "_" with y

whoops fixed for +3 :p

@EriktheOutgolfer: Thanks for noticing. I rolled back to my previous version which handled that.

Java 8, 57 bytes
a->s->{for(String i:a)s=s.replaceFirst("_+",i);return s;}

When I read the challenge I at first thought we should make a grammatically correct sentence with the words being in random order, but just replacing lines with each sequential word is easier. ;)
Explanation:
Try it here.
a->s->{            // Method with String-array and String parameter and String return-type
  for(String i:a)  //  Loop over the input-array
    s=s.replaceFirst("_+",i);
                   //   Replace the first line (1 or more adjacent "_") with the substring
                   //  End of loop (implicit / single-line body)
  return s;        //  Return the result
}                  // End of method

C# (.NET Core), 97 96 + 18 bytes
Saved 1 byte thanks to Kevin Cruijssen!
The 18 bytes are for using System.Linq.
s=>l=>string.Concat(s.Split('_').Where(x=>x!="").Zip(l.Concat(new[]{""}),(x,y)=>x+y).ToArray());

Try it online!

You can change (s,l)=> to s=>l=> to save a byte. Try it online!

Python 2, 49 bytes
s,l=input();import re;print re.sub("_+","%s",s)%l

Try it online!
The list input is taken as a tuple. Allowing actual lists as input would add another seven bytes, as a conversion would be required (tuple(...)).

Vyxal s, 6 bytes
\_/';Y

Try it Online!
Look Ma, no Unicode!
\_/    # Split on underscores
   ';  # Filter out empty strings
     Y # Interleave with fill-in values
       # (s flag) concatenate the top of stack

Factor, 34 bytes
[ R/ _+/ "%s"re-replace vsprintf ]

Try it online!

R/ _+/ "%s"re-replace Replace any amount of contiguous underscores with %s.
vsprintf Interpolate a sequence of strings into another string at every %s.

Regex (RE2 or better), 23 bytes
s/_+(.*?)`([^`]*)/$2$1/

Try it online! - RE2
Try it online! - ECMAScript
Try it online! - Perl
Try it online! - PCRE2
Try it online! - Boost
Try it online! - Python
Try it online! - Ruby
This is a single regex substitution to be repeatedly applied until it has nothing to match (or until there is no change, where necessary or convenient). (See also the single-pass version.)
Input is taken as the string with blanks followed by the full list of string arguments, each delimited by `.
s/          # Begin substitution - match the following:
_+          # Match an entire blank
(.*?)`      # $1 = everything subsequent, up until but not including the first
            #      "`" delimiter; consume the delimiter
([^`]*)     # $2 = a string argument, captured up to but not including the next
            #      "`" delimiter; the ".*?" version would be "(.*?)(?=`|$)"
/           # Replace with the following:
$2$1        # "_+" is replaced with $2, and $1 is preserved, but the original
            # $2 is deleted.
/           # No flags - match and replace just once

sed -E, 31 bytes
:a
s/_+([^`]*)`([^`]*)/\2\1/
ta

Try it online!
sed lacks lazy quantifiers, so ([^,]*), must be used instead of (.*?), costing +2 bytes.

Regex (.NET), 46 bytes
s/_+(?<=((?=.*?(\2?`([^`]*)))_+.*?)*)|`.*/$3/g

Try it on regex101! - .NET
Input is taken as the string with blanks followed by the full list of string arguments, each delimited by `.
This is a single regex substitution, to be applied once. (See also the looped version.)
As such, for each individual match it must count how many blanks are to the left of the current one being replaced, because separate matches in a /global match or replace operation cannot communicate to each other (there is no persistent state between matches, other than the current position in the string). Variable-length lookbehind is used for this, with group-building to count string arguments in parallel with counting blanks. (I tried using balancing groups for the counting instead, and that took a bit more bytes.)
s/                       # Begin substitution - match the following:
    _+                       # Match an entire blank
    (?<=                     # Lookbehind – evaluated right-to-left, so read
                             # from the bottom up, until entering the lookahead,
                             # then read normally again.
        # When the below loop has finished, $3 will contain the string argument
        # of an index corresponding to the index of the blank matched above.
        (
            (?=              # Lookahead
                .*?          # Skip a minimal number of characters in order to
                             # match the following:
                (            # \2 = the following:
                    \2?      # Previous value of \2, if set
                    `        # Match a delimiter
                    ([^`]*)  # $3 = the next string argument (read up to but
                             #      not including the next delimiter, if any)
                )
            )
            _+               # Match an entire blank
            .*?              # Skip a minimal number of characters in order to
                             # match the above (since no backtracking will
                             # occur, they will all be non-underscores).
        )*                   # Iterate the above as many times as possible –
                             # for each blank matched (going right to left),
                             # \2 is appended with another string argument
                             # (going left to right).
    )
|                            # or...
    `.*                      # Match the entire list of string arguments,
                             # including first delimiter, to be deleted. This
                             # can only be matched after the first stage,
                             # above, has finished.
/                        # Replace with the following:
$3                           # The captured string argument
/                        # Flags:
g                            # Global – replace all matches in one sweep from
                             # left to right.

Regex (Pythonregex), 54 bytes
s/_+(?<=((?=.*?(?=(\3?))(\2`([^`]*)))_+.*?)*)|`.*/\4/g

Try it online! - Python import regex
A port of the .NET version. The captures \2 and \3 are copied back and forth to avoid use of nested backreferences, which Python doesn't support.
Regex (PCRE2 v10.35+), 96 bytes
s/_+(?*(.*`(.*)(.*$)))((?<=(?=^(?>.*?_+(?=[^`]*(\5?+`[^`]*)))+(?=\1)[^`]*\5\3$|(?4)).))|`.*/$2/g
Try it on regex101!
Attempt This Online!
This version emulates variable-length lookbehind using recursion with fixed-length lookbehind. But since capture groups cannot be returned from a subroutine call, the regex must make a guess as to what the subroutine call will return; this is done using (?*...) non-atomic lookahead. If the recursive call detects a mismatch between the guess and the actual result, it returns a non-match, forcing the non-atomic lookahead to try other guesses until one matches.

K (ngn/k), 27 bytes
{(*c),/y,'1_c:(~#:')_"_"\x}

Try it online!
Splitting based on "runs of underscores" seems longer than splitting by single underscores and removing empty strings.
{(*c),/y,'1_c:(~#:')_"_"\x}  x: string, y: substitution list
                     "_"\x    split by single underscores
              (~#:')_         remove empty strings
            c:                call it c
       y,'1_    zipped concatenate with c, head removed to match lengths
 (*c),/         join them and add back the head of c

you can also remove empty strings like this: ("_"\x)^,""

and save another 2 bytes: {,/(("_"\x)^,""),'y,,""}

PowerShell Core, 46 bytes
param($a,$b)-join($a-split'_+'|%{$_
$b[$i++]})

Try it online!

Raku, 24 bytes
->$_,\s{S:g[_+]=s.shift}

Try it online!
Replace and shift, like many answers.

brev, 36 28 bytes
Original attempt:
(fn(fold(fn(strse y"_+"x 1))x rest))

Wait, this works for 28:
(fn(strse x"_+"(pop! rest)))

Brev usually does poorly on here but since it was inspired by Snobol, I was happy to beat it.

SOGL V0.12, 7 bytes
lΔ╔*№≤ŗ

Try it Here!
Explanation:
l        get the strings length
 Δ       range
  ╔*     multiply an underscore with each of the numbers
    №    reverse vertically (so the longest underscores get replaced first)
     ≤   put the array on top - order parameters for ŗ correctly
      ŗ  replace in the original string each any occurence of the underscores with its corresponding item in the array

Stacked, 21 bytes
[@y'_+'[y shift]repl]

Try it online!
Replaces all runs of _ with y shift. Nothing original, as it seems.

Nim, 73 bytes
import pegs,sugar
proc f(s,b:auto):auto=s.replace peg"'_'*",(i,x,y)=>b[i]

Try it online!

Jelly (fork), 5 bytes
œṢ”_ż

Try it online! (or rather, don't, as this is a fork, not on TIO)
Full program, as we abuse Jelly's smash-printing.
How it works
œṢ”_ż - Main link. Takes a string S and a list of fillers F
œṢ    - Split S on runs of:
  ”_  -   Underscores
    ż - Zip with the fillers, and smash-print

Haskell, 61 bytes
s#(w:r)|(p,n)<-span(/='_')s=p++w++(snd$span(=='_')n)#r;s#[]=s

Try it online!

SNOBOL4 (CSNOBOL4), 51 bytes
	I =INPUT
R	I SPAN('_') =INPUT	:S(R)
	OUTPUT =I
END

Try it online!