# Codegolf : the HEX [closed]

## INTRODUCTION

I like Karma Fields : he's a music producer that creates original music tracks. His artwork also matches up really well his style.

He has a logo witch I find really interessing :

## GOAL

Your goal will be to reproduce that logo, graphically or in ASCII.

Edit

@NahuelFouilleul managed to provide a readable ascii version of this :

     / \
/|   |\
/  |   | |\
|\ /|\ / \|/|
| | \ |     |
|/ \ / \    |
| \ | / |   |
\|/ \|/ \ /
\  |  /
\|/


## RULES

• The logo can be any size BUT has to be recognisable (each hexagon part has to be visible).
• Colors don't matter, only the drawing counts.
• Each line can be the same thickness, and you can forget about the 2 dots.
• This is a codegold challenge, so the least amount of bytes wins.
• The usual loopholes are forbidden.
• recognisable is very subjective, I'd suggest giving a reference ASCII version that has to be matched. – Grimmy Sep 18 '19 at 14:03
• @Grimy roger that, i'll work on it ASAP – The random guy Sep 18 '19 at 14:25
• OK? – Adám Sep 18 '19 at 14:42
• @Adám Yes, this one is valid. – The random guy Sep 18 '19 at 14:54
• otherwise this is more regular and this is shorter – Nahuel Fouilleul Sep 18 '19 at 15:39

## Logo, 170168 160 bytes

make"l[4 5 2 3 1 3 1 1 3 1 5 5 1 3 1 1 2 5 2 5 5 3 5 5 3 0 5 4 5 3 5 5 3 5 5 4 0 0 5 0 0 5 0 0 5 0 0 5 0 0 5 0 0 5 4]repeat 55[rt 60*head:l
fw 20
make"l tail:l]


Try it online! Edit: Saved 2 9 bytes thanks to @Night2.

• There's a language called Logo? Man, they have something for everything. – S.S. Anne Sep 19 '19 at 2:40
• @JL2210 Well, it seemed the ideal language for the job in more ways than one! – Neil Sep 19 '19 at 9:25
• @Night2 There are 46 segments to draw, but there are also 16 odd ends, which need 7 segments to connect, but two of which are 2 segments away from the nearest odd end, for a total of 46 + 7 + 2 = 55, and using the two distant ends as overall endpoints actually consumes more segments than it saves, due to the limitations it imposes on your route. I did find another route of the same length as yours that ended in the same place as my original route though, which is nice aesthetically. – Neil Sep 19 '19 at 19:28
• @Night2 Ah yes, I suspected something like that. Also, you left some white space after a ] which isn't needed, so it's only 160 bytes. – Neil Sep 20 '19 at 9:14

JavaScript, 420 407 bytes

document.write('<svg id="pic" height="255" width="255"></svg>')
v="0011120322210011343546413441045156516421646728696a52586758075b5104074848090a520a4248423a030a".split.map((x,i)=>(i%2?[43,88,175,220,100,72,58,131,144,162,190,117]:[129,206,52,179,154,103,77])[+('0x'+x)])
for(i=1;i<46;i++) pic.innerHTML+=<line x1=${v[2*i-2]} y1=${v[2*i-1]} x2=${v[2*i]} y2=${v[2*i+1]} style="stroke:red;stroke-width:2" />

Point coordinates coding

let c=[129, 43, 206, 88, 206, 175, 129, 220, 52, 175, 52, 88,129, 43, 206, 88, 179, 100, 179, 72, 154, 58, 154, 88, 179, 100, 154, 88,129, 100, 103, 88, 103, 58,103, 88,77, 100, 52, 88,77, 100, 77, 131, 52, 144, 77, 162, 77, 190, 103, 175, 103, 144, 77,  131, 103, 144,129, 131, 103, 117, 103, 88,129, 100, 129, 131,154, 144, 154, 144,129, 162, 129, 190, 103, 175,129, 190,154, 175,154, 144,154, 175, 179, 190,129, 220,129, 190
]

a=[... new Set(c.filter((x,i)=> i%2))] // remove duplicates for X
b=[... new Set(c.filter((x,i)=> i%2-1))] // remove duplicates for Y
d=c.map((x,i)=> (i%2?a:b).indexOf(x).toString(16)).join

console.log({a,b,d});

• Logo turned out somehow really unsatisfying to look at, it's bugging me out. I like that. – The random guy Sep 18 '19 at 18:35

# Raw bitmap (29x35), 202 bytes

Hand drawn a small monochrome bitmap file which looks like the logo. I'm not sure if raw bitmap is accepted here, but if it is not, a HTML version is below the post too.

Please note that the image above is converted to PNG during upload, to see the original image save the hex dump as a binary file or use the HTML version.

000000  42 4d ca 00 00 00 00 00 00 00 3e 00 00 00 28 00  BM........>...(.
000010  00 00 1d 00 00 00 23 00 00 00 01 00 01 00 00 00  ......#.........
000020  00 00 8c 00 00 00 c3 0e 00 00 c3 0e 00 00 00 00  ................
000030  00 00 00 00 00 00 00 00 00 00 ff ff ff 00 ff fd  ................
000040  ff f8 ff f0 7f f8 ff ed bf f8 ff 9d cf f8 fe 7d  ...............}
000050  f3 f8 fd fd fd f8 f1 f8 fc 78 e6 e5 33 b8 97 5d  .........x..3..]
000060  cf c8 77 bd df f0 77 bd df f0 77 bd df f0 6f bc  ..w...w...w...o.
000070  df f0 5f bf 1f f0 3f 9f df f0 4e 67 3f f0 75 fa  .._...?...Ng?.u.
000080  ff f0 7b fd ff f0 7b f9 ff f0 7b e5 ff f0 7b dd  ..{...{...{...{.
000090  ff f0 7b dd ff f0 7b dd ff f0 64 dd fe 70 5f 52  ..{...{...d..p_R
0000a0  78 90 3f 8f a6 e8 bf df de d8 cf df de b8 f3 df  x.?.............
0000b0  de 78 fd df d9 f8 fe 5f d7 f8 ff 9f cf f8 ff cf  .x....._........
0000c0  bf f8 ff f2 7f f8 ff fd ff f8                    ..........


# HTML, 292 bytes

<img src=data:;base64,Qk3KAAAAAAAAAD4AAAAoAAAAHQAAACMAAAABAAEAAAAAAIwAAADDDgAAww4AAAAAAAAAAAAAAAAAAP///wD//f/4//B/+P/tv/j/nc/4/n3z+P39/fjx+Px45uUzuJddz8h3vd/wd73f8He93/BvvN/wX78f8D+f3/BOZz/wdfr/8Hv9//B7+f/we+X/8Hvd//B73f/we93/8GTd/nBfUniQP4+m6L/f3tjP396489/eeP3f2fj+X9f4/5/P+P/Pv/j/8n/4//3/+A

• Don't think the hex dump of the bitmap itself would be a valid entry; so the HTML version should be your score. – BradC Sep 18 '19 at 18:18
• I wonder - does this kind of approach for graphical-output questions - make 'low resolution' picture of desired output - is no too trivial to be allowed? May be the requirement of output image size should be added – Kamil Kiełczewski Sep 18 '19 at 19:05
• Are all the zeros needed? – S.S. Anne Sep 19 '19 at 2:38
• @KamilKiełczewski the OP has said "The logo can be any size BUT has to be recognisable (each hexagon part has to be visible)" and I think this image follows that rule. – Night2 Sep 19 '19 at 3:07
• @JL2210 which specific zeroes do you mean? – Night2 Sep 19 '19 at 3:08

# PHP, 71 bytes

I have used a compressed version of the string created by Nahuel Fouilleul in the OP comments.

Uses raw output of gzdeflate and contains unprintable binary data, so the code itself and direct TIO link cannot be posted here, but here is a hex dump of it:

000000  3c 3f 3d 67 7a 69 6e 66 6c 61 74 65 28 22 15 c7  <?=gzinflate("..
000010  47 01 43 01 14 02 b0 73 97 87 38 c0 10 52 10 df  G.C....s..8..R..
000020  ff 36 01 d1 df 1b 19 76 39 0c 73 5a e5 56 97 3d  .6.....v9.sZ.V.=
000030  34 35 70 8c ba c5 51 4d 8c a3 2e b7 2a 8f 28 73  45p...QM....*.(s
000040  19 74 f9 03 22 29 3b                             .t..");


Save it as a binary file then execute it like this: php hex.php

TIO which uses bash to create and run this file: Try it online!

Base64 of deflated string for anyone who might need it:

FcdHAUMBFAKwc5eHOMAQUhDf/zYB0d8bGXY5DHNa5VaXPTQ1cIy6xVFNjKMutyqPKHMZdPkD