28

i386 (16-bit mode) Bootsector, 512 bytes All i386 bootsectors have to be 512 bytes, so... Without the padding required by i386, it is 137 bytes. Since I can't easily post a TIO link, here's a screenshot of it running: This code registers the BIOS interrupt int 0x69 to take the number in the bx register and use it as input. Thus, doing mov bx, 3 int 0x69 is ...


12

APL (Dyalog Unicode), 8 bytes ∧/⍲⌿2∨/⎕ Try it online! Takes input from stdin as a 2-row boolean matrix, where 1 is a wall and 0 is a space. Prints 1 for true, 0 for false (which are the only truthy/falsy values in APL). How it works Given a maze (1=wall, 0=space) 0 0 1 0 0 0 1 1 0 0 1 1 0 0 Think of putting a bar between every two horizontally adjacent ...


11

Python 2, 26 bytes lambda m,n:m&(n/2|n|2*n)<1 Try it online! Takes inputs as numbers representing bit sequences, which the challenge author okayed. Though I realized this representation is kind-of suspect because leading zeroes are ambiguous. The idea is to check whether any 1 in the top number (x symbol in the top line) corresponds to a 1 in any of ...


10

Charcoal, 11 bytes ↑|↗/×_N¶\¶| Try it online! Link is to verbose version of code. This shape is too simple to tax Charcoal's drawing primitives, so this is just basically printing strings to the canvas. Explanation: ↑| Print the left | and move the cursor up a line. ↗/ Print the / and move the cursor to the start of the _s. ×_N Print the desired number ...


9

Ruby, 29 28 bytes ->t,b{"#{t+2*b}"!~/45|54|6/} Try it online! Takes input as two integers, t and b, each representing a row of the maze, with digits 1 representing empty tiles and 2 representing walls. Returns false if t+2*b contains the digits 45 or 54 (two walls touch diagonally) or 6 (two walls touch vertically). Returns true otherwise. It'...


6

Python 2, 118 bytes n=1 exec"a=n/6+n/10*4+(n==6);print' '.join(str(((2**n+1)**n>>n*k)%2**n)for k in range(a,n+1%n-a)).center(23);n+=1;"*13 Try it online! Expresses binomial coefficients inline like in my tip here with binom(n,k)=((2**n+1)**n>>n*k)%2**n. The number of entries cut off on each side for the n'th row (one-indexed) is ...


6

J, 67 bytes (1785951#:~13#7)(0(,~' '#~12-<.@-:@#)@":-@[}.}.)&>1;2}.<@(!{:)\i.14 The pascal's triangle part is adapted from @ephemient's answer here. Try it online! How it works <@(!{:)\i.14 The first 14 rows of the triangle. 1;2}. Drop the first two rows, prepend 1. (1785951#:~13#7) 0 0 0 0 0 2 1 1 1 5 5 6 6 stored in base 7. ":-...


6

Pyramid Scheme, 31655 bytes, non-competing (obviously...) So, I thought this would be a funny thing to try. ^ ^ ^ ^ ^ ...


5

APL (Dyalog Unicode), 146 115 bytes {(∨/+⍺⊃⊢)∨⌿↑{'O'=1↓⊃¨⊢∘(((⊢,⍉∘⊖∘⌽¨)1⌽¨⊂,⊂∘⍉)⊃⍨1⌈¯2+'X O\/'⍳⊃)\(4×≢,⍵)⍴⊂⍵}¨({¯1+⊃⊃⍸'X'=⍵}⌽⍉)⍣2¨(⊢,⌽∘⊖¨)(⊂,⊂∘⍉)⍵,⍳≢⍵} -31 bytes (!) thanks to @Bubbler (combining transformations; simplifying iteration end condition; smaller details) Try it online! Outputs 2 for truthy, 1 for mediumy, and 0 for falsy. Similarly to my ...


5

Rust, 79 78 76 57 53 bytes -4 bytes thanks to madlaina |n|print!("{:_<n$} {:n$}\\ {:n$}|"," ","/","|",n=n+1) Try it online Old answer (76 bytes): |n|format!(" ")+&"_".repeat(n)+" /"+&" ".repeat(n)+"\\ |"+&" ".repeat(n)+"|" Try it ...


5

Python 2, 47 bytes lambda n:" %s\n/%s\\\n|%s|"%("_"*n," "*n," "*n) Try it online! Inserting the n-dependent components into a template using string formatting. 48 bytes lambda n:" "+"_"*n+"\n/"+" "*n+"\\\n|"+" "*n+"|" Try it online! Straight up ...


4

APL (Dyalog Unicode), 76 bytes ⎕CY'dfns' {⍺⍴v+.×(X m)⌿m←⊃⍪/(⍺∘{⍪↑,(⍳⍺)↓¨⊂⌽⊖⍺↑⍵⍴1}¨⊢∘⌽\2/⍵),⍤1¨2/↓∘.=⍨v←⍳≢⍵} Try it online! Dyalog APL comes with a built-in Exact Cover solver X, so the main part of the code is construction of the constraint matrix. A constraint matrix is a boolean matrix where a column indicates a constraint, and a row indicates an action ...


4

J, 19 bytes 0=1#.2 2*/@:#.;._3] Try it online! A port of Bubbler's APL solution saves 3 bytes: 2 e.[:+/2+./\"1] but it seemed a shame not use J "Subarrays" adverb here, as the problem seems almost tailor-made for it. How Let's take the example: 0 1 1 1 0 0 0 0 0 0 1 0 2 2 v;._3 will apply the verb v to every 2x2 block. Eg, 2 2 <;._3 ...


4

05AB1E, 26 bytes 13LεDÝc•6hö¢ðU•RNèF¦¨]»¦.c Try it online. Explanation: 13L # Push a list in the range [1,13] ε # Map each value `y` to: D # Duplicate the value `y` Ý # Pop and push a list in the range [0,`y`] c # Take the binomial coefficient of `y` with each value in this list ...


4

JavaScript (Node.js),  170 ... 147  145 bytes Expects (n)(a), where n is an integer and a is an array of strings. Returns 3 for truthy, 0 for falsy or 1 for mediumy. n=>a=>(g=(d,y=a.findIndex(r=>~(x=r.search`X`),j=n))=>+(a+a+1)[~j]?D&&g(--D):!(k=Buffer(a[y+=(d-2)%2])[x+=~-d%2]*5%26%5)*-~!--j|g(d^4-k&3,y))(D=3) Try it online! How? We ...


4

Python 2, 316 bytes def f(m): r=[list(' '*61)for y in range(31)] (y,x),(b,a)=[[(109-p)/10*3,1+min(p%20,19-p%20)*6]for p in[max(m)-1,min(m)-1]] while y<b:c=cmp(a,x);r[y][x:x+4]=r" /|\___/|\ "[c%3::3];x+=c;y+=1 if x==a:r[y-1][x+2-(r[y-1][x]>' ')]=" " while x-a:c=cmp(a,x)+1;r[y-2][x+c:x+2+c]="__";r[y-1][x+c*3/2]="...


4

Integral, 37 31 Bytes ♂8♦⌡_⌡g►⌡/⌡•8g►⌡\⌡►•⌡|⌡♦8g►⌡|⌡► First real answer in my new language! Try it Alternative Explanation: (Implicit input) ♂ Triplicate top of stack 8 Push space ♦ Swap ⌡_⌡ Push underscore g Repeat string ► Concatenate ⌡/⌡ Push slash • Stack: ...abc -> ...bca 8 Push space g Repeat string ► ...


4

APL (Dyalog Unicode), 21 bytes (SBCS) Full program, prompting for n from stdin. ' /|',' \|',⍨3↑1⎕⍴'_' Try it online! '_' an underscore 1⎕⍴'_' cyclically reshaped into a matrix with one row and n columns 3↑ take the first three rows, padding with spaces ' \|',⍨ append this character-list as a trailing column ' /|', prepend this character-list as a leading ...


4

MAWP, 95 bytes %@~52WWM52WWM52WWM84W;![1A99M1M5W;]%52W;68W1A;![1A84W;]%68W2W4A;52W;56W1M4W;![1A84W;]%56W1M4W;. Try it! Explanation: % Remove initial 1 from stack @~ Push input as integers and reverse stack 52WWM Add top of stack multiplied by 10 to second stack element [5,4,3,2] ==> [5,4,...


4

05AB1E, 26 21 bytes My original 26 bytes approach: " 0 /1\|1|"3ô„_ vy¹иJNs:}» Explanation: " 0 /1\|1|"3ô„_ vy¹иJNs:}» " 0 /1\|1|" push string template (the idea is to replace 0 and 1 with _ and space respectively using loop count index 3ô split by chunks of 3 „_ ...


3

Charcoal, 57 bytes F³⊞υ﹪ι²F”)⧴→↨w﹪f”«UMυ⁺κ§υ⊖λ⊞υ⁰F›ⅉ⁰≔⪫✂υIι±Iι¹ ι⟦⁺× ⊘⁻²⁴Lιι Try it online! Link is to verbose version of code. Explanation: F³⊞υ﹪ι² Start by preparing a list 0 1 0. (Charcoal's indexing is cyclic, so rather than letting it wrap I need to provide a safety margin.) F”)⧴→↨w﹪f”« Loop over the compressed string 111113222667 which represents ...


3

JavaScript (ES8), 137 bytes _=>[a=[1],..."000021115566"].map((v,n)=>(s=(a=[i=1,...a.map(v=>v+~~a[i++])]).slice(v,n+2+!n-v).join` `).padStart(23+s.length>>1)).join` ` Try it online!


3

Charcoal, 130 bytes FχFχ⊞υ×⁶⎇﹪ι²⁻⁹κκ≔⁻LυNθ≔⁻LυNη≔⊕§υηζ≔׳÷ηχηJ§υθ׳÷θχ F›ζⅈ«≦⊕ζ »F⁻ζ⁺ⅈ⁻ⅉηG←←↑→↘→²_F⁻ⅈ⁺ζ⁻ⅉηG↑←↙→²_W›ⅉη«≔⎇›⁻ⅉη↔⁻ζⅈ²∨›ζⅈ³ιP✳ι¹←←✳ι¹→¿›ⅉη_ Try it online! Link is to verbose version of full 198-byte program that includes drawing the entire background. Explanation: FχFχ⊞υ×⁶⎇﹪ι²⁻⁹κκ Get the X-coordinates of all 100 squares (since each row reverses ...


3

Japt, 20 bytes " {ç'_} /{ç}\\ |{ç}| Try it ç is one of Japt's repeat methods for integers; you can probably figure the rest out from there!


3

C (gcc), 72 70 bytes -2 bytes thanks to ceilingcat! f(n){printf(" %s\n/%*c\n|%*2$c",memset(calloc(n,2),95,n),n+1,92,'|');} Try it online!


3

Pyth, 24 bytes %" %s /%s\\ |%s|"*RQ"_ Try it online! Explanation %"..."*RQ"_ "_ : The string literal "_ " *RQ : Multiply each element of the string by input (["___", " ", " "]) %"..." : Do string formating on string with args from ...


3

05AB1E, 18 17 bytes …_ ε×… /|NèºSsý, Try it online or verify a few more test cases. Explanation: …_ # Push string "_ " ε # Map over each character in this string: × # Repeat it the (implicit) input amount of times as string … /| # Push string " /|" Nè # ...


3

PowerShell, 43 41 bytes -2 bytes thanks to mazzy param($n)' '+'_'*$n ' '*$n|%{"/$_\ |$_|"} Try it online! Eh, it's okayslightly better Alternative 41 byte solution offered by mazzy


3

Java 11, 61 bytes n->" "+"_".repeat(n)+"\n/x\\\n|x|".replace("x"," ".repeat(n)) Try it online. Explanation: n-> // Method with integer parameter and String return-type " " // Return a space +"_".repeat(n) // Appended with the input amount ...


2

J, 8 bytes [\@$&'*' Explanation: $&'*': Reshape * according to. $: Reshape. &: Bound with (partial application). '*': Character literal *. @: Function composition. [\: Each prefix of. [: Identity. \: Apply the preceding verb to each prefix of the right argument.


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