Search
Jelly, 4 bytes X}€S Try it online! How it works X}€S - Main link. Takes n on the left, m on the right € - Over each element of 1 through n: } - With m as its argument: X - Y...
Vyxal ṪR, 3 bytes (⁰℅ Try it Online! ( # N times... ℅ # Generate a random integer between one and... ⁰ # First argument
Japt -mx, 3 bytes Takes n as the first input and m as the second. ÒVö Try it ÒVö :Implicit map of the range [0,first input) Ò :Negate the bitwise NOT of (i.e., increment) V ...
Python 3, 47 42 40 bytes -2 bytes thanks to bastolski lambda n:'#'*n+('\n#'+' '*(n-2)+'#')*~-n Try it online! Python's string multiplication is really useful.
Vyxal, 13 bytes \#*,‹(⇩\#꘍ṘǏ, Try it Online! \#*, # Print a line of # ‹( # n-1 times... ⇩\#꘍Ṙ # n-2 spaces before a hash Ǐ, # Append a hash and print
Ruby, 53 bytes ->n{n-=3;[?╔+?╦*n+?╗,*[?╠+?╬*n+?╣]*(n+1),?╚+?╩*n+?╝]} Try it online!
Japt -R, 11 10 bytes ÆQ+ùUÉÃvçQ Try it ÆQ+ùUÉÃvçQ :Implicit input of integer U Æ :Map the range [0,U) Q : Quotation mark + : Append another ...
JavaScript, 47 bytes n=>`0`.repeat(n)+(` 0`.padEnd(n--)+0).repeat(n) Try it online! My first pass used recursion before I realised I was over thinking things! First 51 byte version inclu...
Rockstar, 82 bytes listen to N let N be-2 X's-1 say "##"+"#"*N while N-X say "#"+" "*N+"#" let X be+1 Try it (code will need to be pasted in)
C (gcc), 33 31 bytes f(x,y){return x+y+(x==2&y==2);} Try it online! Saved two bytes thanks to Shaggy
Turing Machine.io, 202 bytes 0 1 101 3 1 2 0 0 2 108 3 1 3 0 0 3 108 3 1 4 0 0 4 111 3 1 5 0 0 5 44 3 1 6 0 0 6 32 3 1 7 0 0 7 87 3 1 8 0 0 8 111 3 1 9 0 0 9 114 3 1 a 0 0 a 108 3 1 b 0 ...
Sclipting, (UTF-16) 14 bytes 要감啃終丟併反 Explanation: Push input 要 While the top number is non-zero 감啃 Shift the top number by 1 bit and push both the bit and shifted result 終 End lo...
C (gcc), 50 bytes f(int(*o)(i,j),int n){return n-1?o(f(o,n-1),n):1;} Try it online!
Haskell, 29 bytes import Text.Printf printf"%b" Try it online! Without builtins: Haskell, 37 bytes f n|n<2=[n]|0<1=f(div n 2)++[rem n 2] Try it online!
JavaScript (Node.js), 52 bytes (A,...c)=>A.sort((a,b)=>c.map(z=>z(a,b)).find(x=>x)) Try it online! A golf of the reference code. If we can assume there will be no ties, 47 is po...
Ruby, 11 bytes ->n{"%b"%n} Simple string formatting. Try it online!