| Bytes | Lang | Time | Link |
|---|---|---|---|
| 230 | AWK | 250414T162340Z | xrs |
| 045 | Vyxal | 220529T190257Z | naffetS |
| 872 | Deadfish~ | 210319T041626Z | emanresu |
| 200 | C gcc | 180309T132332Z | gastropn |
| 054 | Bubblegum | 170625T175136Z | ovs |
| 043 | Paintbrush | 170714T021631Z | hyperneu |
| 138 | Python 2 | 170627T000758Z | mdahmoun |
| 169 | C# .NET Core | 170627T051302Z | Geoffrey |
| 179 | Python 2 | 170623T223443Z | emtree |
| 134 | JavaScript ES6 | 170623T232513Z | Arnauld |
| 187 | Python 2 | 170626T070112Z | 0xffcour |
| 052 | SOGL V0.12 | 170625T203133Z | dzaima |
| 102 | Retina | 170623T210607Z | Calculat |
| 122 | PHP | 170623T224849Z | Jör |
| 199 | C# | 170624T041709Z | Geoffrey |
| 117 | Ruby | 170624T025455Z | Level Ri |
| 111 | Pyth | 170624T022229Z | Jim |
| 129 | Retina | 170624T001404Z | Neil |
| 055 | MATL | 170623T234238Z | Luis Men |
| 080 | 05AB1E | 170623T215128Z | Neil A. |
| 152 | /// | 170623T232232Z | Conor O& |
| 041 | Charcoal | 170623T215503Z | Charlie |
| 023 | Charcoal | 170623T230515Z | Neil |
| 227 | Mathematica | 170623T222008Z | ZaMoC |
| 050 | 05AB1E | 170623T215411Z | Magic Oc |
| 155 | J | 170623T221945Z | Conor O& |
| 061 | V | 170623T213312Z | DJMcMayh |
AWK, 230 bytes
func p(x){for(S=T;x--;)S=S" ";return S}END{print p(6)(s=(r="_____________")"__")"\n"p(5)(a="/ ")p(13)(b="\\")
for(;i++<5;)print p(5-i)a a p(++x+i+7)b" "b
for(;j++<4;)print p(j-1)b p(27-j+--y)a
print p(j-1)b" "r" /\n"p(j)b s a}
AWK doesn't have any fancy encoding techniques built-in.
Deadfish~, 872 bytes
{iii}iicccccc{iiiiii}iii{c}ccccc{{d}ii}dddddc{ii}iiccccc{i}iiiiic{d}ddddd{c}ccccc{iiiiii}c{{d}ii}ddc{ii}iicccc{i}iiiiic{d}dddddcc{i}iiiiic{d}ddddd{c}c{iiiiii}c{dddddd}cc{iiiiii}c{{d}ii}ddc{ii}iiccc{i}iiiiic{d}dddddcc{i}iiiiic{d}ddddd{c}ccc{iiiiii}c{dddddd}cc{iiiiii}c{{d}ii}ddc{ii}iicc{i}iiiiic{d}dddddcc{i}iiiiic{d}ddddd{c}ccccc{iiiiii}c{dddddd}cc{iiiiii}c{{d}ii}ddc{ii}iic{i}iiiiic{d}dddddcc{i}iiiiic{d}ddddd{c}ccccccc{iiiiii}c{dddddd}cc{iiiiii}c{{d}ii}ddc{iiii}dddc{d}dddddcc{i}iiiiic{d}ddddd{c}ccccccccc{iiiiii}c{dddddd}cc{iiiiii}c{{d}ii}ddc{{i}dd}iic{dddddd}{c}{c}ccccc{i}iiiiic{dddd}iiic{ii}iic{iiiiii}c{dddddd}{c}{c}ccc{i}iiiiic{dddd}iiic{ii}iicc{iiiiii}c{dddddd}{c}{c}c{i}iiiiic{dddd}iiic{ii}iiccc{iiiiii}c{dddddd}{c}ccccccccc{i}iiiiic{dddd}iiic{ii}iicccc{iiiiii}c{dddddd}cc{iiiiii}iii{c}ccc{dddddd}dddcc{i}iiiiic{dddd}iiic{ii}iiccccc{iiiiii}ciii{c}ccccc{ddddd}iic
C (gcc), 200 bytes
char o[28];i,j,k,p;f(){for(k=0;k<39;puts(o))for(memset(o,k&&k<32?32:95,27),i=3;i--;k++)for(j=3;j--;o[24-i*3+j]=" _\\/"[p])o[i*3+2-j]=" _/\\"[p="U@@@B@HH@``@@BB@HH@``@@p@@L@@C@p@EL@UC@"[k]-64>>j*2&3];}
Bubblegum, 67 54 bytes
00000000: 55c9 310d 0040 0804 c1fe 55e0 0043 24f8 U.1..@....U..C$.
00000010: 77f1 c955 cc96 3b95 d65e 6697 4d76 0b93 w..U..;..^f.Mv..
00000020: cf06 f847 0448 d1e6 0ceb 5722 8421 1010 ...G.H....W".!..
00000030: d95b 7e60 ad3f .[~`.?
Paintbrush, 43 bytes, non-competing
13→'_8×←↓s/5{↙s/3→s/3←}↓'\6×↘↑'_8×→↖'_7×←▕┣
Explanation
13→'_8×←↓s/5{↙s/3→s/3←}↓'\6×↘↑'_8×→↖'_7×←▕┣ Program
13→ Move the pointer 13 spaces right
'_ Push '_' onto the stack
8× Multiply it 8 times
← Draw out '________' moving to the left
↓ Move down
s/ Set that cell to a slash
5{ } Execute function 5 times
↙ Move the pointer one spot down and one spot to the left
s/ Set that cell to a slash
3→ Move 3 spaces right
s/ Set that cell to a slash
3← Move 3 spaces left
↓ Move down
'\ Push r'\'
6× Multiply it 6 times
↘ Draw out r'\\\\\\' moving down-right
↑ Move up
'_ Push '_'
8× Multiply it 8 times
→ Draw out '________' moving to the right
↖ Move the pointer one spot up and one spot to the right
'_ Push '_'
7× Multiply it 7 times
←▕┣ Draw out '_______' moving to the left
▕ Remove the rightmost column
┣ Mirror the entire grid to the right, overlapping the inner column, flipping some characters that have backwards variants
Beta Testing in the Real World:
Charcoal: 1
Paintbrush: 0
Gotta make a lot of improvements, huh. :P
Python 2, 154 138 bytes
print'eNp10MEJAEEIA8C/VaSDNBTY/rtYlByci+aZER8BMqcnqiR6FG7/IPd87w0c/pQMYBrFJmxhQDstljJSQUrb5euhZzBe6PI3aQ=='.decode('base64').decode('zip')
C# (.NET Core), 169 bytes
var d=new char[364];for(int i=10;i-->0;)for(int j="ppnggffggn"[i]-97;j-->0;)d[28*"amlhbccbha"[i]+"ggh{fguva|"[i]-2813+j*("b|~}"[i/3]-97)]="_/\\\n"[i/3];Console.Write(d);
Ungolfed:
var d = new char[364];
for (int i = 10; i-- > 0; )
for (int j = "ppnggffggn"[i] - 97; j-- > 0; )
d[28 * "amlhbccbha"[i] + "ggh{fguva|"[i] - 2813 + j * ("b|~}"[i / 3] - 97)] = "_/\\\n"[i / 3];
Console.Write(d);
For each stroke I encoded the start position, length, character used, and direction within various strings. I saved a few bytes by grouping up similar strokes.
Sadly, this prints a little weird in tio. This is because I'm not printing out real spaces. Looks fine in my console, though. So probably this submission doesn't count. Here's the link anyways.
Python 2, 226 213 bytes 179 bytes
My first golf!
b,f,s,u='\/ _'
print'\n'.join([s*6+u*15,s*5+f+s*15+b]+[s*(4-n)+'/ /'+s*(13+2*n)+'\ \\'for n in range(5)]+[s*n+b+s*(25-2*n)+f for n in 0,1,2,3]+[s*4+b+s*2+u*13+s*2+f,s*5+b+u*15+f])
I tried looping the bits that I could find a pattern on, and hardcoded the rest. Setting the different characters to a variable helped save quite a lot of bytes.
Edit: Decided to append to the same array instead of joining multiple times. Saved 13 bytes.
Edit 2: Thanks to @ValueInk, @jacoblaw, @WheatWizard, @CalculatorFeline, and @Challenger5, saved 34 bytes
JavaScript (ES6), 144 143 140 138 134 bytes
A recursive function drawing the output character by character with a purely conditional expression.
f=(p=363)=>(m=p%28-14,x=m<0?-m:m,y=p/28|0,p--)?`\\/ _
`[m+14?x<8-y&y<2|x<8&y>11?3:x==y+8|x==19-y|x==16-y&y>5&x>5?m<0^y>5:2:4]+f(p):''
How?
For each position 0 < p ≤ 363, we define:
- m = (p MOD 28) - 14
- x = | m |
- y = ⌊ p / 28 ⌋
Below is a breakdown of the formula which picks the appropriate character from [ '\', '/', ' ', '_', '\n' ].
m + 14 ? // if this is not an end of line:
x < 8 - y & y < 2 | // if this is either part D
x < 8 & y > 11 ? // or part E:
3 // output '_'
: // else:
x == y + 8 | // if this is either part A
x == 19 - y | // or part B
x == 16 - y & y > 5 & x > 5 ? // or part C:
m < 0 ^ y > 5 // output '/' or '\' depending on the quadrant
: // else:
2 // output a space
: // else:
4 // output a Line-Feed
And below are the different parts in the coordinate system defined above:
| 13 12 11 10 09 08 07 06 05 04 03 02 01 00 01 02 03 04 05 06 07 08 09 10 11 12 13
---+---------------------------------------------------------------------------------
12 | . . . . . . E E E E E E E E E E E E E E E . . . . . .
11 | . . . . . B . . . . . . . . . . . . . . . B . . . . .
10 | . . . . B . . C . . . . . . . . . . . C . . B . . . .
09 | . . . B . . C . . . . . . . . . . . . . C . . B . . .
08 | . . B . . C . . . . . . . . . . . . . . . C . . B . .
07 | . B . . C . . . . . . . . . . . . . . . . . C . . B .
06 | B . . C . . . . . . . . . . . . . . . . . . . C . . B
05 | A . . . . . . . . . . . . . . . . . . . . . . . . . A
04 | . A . . . . . . . . . . . . . . . . . . . . . . . A .
03 | . . A . . . . . . . . . . . . . . . . . . . . . A . .
02 | . . . A . . . . . . . . . . . . . . . . . . . A . . .
01 | . . . . A . . D D D D D D D D D D D D D . . A . . . .
00 | . . . . . A D D D D D D D D D D D D D D D A . . . . .
Demo
f=(p=363)=>(m=p%28-14,x=m<0?-m:m,y=p/28|0,p--)?`\\/ _
`[m+14?x<8-y&y<2|x<8&y>11?3:x==y+8|x==19-y|x==16-y&y>5&x>5?m<0^y>5:2:4]+f(p):''
o.innerHTML = f()
<pre id=o></pre>
Python 2, 187 bytes
a=`int("7YSUQZDJS0I3J2QJ40G9WNPIRBTBC1KF0F3X5WDMBW8CG5BVDHBJQ71V3UHCSY3TR8LC4IIEE5SZ",36)`[:-1]
for i in"0666666_!6__!5/!3\\!9\n!844!422!211!1 ".split("!"):a=a.replace(i[0],i[1:])
print a
Retina, 129 114 102 bytes
Thanks to ovs for -12 bytes!
6eea¶5/15\¶4c1b3c3b2c5b1c7bc9b\25d1\23d2\21d3\19d4\2ee_2d5\eea/
e
aa
d
/¶
c
/2/1
b
\2\¶
a
___
\d+
$*
PHP, 122 bytes
<?=gzinflate(base64_decode("ddDBDQAgCEPRO1N0AxYicf8tFK2JIPT4HycA34iTHRVxJqwvGLvme8LXrxRAKoVmBZypoMNFjbmUtMEl/OV2WHqYTg"));
PHP, 158 bytes
for(;~$c='f000
e/o1d/b/k\b1c/b/m\b1b/b/o\b1a/b/q\b1/b/s\b1\y/
a\w/
b\u/
c\s/
d\b00___b/
e\000/'[$i++];)echo$c>_?str_pad("",ord($c)^96):strtr($c,[_____,"\
"]);
PHP, 165 bytes
<?=strtr("5566666
57/3334
5 13552513352713332 13355 213335 2433335 0 433355 0743333054333505 476666_ 057466666/",[" /
","/ /","\ \
"," ","\\"," ",___," "]);
C#, 210 199 bytes
Encodes the length of space runs and underscore runs:
var h=@"5KL4/>\L3/1/:\1\L2/1/<\1\L1/1/>\1\L0/1/@\1\L/1/B\1\L\H/L0\F/L1\D/L2\B/L3\1I1/L4\K/L";for(var i='M';--i>'/';)h=h.Replace(""+i,i>75?"\n":"".PadLeft(i>72?i-60:i-47," _"[i/73]));Console.Write(h);
Ungolfed:
var h = @"5KL4/>\L3/1/:\1\L2/1/<\1\L1/1/>\1\L0/1/@\1\L/1/B\1\L\H/L0\F/L1\D/L2\B/L3\1I1/L4\K/L";
for (var i = 'M'; --i > '/'; )
h = h.Replace("" + i, i > 75 ? "\n" : "".PadLeft(i > 72 ? i - 60 : i - 47, " _"[i / 73]));
Console.Write(h);
Ruby, 117 bytes
13.times{|i|s=[?_*(15--i%12*1.3),"/%#{i*2+8}s"%?\\,''][(i%12%11+3)/5].center(27)
i>0&&(s[i-=7]=?\\)&&s[~i]=?/
puts s}
Pyth, 111 bytes
J\/K\\+*6d*15\_+++*5dJ*15dKV5+++*-5hNd"/ /"*+yN11d+++KddK)V4+++*NdK*-25yNdJ)+++++*4dK*2d*13\_*2dJ+++*5dK*15\_J
This code basically prints the lines one after another (in the naive way of doing it). Yeah it sucks, but right now I'm in no state of doing better, and I too still wanted to pay tribute to HyperNeutrino.
Retina, 129 bytes
5$* ¶
\G (?=( *))
¶$1/ /$`11$* $`\ \
r`(?<=( *)) \G
$1\$'19$* $'/¶
^
6$* 15$*_¶5$* /15$* \
¶$
¶ \ 13$*_ /¶5$* \15$*_/
Try it online! Completely different approach, yet coincidentally the same length!
05AB1E, 92 86 80 bytes
'_15×6ú'/5úð8׫.∞5F'/4N-ú'/2ú«ð6N+׫.∞}4F'\Núð13N-׫.∞}'\4ú'_7×2ú«.∞'\5ú'_8׫.∞»
Explanation in parts
The bar at the top
'_ # underscore
15× # repeated 15 times
6ú # with 6 spaces in front
The line immediately below the bar
'/ # forward slash
5ú # with 5 spaces in front
ð # space
8× # repeated 8 times
« # concatenated with the earlier string
.∞ # intersected mirror (i.e middle space not affected)
# mirroring: " / " => " / \ "
The remainder of the upper portion of the hexagon
5F # for N in 0..4
'/ # forward slash
4N- # 4 - N
ú # spaces in front of the slash
'/ # another forward slash
2ú # with 2 spaces in front
« # concatenated with the other string
ð # a space character
6N+ # N + 6
× # times
« # concatenated with the other string
.∞ # intersected mirror
} # end for
The remainder except for the last 2 lines
4F # for N in 0 .. 3
'\ # backslash
Nú # with N spaces in front
ð # a space
13N- # 13 - N
× # repeated
« # concatenated with other string
.∞ # intersected mirror
} # end for
The second to last line
'\ # backslash
4ú # with 4 spaces in front
'_ # underscore
7× # repeated 7 times
2ú # with 2 spaces in front
« # concatenated with earlier string
.∞ # intersected mirror
The last line
'\ # backslash
5ú # with 5 spaces in front
'_ # underscore
8× # repeated 8 times
« # concatenated with other string
.∞ # intersected mirror
The » at the end joins everything on newlines.
///, 152 bytes
/,/ //'/\\!!!//&/\\"\\
//%/\/"\/!!//#/_____//"/,\\//!/,, /! ###
!\/!!!\\
,"% \& "% "&"%!\& \%!"&\%!,"&\'!!\/
\'! "/
"'! \/
"',"/
,"\,##___"/
!\\###\/
Charcoal, 47 43 41 bytes
↗⁶F¹⁵_↓↘⁶←↙⁶↷⁴↑F¹⁵_↖⁶M⁴→↗⁵M¹¹→↓↘⁵M⁵↙↑F¹³_
I did not know a thing about Charcoal until right now, I felt like "I have no idea of what I'm doing" while trying to figure out this answer... I'm quite sure this can be golfed a lot.
Updates:
- I managed to save 4 bytes learning to use cursor directions and movements!
- 2 more bytes saved after realizing the drawing was not exactly as asked. ^__^U
Charcoal, 23 bytes
×_⁷↙←×_⁸↖⁶→↗⁶P×_⁸↘↓↙⁵‖B
Try it online! Explanation: Prints the lines in the following order, then reflects everything horizontally:
5_______
/
/ 6
/ ↙
/ /
↗ /
4 /
\
\
\
\
↖ 1→_____
3______←2
Mathematica, 227 bytes
t=Table;T[x_,y_,z_,v_]:=""<>{x,y~t~v,z};Column[Join[b={""<>"_"~t~15},{T["/"," ","\\",15]},t[T["/ /"," ","\\ \\",i],{i,11,19,2}],t[T["\\"," ","/",i],{i,25,19,-2}],{T["\\ ","_"," /",13]},{""<>{"\\",b,"/"}}],Alignment->Center]
05AB1E, 50 bytes
•ι¡≠ït]4uƵŽΣ”9g½ùöèri|)á,ćè’∍é•5B3ÝJ"/ _\"‡4¡.B».∞
The compression:
The strategy here was to build half the object, then mirror the image across the halfway mark. To do this, I first built the left half, with front padding:
11111122222222
111110
11110110
1110110
110110
10110
0110
3
13
113
1113
1111311222222
11111322222222
But no right padding, this is because the .B function in 05AB1E can be used to make every element equal in length using spaces. This allows for me to omit the extraneous spaces to the right and just delimit by newlines. I then, took this pattern, and removed all newlines replacing them with 4 to get:
1111112222222241111104111101104111011041101104101104011043413411341113411113112222222411111322222222
Compressing this with base-255 results in:
•ι¡≠ït]4uƵŽΣ”9g½ùöèri|)á,ćè’∍é•5B
Where the two • is denoting a base-255 compressed string and 5B is converting it to base-5.
The second part, after the compressing:
3ÝJ # Push '0123'.
"/ _\" # Push '/ _\'.
‡ # Replace each in b with a on c.
4¡ # Split on 4's (the newlines I replaced).
.B # Boxify for the mirror (adds padding to longest element).
» # Join by newlines.
.∞ # Mirror image.
J, 155 bytes
('_ /\',LF){~5#.inv 95x#.32-~3 u:'0_C5NcBe''e2kA/jhk>5y~l<Z:AN<QG)V7m>l"x!@A-jp8E%XEh&"$''j(sP8Z!b#e7})]_,L"LCUu)kqsBQ5_5bt}`bq ":1cv(gU;|{I~n5q@(ISCK `'[<
This is a function that expects no input. E.g., f =: <code> then f ''.
Explanation
I encoded this using the following steps. Assume that the desired compression string is contained in the variable h.
k=:'_ /\',LF NB. the dictionary used to encode the string
k i. h NB. numbers corresponding to indices in `k`
1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 4 1 1 1 1 2 1 1 2 1 1 1 1 1 1 1 1 1 1 1 3 1 1 3 4 1 1 1 2 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 3 1 1 3 4 1 1 2 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 1 1 3 4 1 2 1 1 2 1 1 1 ...
5x#.k i. h NB. base 5 to decimal
4571656960356964266407389291886526966074643634545109498506871241033015964671946641835339522170115810676380078148856766959449166714046433431522704650346045752930168245684048485736756807881102718244115576453623363843561553955078139
95#.inv 5x#.k i. h NB. decimal to base 95
16 63 35 21 46 67 34 69 7 69 18 75 33 15 74 72 75 30 21 89 94 76 28 58 26 33 46 28 49 39 9 54 23 77 30 76 2 88 1 32 33 13 74 80 24 37 5 56 37 72 6 2 4 7 74 8 83 48 24 58 1 66 3 69 23 93 9 61 63 12 44 2 44 35 53 85 9 75 81 83 34 49 21 63 21 66 84 93 64 66 8...
quote u:32+95#.inv 5x#.k i. h NB. base 95 to ASCII repr of string
'0_C5NcBe''e2kA/jhk>5y~ll"x!@A-jp8E%XEh&"$''j(sP8Z!b#e7})]_,L"LCUu)kqsBQ5_5bt}`bq ":1cv(gU;|{I~n5q@(ISCK `'
Then, we just need to decode this. 5#.inv 95x#.32-~3 u: performs the inverse of what I just described, giving us the list of indices. Then, ('_ /\',LF){~ applies the appropriate characters to each index.
V, 61 bytes
i/ /±¹ \ \
\²µ /6ñGÙlxxhPHÄãxx>ñv$r_jwr w.Gkkl13r_jviwr_jd
Hexdump:
00000000: 692f 2020 2fb1 b920 5c20 205c 0a5c b2b5 i/ /.. \ \.\..
00000010: 202f 1b36 f147 d96c 7878 6850 48c4 e378 /.6.G.lxxhPH..x
00000020: 783e f176 2472 5f6a 7772 2077 2e47 6b6b x>.v$r_jwr w.Gkk
00000030: 6c31 3372 5f6a 7669 7772 5f6a 64 l13r_jviwr_jd