Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
3 replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
source | link

MATL, 19 bytes

'|-| '2:"iqWQB]E!+)

Try it online!

Explanation

The approach is similar to that used in this other answerthis other answer. The code builds a numerical array of the form

3 2 2 2 3
1 0 0 0 1
1 0 0 0 1
1 0 0 0 1
1 0 0 0 1
1 0 0 0 1
1 0 0 0 1
3 2 2 2 3

and then its values are used as (1-based, modular) indices into the string '|-| ' to produce the desired result.

'|-| '                % Push this string
      2:"     ]       % Do this twice
         i            % Take input
          q           % Subtract 1
           W          % 2 raised to that
            Q         % Add 1
             B        % Convert to binary
               E      % Multiply by 2
                !     % Transpose
                 +    % Add with broadcast
                  )   % Index (modular, 1-based) into the string

MATL, 19 bytes

'|-| '2:"iqWQB]E!+)

Try it online!

Explanation

The approach is similar to that used in this other answer. The code builds a numerical array of the form

3 2 2 2 3
1 0 0 0 1
1 0 0 0 1
1 0 0 0 1
1 0 0 0 1
1 0 0 0 1
1 0 0 0 1
3 2 2 2 3

and then its values are used as (1-based, modular) indices into the string '|-| ' to produce the desired result.

'|-| '                % Push this string
      2:"     ]       % Do this twice
         i            % Take input
          q           % Subtract 1
           W          % 2 raised to that
            Q         % Add 1
             B        % Convert to binary
               E      % Multiply by 2
                !     % Transpose
                 +    % Add with broadcast
                  )   % Index (modular, 1-based) into the string

MATL, 19 bytes

'|-| '2:"iqWQB]E!+)

Try it online!

Explanation

The approach is similar to that used in this other answer. The code builds a numerical array of the form

3 2 2 2 3
1 0 0 0 1
1 0 0 0 1
1 0 0 0 1
1 0 0 0 1
1 0 0 0 1
1 0 0 0 1
3 2 2 2 3

and then its values are used as (1-based, modular) indices into the string '|-| ' to produce the desired result.

'|-| '                % Push this string
      2:"     ]       % Do this twice
         i            % Take input
          q           % Subtract 1
           W          % 2 raised to that
            Q         % Add 1
             B        % Convert to binary
               E      % Multiply by 2
                !     % Transpose
                 +    % Add with broadcast
                  )   % Index (modular, 1-based) into the string
2 added 499 characters in body
source | link

MATL, 19 bytes

'|-| '2:"iqWQB]E!+)

Try it online!

Explanation

The approach is similar to that used in this other answer. The code builds a numerical array of the form

3 2 2 2 3
1 0 0 0 1
1 0 0 0 1
1 0 0 0 1
1 0 0 0 1
1 0 0 0 1
1 0 0 0 1
3 2 2 2 3

and then its values are used as (1-based, modular) indices into the string '|-| ' to produce the desired result.

'|-| '                % Push this string
      2:"     ]       % Do this twice
         i            % Take input
          q           % Subtract 1
           W          % 2 raised to that
            Q         % Add 1
             B        % Convert to binary
               E      % Multiply by 2
                !     % Transpose
                 +    % Add with broadcast
                  )   % Index (modular, 1-based) into the string

MATL, 19 bytes

'|-| '2:"iqWQB]E!+)

Try it online!

The approach is similar to that used in this other answer.

MATL, 19 bytes

'|-| '2:"iqWQB]E!+)

Try it online!

Explanation

The approach is similar to that used in this other answer. The code builds a numerical array of the form

3 2 2 2 3
1 0 0 0 1
1 0 0 0 1
1 0 0 0 1
1 0 0 0 1
1 0 0 0 1
1 0 0 0 1
3 2 2 2 3

and then its values are used as (1-based, modular) indices into the string '|-| ' to produce the desired result.

'|-| '                % Push this string
      2:"     ]       % Do this twice
         i            % Take input
          q           % Subtract 1
           W          % 2 raised to that
            Q         % Add 1
             B        % Convert to binary
               E      % Multiply by 2
                !     % Transpose
                 +    % Add with broadcast
                  )   % Index (modular, 1-based) into the string
1
source | link

MATL, 19 bytes

'|-| '2:"iqWQB]E!+)

Try it online!

The approach is similar to that used in this other answer.