New answers tagged

1

GolfScript, 68 bytes ~:i,.-1%]zip.-1%]{{~" "*\["//""\\\\"]0=*+["^L"' "']0=i*+}%1:0;n*}%n* Try it online! Its really messy, but it works and I don't really know a better way to do it.


0

PHP, 94 bytes <?=gzinflate('«Q€€(õ¨a &BR€ÊªºUª†—«Íl†a°j`DÌ Û¹h~!Úàøøx üG™¯ôôô0MÀô .qRDáá´'); WARNING: this code contains many non-printable chars and a function that is disabled in most online code testers. It is either impossible to enter the correct code on their sites or run the function. Here is the php file I uploaded to gitHub so that you can ...


0

Canvas, 40 bytes ⁷╵/|3*∔╫@HyperNeutrino Welcome back!4A«╋ Try it here! There's already a Canvas answer here but I'd say this uses a fairly different approach.


0

Julia 1.0, 57 bytes !i=[1:i;i-1:-1:1] println.(join([' '^(9-i);!i]) for i=!9) Try it online!


1

Stax, 38 bytes ç²kτ,e7rà♠ǃ╜?║í▬u╬wπ■&Jµⁿj↨▄!=╢╡═+ZWu Run and debug it Took some shuffling around and :B to beat the MATL score. Explanation . *9*"!1$'YKaK968"%13|E:B16/WcM|)Ms{|,}6*|:m5* . * " *" 9* repeat 9 times "!1$'YKaK968"%13|...


0

Stax, 18 bytes Θo░a↑▐»xr←9hV╣ä&N╞ Run and debug it


0

Stax, 24 bytes Ñ!Δ╚«&╖ô^ô◙⌠≈%<╗∞█z9ÖºOT Run and debug it Delays 15 frames between each change, which at default 60fps should be equal to 1/4th of a second. Explanation W`lAtv>!`"|/-\"{[+p{|,}15*|:F W loop forever `lAtv>!` push "Loading... " "|/-\"{ ...


0

Vyxal, MC, 9 bytes 9ƛɾømĴ;ḆJ Try it Online!


1

APL(Dyalog Unicode), 108 bytes SBCS {'@'@(⊂9 11○⊃⍵)⊢3⊃⍵}{p s g←⍵⋄(p+s)(s←s×0j1ׯ1 1['#_'⍳g[x]])(('_#'~g[x])@(x←⊂9 11○p)⊢g)}⍣⎕⊢9J9 0J1(17 17⍴'_') Try it on APLgolf!, Alternate version A tradfn submission which takes a single number as input.


0

05AB1E, 79 bytes •6ÂËhHyã¡0÷íÓ].‚ηƶãqÛ-#Œ‘-)ìMι"ΩÒý³!7₄βýiÑ¡1:l*;∊ëžZ~Ù¯ΩïŒ×.gιü#‡•“. -"| \“Åв Try it online! •...•“...“Åв # trimmed program Åв # characters in... “...“ # literal... Åв # with indices in digits of... •...• # ...


1

Deadfish~, 5802 bytes {i}{i}{i}ii{c}{c}cccccc{{i}dddddd}iiii{c}ccccccccc{{d}iiiiii}dddd{c}{c}cccccc{d}{d}ddc{i}{i}ii{c}{c}cccccc{{i}dddddd}iiii{c}ccccccccc{{d}iiiiii}dddd{c}{c}cccccc{d}{d}ddc{i}{i}ii{c}{c}cccccc{{i}dddddd}iiii{c}ccccccccc{{d}iiiiii}dddd{c}{c}cccccc{d}{d}ddc{i}{i}ii{c}{c}cccccc{{i}dddddd}iiii{c}ccccccccc{{d}iiiiii}dddd{c}{c}cccccc{d}{d}ddc{i}{...


0

Deadfish~, 1398 bytes {i}{i}{i}ii{c}c{i}{i}dddc{d}{d}iii{c}c{d}{d}ddc{i}{i}iiccccccccc{i}{i}dddc{d}{d}iiic{i}{i}ddc{d}{d}iic{i}{i}dddc{d}{d}iiiccccccccc{d}{d}ddc{i}{i}iicccccccc{i}{i}dddc{d}{d}iiic{i}{i}dc{d}{d}ic{i}{i}dc{d}{d}ic{i}{i}dddc{d}{d}iiicccccccc{d}{d}ddc{i}{i}iiccccccc{i}{i}dddc{d}{d}iiic{i}{i}c{d}{d}c{i}{i}iic{d}{d}ddc{i}{i}c{d}{d}c{i}{i}dddc{d}{...


0

Deadfish~, 1700 bytes {i}{i}{i}ii{c}{c}{c}{c}{c}ccc{i}c{d}{c}cccc{d}{d}ddc{i}{i}ii{c}{c}{c}{c}{c}c{i}cccc{d}{c}ccc{d}{d}ddc{i}{i}ii{c}{c}{c}{c}{c}{i}cccccc{d}{c}cc{d}{d}ddc{i}{i}ii{c}{c}{c}{c}{c}c{i}ccccc{d}{c}cc{d}{d}ddc{i}{i}ii{c}{c}{c}{c}cccccc{i}c{d}c{i}ccccccccc{d}{c}c{d}{d}ddc{i}{i}ii{c}{c}{c}{c}c{i}ccc{d}c{i}{c}cccccc{d}ccccccc{d}{d}ddc{i}{i}ii{c}{c}{...


1

Jelly, 11 bytes ,ḍþælị⁾|-ZY Try it online! How it works ,ḍþælị⁾|-ZY - Main link. Takes A on the left and B on the right , - Pair; [A, B] æl - LCM; L := LCM(A, B) þ - Create a 2×L matrix and for each cell (i,j) i ∈ (A,B), 1 ≤ j ≤ L: ḍ - Is i divisible by j? ị⁾|- - Index into "|-", replacing 1 with &...


1

PowerShell, 281 bytes $n=$args[0];$o="8<";$c="8=";function x{sleep .25};if($n-le0){$n=[math]::abs($n);$o=">8";$c="=8";$p=' '*$n;$p+$o;$x;$p+$c;1..$n|%{$p=$p-replace"\s$","";$p+$o+('-'*$_);if($_-eq$n){break};$x;$p+$c+('-'*$_)};$x}else{$o;x;$c;1..$n|%{ $y='-'*$_;$y+"8<";if($n-eq$_){...


1

Jelly, 35 bytes “¦¿ÆבB;¬$ị⁾<>“,<..>,”ṭ J¢ṗẎẎ⁼¥Ƈ⁸ḢK Try it online! This is brutally inefficient, clocking in at around (I believe) \$O(9^{n^2})\$, and times out on TIO for strings of length \$7\$ or more Returns 0 if the input cannot be interpreted as fish A much faster version is 38 bytes, timing out for length \$21\$ or more How it works ...


1

Stax, 46 41 bytes üîφL↑≥ª⌡↨ÄA ¡`╢Σ·TmÄ↕=≈─Xí♫αF²M☻8]▒2±(═[3 Run and debug it |, was included in a recent release, which is great for this challenge! Uses JS requestAnimationFrame for pausing between snips. Each testcase happens continuously after the other, so if you want a more clear version, try this!. -5 bytes from recursive. (:R) Explanation c|a^5?rFxs0?...


0

Lua, 80 bytes for i=-8,8 do x=9-math.abs(i)n=math.ceil(10^x-1)//9print((" "):rep(9-x)..n*n)end Try it online!


0

Jelly, 7 bytes +þị⁾ XY Try it online! or see the results for \$n = 1, 2, ..., 8\$ How it works +þị⁾ XY - Main link. Takes n on the left from the command line þ - Yield an n×n matrix where each cell (i,j) is, for 0 ≤ i, j ≤ n: + - i + j ⁾ X - Yield " X" ị - Index modularly into " X". Even numbers are replaced with &...


2

SlimSharp, 150 bytes I n=RI(),m=n;S b=new S('-',n*2).Pad(n*-3),l="/",r="\\";Action<I> x=a=>P(l.Pad(-a).Pad(4*n-a)+r);P(b);for(;m>0;)x(m--);l=r;r="/";for(;m<n;)x(++m);P(b); https://dotnetfiddle.net/iXLzcO The fiddle differs slightly from the post because .Net Fiddle can't use the RI() function to read from the ...


0

SlimSharp, 284 characters (bytes not counted) S b(S x){S a="╔=╤=╤=╦=╤=╤=╦=╤=╤=╗\n║";for(I i=0,j=0,k,l,m;j<3;j++)for(k=0;k<3;k++){for(l=0;l<3;l++)for(m=0;m<3;)a+=" "+x[i++]+(m++<2?" │":" ║");a+=i<80?(k<2?"\n╟-┼-┼-╫-┼-┼-╫-┼-┼-╢\n║":"\n╠=╪=╪=╬=╪=╪=╬=╪=╪=╣\n║"):"\n╚=╧=╧=╩=╧=╧=╩=...


3

Zsh, 69 bytes a=$#1 o()<<<${(l/a//=/)s} r()<<<\ ${(l/a>1?a-2:0//+/)s} eval ${1///;} Try it online!


1

brainfuck, 285 bytes +[->---[-<]>-]<++++++++++>>>---->-[<+>-----]+++>-[<+>---]>++++[<++++++++>-]>>,[>>-<<[<<[<.>->+<]<[<]>.[>]>>[<<++>>->+<]<<-[<.>-]<<<.<<<.>>[>]+>[<+>-]>>-[<+>-]&...


1

Zsh, 83 bytes 2=${(l:$1:)} S=$2\ $2 F()for i;(S[i]=\\;S[-i]=/;<<<$S) F {1..$1} <<<$2X F {-$1..-1} Try it online!


2

///, 223 bytes /|/\\\\//i///& / &// &///> /^b|b^v|v^^$|+^ f|fvv&i|||^$|-^^$|-^$|+^^<|$^<-|$>|->vv&i|||| ^^<-|$^<|$^^f|f| ^ f|f^^>|->| ^ >|->^^f|fv|v^||||^^>|->v|v^|||^^^v|v ^ b|b^>//^/\///b\/>/b\/\/$|+\/\/\/<|$\/\///>$+//>i$+ iX/<$// <$ Try it online! Seems like a fitting ...


2

Jelly, 23 bytes RÆḞ”iẋz⁶Ḣj”_ƊṭK€Ṛ$Ɗm€0Y Try it online! Jelly's not great at ascii-art and neither am I How it works RÆḞ”iẋz⁶Ḣj”_ƊṭK€Ṛ$Ɗm€0Y - Main link. Takes N on the left R - [1, 2, ..., N] ÆḞ - k'th Fibonacci for each k in the range ”i - "i" ẋ - Repeat "i&...


2

Charcoal, 7 4 bytes P*⮌S Try it online! (Link to the verbose version.)


0

APL(Dyalog Unicode), 49 47 bytes SBCS {(⊢⍪1↓⊖)(⊢,0 1↓⌽)⍵@(2/¨⍳a)⊢⍵@a⊢⍉⍵@a⊢''⍴⍨2/a←≢⍵} Try it on APLgolf! A dfn submission which takes the string as right argument. -2 borrowing from Ven's answer.


4

05AB1E, 15 bytes gI¨„+×.ΛDg;Iθsǝ Try it online. Explanation: g # Push the length of the (implicit) input-string I # Push the input-string again ¨ # Remove its last character „+× # Push string "+×" .Λ # Use the modifiable Canvas builtin with these three arguments D ...


2

APL (Dyalog Unicode), 74 49 45 bytesSBCS {⍵@(⌈x÷2)∘⍉∘(⌽⍵@(2/¨⍳x))⍣2⊢''⍴⍨2⍴x←≢⍵}(⊢,1↓⌽) Try it online! -11 thanks to ovs


3

Canvas, 13 10 bytes ⤢:⁸/n!n↔┼┼ Try it here! Explanation ⤢:⁸/n!n↔++ ⤢ join input with newlines : duplicate it ⁸ push the input again / make a diagonal out of it n overlap the two ! transpose that result n overlap with the first duplicated one ↔ mirror it horizontally ++ quad-...


2

Whispers v2, 92 bytes > 1 > Input > " _\n/ \\\n| |" >> Then 1 2 1 1 2 1 1 1 2 1 >> L⋅R >> Each 5 4 3 >> Output 6 Try it online! Sort of a run-length encoding. Line 3 encodes the input without sequences of repeated characters. Line 4 builds the list of counts (1 is 1, 2 is the input). Line 6 combines them together ...


1

C, gcc, 141 140 138 137 136 bytes Try it y=16,x;main(i){for(;--y+16;puts(""))for(x=68;x--;printf(L" *"+i/221))for(typeof(0.i)z=i=0;cabs(z)<2&i++<220;z=z*z-x*.035+.37+y*.0581i);} Compile using gcc. -lm may be required.


1

Whispers v2, 148 135 111 bytes > Input > "_" > " " > "/" > "|" > "\\" >> 1⋅2 >> 3+7 >> 3⋅1 >> 4+9 >> 10+6 >> 5+9 >> 12+5 >> Output 8 11 13 Try it online! This took much longer than expected to make. -13 bytes from Michael Chatiskatzi. -24 ...


0

Canvas, 41 bytes H?¹⤢\ /*¹0<? /∙|/╋} v∔↕_|__¶∔↕]_4×}+}_;+↕ Try it here!


2

C (gcc), 212 200 bytes double atof(),x;s;Y=16;main(a,b)int**b;{for(;--Y+16;puts(""))for(x=-1.975;s=x<2;x+=.035,printf(L" *"+s/251))for(_Complex y=x+Y*.0581i,z=a/3*y;s++<251&cabs(z=z*z+(a>2?atof(b[1])+1i*atof(b[2]):y))<2;);} Try it online! Thanks to @KevinCruijssen for -1. Julia set coordinates can be added as command ...


1

Javascript (Node.js), 1216 bytes var c={E:[' __ ','====== \\/ ','| [] |========= ','| )','================',' O-O-O O-O-O \\',],P:[' ',' ','===============','| [] [] [] [] |','===============',' O-O O-O'],B:[' ',' ','===============','|-|-| | |-|-|','=============...


3

Wolfram Language (Mathematica), 172 bytes (m=MapThread[Join,{DiamondMatrix[#][[1;;#+1,1;;#]],2BoxMatrix[#][[1;;#+1,1;;#+1]]}];Print/@StringJoin@@@(Join[m,4Reverse[m]]/.{0->" ",1->"//",2->"^L",4->"\\\\",8->" \""}))& Try it online! Brief explanation: Construct the upper part m with ...


Top 50 recent answers are included