105

brainfuck, 32 bytes ,[[<]>[.>]++++++++++.,[>>]<[-]<] Try it online! The same loop is used for both halves of the pattern. Explanation: , Take first input character as initial line [ Until line to output is empty: [<]> Move to beginning of line [.>] Output all characters in line +++...


54

JavaScript (ES6), 36 bytes f=([c,...r],s=` `)=>c?s+f(r,s+c)+s:s Try it online! Commented f = ( // f is a recursive function taking: // the input string split into: [c, // c = next character (may be undefined if we've reached the end) ...r], // r[] = array of remaining characters s = `...


47

05AB1E (legacy),  4  3 bytes Crossed out &nbsp;4&nbsp; is no longer 4 :) η.∊ Try it online or verify all test cases. Explanation: η # Get the prefixes of the (implicit) input-string .∊ # Vertically mirror everything with the last line overlapping # (which implicitly joins by newlines in the legacy version of 05AB1E) #...


30

Python 2, 81 bytes def f(M,k=1,r='',b=0): for c in M[k][k::6]:b^=c>' ';r+=' #'[b] print r;f(M,k+3) Try it online! Takes input as a list of strings (or a list of lists of characters). Prints the output, terminating with error. The idea is similar to tsh's. We look at the characters marked as ? below to see which are spaces and which are \: +---------...


23

Haskell, 25 24 23 17 bytes mapM$min"^v".pure Try it online! -1 byte thanks to @H.PWiz -1 byte thanks to @nimi Returns a list of strings. The TIO has 2 extra bytes for the function declaration - I've seen other people leave it off when they write the function pointfree so I'm doing the same unless told otherwise. Previous Answer (25 bytes) g 'v'="v^" g ...


23

Brainfuck, 1347 bytes Why do i do this to myself +++++[>+++++++++>+++++++>++++++>++++++++>+++++++++>++<<<<<<-]>+>>++>++<<>...............>............>>.<<<...............<....<....>.<.>>>>>.<<<.............<.<..>...<.....>..<.......


22

05AB1E, 21 bytes Defines a program \$f : \color{purple}{\texttt{AlphabeticChar}} \rightarrow \color{purple}{\texttt{String}}\$ Code: 2AA¹k._•1못*Ć,ãiDΣ•Λ Try it online! Breakdown: 2AA¹k._•1못*Ć,ãiDΣ•Λ 2 # <length> AA¹k._ # <filler> •1못*Ć,ãiDΣ• # <pattern> Λ # ...


22

Python 2 or 3,  33  30 bytes -3 thanks to Maxwell lambda l:'o'in map(max,l[:-1]) An unnamed function accepting a list of lines Try it online! How? There needs to be a section of rope obscured by Jimmy that is not the bottom one. lambda l:'o'in map(max,l[:-1]) lambda l: # a function taking l (the lines as strings) ...


22

JavaScript (ES6),  184 ... 171  163 bytes Takes input as (x)(y), with \$0\leq x\leq7\$ and \$0\leq y\leq7\$. Outputs as a string with 3 colors (marked as \$0\$, \$1\$ and \$2\$). h=>v=>(a=[...'3232132031021010'],a[5+(v&4|h>3)]^=3,a[v/2<<2|h/2]=v%2*2+h%2,g=x=>y&8?'':(x<8?x-h|y-v?a[y/2<<2|x/2]^y%2*2+x%2?(x^y)&...


20

IBM PC DOS, 8088 assembly,  44  43 d1ee ad8b d6b4 0948 8af8 8ac8 d0e1 49b3 243a cf7d 024e 4e46 861c cd21 861c 52ba 2901 cd21 5ae2 eac3 0d0a 24 Unassembled: SHR SI, 1 ; point SI to DOS PSP at 80H (SI intialized at 100H) LODSW ; load arg length into AL, advance SI to 82H MOV DX, SI ; save ...


20

Jelly, 6 bytes n⁶Sċ2Ẓ Try it online! Explanation: n⁶Sċ2Ẓ args: z (e.g. [['/', 'o', '\\'], [' ', '-']] => 0) implicit return value: z ([['/', 'o', '\\'], [' ', '-']]) n⁶ dyad-nilad pair ([[1, 1, 1], [0, 1]]) ⁶ 4th command-line argument or space [4th CLA assumed absent] (' ') n vectorized inequality ([[1, 1, 1], [0, 1]]) S ...


19

Python 2, 60 52 bytes f=lambda s,n=1:s[n:]and[s[:n]]+f(s,n+1)+[s[:n]]or[s] Try it online! Python 3.8 (pre-release), 50 bytes f=lambda s,n=1:s>(x:=s[:n])and[x,*f(s,n+1),x]or[s] Try it online!


19

JavaScript (ES6), 38 bytes Takes input as (a)(b). Returns \$0\$ or \$1\$. a=>b=>b[a.search`o`]=='-'&/--/.test(b) Try it online! How? We look for the position of the middle part "o" of Jimmy's body in the first string and test wether there's a dash in the second string at the same position. b[a.search`o`] == '-' The only case where Jimmy ...


19

JavaScript (Node.js), 85 bytes a=>a.flatMap(u=(l,y)=>y%3?[]:[l.flatMap((c,x)=>x<y|(x-=y+3)%6?[]:' #'[u[x]^=c+1<0])]) Try it online! Basic idea is: we only care about the characters on \$ (6x+3y+3,3y) \$. If it is a dash (-), current cell has the different value with the one on its top, and if it is a space (), current cell has the same ...


18

MATL, 8 bytes nZv"G@:) Try it online! Please like this post for the smiley :) in the code it took me a lot of time to make. n % Length of the input string Zv % Symmetric range ([1 2 ... n ... 1]) " % For each k in above range G % Push input @: % Push [1 2 ... k] ) % Index


18

Charcoal, 2 bytes ↘A Try it online! Link is to verbose version of code. Takes input as either a single newline-delimited string literal or as an array of strings. Explanation: A reads the input and ↘ outputs it in the desired diagonal direction. Version which accepts a blank-line terminated list of lines from STDIN: WS⊞υι↘υ Try it online! Link is to ...


17

J, 11 bytes Anonymous tacit prefix function. Returns a space-padded character matrix. [:(}:,|.)]\ Try it online! ]\ the list of prefixes [:(…) apply the following function to that list  |. the reverse list  , prepended with  }: the curtailed (without last item) list


16

Python 2, 79 78 73 72 bytes n,d=input() c='|\/'[d] i=n while i:print' '*(n-i*d)+c,i%2*c or' ',c;i-=1 Try it online! Takes [1,0,-1] for [north-west, north, north-east] -1 byte, thanks to Neil


16

Python 2, 28 bytes lambda x:"o', '|"in`zip(*x)` Try it online! How does it work? It takes input as a list of strings, and zip joins the string. Jimmy stays on the rope if there is a "|" below an "o", so this code joins all the lines and checks if there is an "o" followed by a "|". Annotated code: lambda x: # Creates an anonymous function that takes one ...


16

T-SQL, 322 298 288 bytes SELECT CONCAT('',DECOMPRESS(CAST('H4sIAAAAAAACA6WRQYrEIBQF955CqJ0wdf/jjehM2rwOdofUQvIoHj9f65m2UMLRsYNng/4ZQU0NThjUtBFLDXwRBpWIWYfGpCaIRCy5cZswuFVX6U3bOAA73/+8nXYw2368uWwfj3r5MKzfq4W0UHhEQcUBsk0/b9yafllX9P/YpeDu7rVDTF6226WoPpy6bMUmPZ66UH4BHz4rVE8EAAA='as XML).value('.','varbinary(max)'))) Uses G-Zip compression built into SQL 2016 ...


16

APL (Dyalog Unicode), 20 12 bytesSBCS -6 bytes through dzaima Full program. Prompts stdin for: texture as a list of strings number of rows in shape matrix number of columns in shape matrix indices of falsies (to be blanks) in the shape matrix All the ⎕s are supposed to be rectangles (they're not tofu). They symbolise a computer console which here means ...


14

JavaScript (ES6),  525 ... 475 471  459 bytes Saved 13 bytes thanks to @Neil Takes input as an array [X,Y,Z]. Returns a matrix of characters. a=>([X,Y,Z]=a,m=[],W=X*6+Z*2,'1uol9h824lsqpq17de52u1okgnv21dnjaww111qmhx1gxf4m50xg6pb42kzijq21xyh34t0h2gueq0qznnza2rrimsg3bkrxfh3yrh0em').replace(/.{7}/g,s=>[[c,x,A,y,B,w,C,h,D,t]=parseInt(s,36)+s,Y*...


14

JavaScript (ES6),  210 ... 182  180 bytes Takes input as (m)(n), where \$m\$ is a list of lists of characters. Returns the result in the same format. m=>g=n=>n?g(n-1,m=m.map((r,y)=>r.map((c,x)=>(i=0,h=$=>~$?(m[Y=y+($-2)%2]||0)[X=x+~-$%2]>h?"-|+"[n+=`;m[${Y}][${X}]=S[${$}]`,i?2:$&1]:h($^++i):c)((S="<^>v").indexOf(c)))),...


14

Haskell, 89 87 80 bytes 7 bytes off thanks to xnor (!!)$"":x:iterate(4#8)(7#6$x) x="( ͡° ͜ʖ ͡°)" (a#b)y=take a x++y++drop b x Try it online! To start we assign ( ͡° ͜ʖ ͡°) to a string x for convenience. x="( ͡° ͜ʖ ͡°)" Then we build a list of the answers and index it to find the solution. This is done by hardcoding the first two answers as the first ...


14

JavaScript (ES6),  259 249  246 bytes Takes input as an array of integers. Returns a matrix of characters. a=>{for(m=[],i=a.length,X=i+25;i--;r[X]>' '|!w?0:r[X]='_',X--)for(y=w=a[i];y>=-w;y--)for(r=m[Y=y+25]=m[Y]||Array(X).fill` `,W=w+(y>0?1-y:y),k=2;k--;)for(x=-W;x<W;x++)r[X+x+k]='/\\ _'[w^a[i+k]|w^a[i+k-1]?(x+W&&2-!(~x+W)...


14

JavaScript (ES6), 98 bytes n=>` _/|2 | |\\0 |_ |/1 \\|3`.replace(/\d/g,k=>n?(k&1?' /':' \\').repeat(n/33^n>98):['/\\'[k]]) Try it online! How? We use the following template: _/|2 | |\0 |_ |/1 \|3 If \$n=0\$ (volume muted): \$0\$ is replaced with / and \$1\$ is replaced with \ the other digits are removed If \$n\neq 0\$: odd ...


13

Perl 6, 31 bytes {[\~](@_)[0...@_-1...0]}o*.comb Try it online! Anonymous code block that takes a string and returns a list of lines. Explanation: { }o*.comb # Pass the list of characters into the codeblock [\~](@_) # Triangular reduce by concatenation # e.g. The list [1,2,3,4] turns into ...


13

APL (Dyalog Classic), 162 161 132 130 bytes {' |+/+ +-? ??? ++'[⍉(⊃~∘0)⍤1⍣3⍉↑a↑¨⍨↓(--1-⌊/∘,)2-/1⌽↑⍳⍴a←16|29|1+{2⊥+/¨∊¨=⌿¨⍵(⍉⍵)(⍉↓⍵)}⌺2 2 2{⍉⍤2⍉⌽0,⍵}⍣6↑3/↓2/6⌿1<⍵+.=⍨↑⍳1+2×⍵]} Try it online! generate a 3d bool array of unit cubies replicate each cubie 6 3 2 times along x y z surround with zeroes for each 2×2×2 subarray compute a number between 0 and 16 ...


13

Japt, 5 bytes I think this is right; I've been working for 16 hours straight and barely know my own name so I wouldn't be surprised if it's not! Õø|io Try it Õø|io :Implicit input Õ :Transpose ø :Contains? |io : "|" prepended with "o"


13

05AB1E, 20 18 16 15 14 bytes *j.rS²ô2Føε8.ø Takes three inputs in the order: height, width, string. Output as a 2D list of characters. Uses 8 as border, but could be any digit. -1 byte thanks to @Grimy. Try it online or verify all test cases. (TIO contains }}J» in the footer to pretty-print the result; feel free to remove it to see the actual output 2D ...


Only top voted, non community-wiki answers of a minimum length are eligible