Skip to main content
added an explanation
Source Link
Arnauld
  • 197.6k
  • 20
  • 179
  • 650

JavaScript (ES6), 108 bytes

_=>`8a
4i
2m
172627
1o
0q
0q
053a35
153835
16c6
2m
4i
8a`.replace(/./g,c=>"* "[_^=1].repeat(parseInt(c,36)))

Try it online!


JavaScript (ES6),  112  109 bytes

Returns an array of strings.

_=>[p=1020,960,768,515,512,0,0,28,526,519.9,768,960,p].map(n=>(g=(k,c="* "[n*8>>k&1])=>~k?c+g(k-1)+c:'')(12))

Try it online!

How?

Each value in the array represents the inverted 13-bit value of the left side of the smiley, divided by 8. Dividing by 8 saves 7 bytes overall, although there's a non-integer value in there (519.875, which can be rounded to 519.9).

........***** -> 1111111100000 -> 8160 / 8 = 1020
....********* -> 1111000000000 -> 7680 / 8 = 960
..*********** -> 1100000000000 -> 6144 / 8 = 768
.*******..*** -> 1000000011000 -> 4120 / 8 = 515
.************ -> 1000000000000 -> 4096 / 8 = 512
************* -> 0000000000000 ->    0 / 8 = 0
************* -> 0000000000000 ->    0 / 8 = 0
*****...***** -> 0000011100000 ->  224 / 8 = 28
.*****...**** -> 1000001110000 -> 4208 / 8 = 526
.******...... -> 1000000111111 -> 4159 / 8 = 519.875
..*********** -> 1100000000000 -> 6144 / 8 = 768
....********* -> 1111000000000 -> 7680 / 8 = 960
........***** -> 1111111100000 -> 8160 / 8 = 1020

So, we extract the kth 'pixel' stored in the bitmask n with:

n * 8 >> k & 1

JavaScript (ES6), 108 bytes

_=>`8a
4i
2m
172627
1o
0q
0q
053a35
153835
16c6
2m
4i
8a`.replace(/./g,c=>"* "[_^=1].repeat(parseInt(c,36)))

Try it online!


JavaScript (ES6),  112  109 bytes

Returns an array of strings.

_=>[p=1020,960,768,515,512,0,0,28,526,519.9,768,960,p].map(n=>(g=(k,c="* "[n*8>>k&1])=>~k?c+g(k-1)+c:'')(12))

Try it online!

JavaScript (ES6), 108 bytes

_=>`8a
4i
2m
172627
1o
0q
0q
053a35
153835
16c6
2m
4i
8a`.replace(/./g,c=>"* "[_^=1].repeat(parseInt(c,36)))

Try it online!


JavaScript (ES6),  112  109 bytes

Returns an array of strings.

_=>[p=1020,960,768,515,512,0,0,28,526,519.9,768,960,p].map(n=>(g=(k,c="* "[n*8>>k&1])=>~k?c+g(k-1)+c:'')(12))

Try it online!

How?

Each value in the array represents the inverted 13-bit value of the left side of the smiley, divided by 8. Dividing by 8 saves 7 bytes overall, although there's a non-integer value in there (519.875, which can be rounded to 519.9).

........***** -> 1111111100000 -> 8160 / 8 = 1020
....********* -> 1111000000000 -> 7680 / 8 = 960
..*********** -> 1100000000000 -> 6144 / 8 = 768
.*******..*** -> 1000000011000 -> 4120 / 8 = 515
.************ -> 1000000000000 -> 4096 / 8 = 512
************* -> 0000000000000 ->    0 / 8 = 0
************* -> 0000000000000 ->    0 / 8 = 0
*****...***** -> 0000011100000 ->  224 / 8 = 28
.*****...**** -> 1000001110000 -> 4208 / 8 = 526
.******...... -> 1000000111111 -> 4159 / 8 = 519.875
..*********** -> 1100000000000 -> 6144 / 8 = 768
....********* -> 1111000000000 -> 7680 / 8 = 960
........***** -> 1111111100000 -> 8160 / 8 = 1020

So, we extract the kth 'pixel' stored in the bitmask n with:

n * 8 >> k & 1
added another version
Source Link
Arnauld
  • 197.6k
  • 20
  • 179
  • 650

JavaScript (ES6), 108 bytes

_=>`8a
4i
2m
172627
1o
0q
0q
053a35
153835
16c6
2m
4i
8a`.replace(/./g,c=>"* "[_^=1].repeat(parseInt(c,36)))

Try it online!


JavaScript (ES6),  112  109 bytes

Returns an array of strings.

_=>[p=1020,960,768,515,512,0,0,28,526,519.9,768,960,p].map(n=>(g=(k,c="* "[n*8>>k&1])=>~k?c+g(k-1)+c:'')(12))

Try it online!

JavaScript (ES6),  112  109 bytes

Returns an array of strings.

_=>[p=1020,960,768,515,512,0,0,28,526,519.9,768,960,p].map(n=>(g=(k,c="* "[n*8>>k&1])=>~k?c+g(k-1)+c:'')(12))

Try it online!

JavaScript (ES6), 108 bytes

_=>`8a
4i
2m
172627
1o
0q
0q
053a35
153835
16c6
2m
4i
8a`.replace(/./g,c=>"* "[_^=1].repeat(parseInt(c,36)))

Try it online!


JavaScript (ES6),  112  109 bytes

Returns an array of strings.

_=>[p=1020,960,768,515,512,0,0,28,526,519.9,768,960,p].map(n=>(g=(k,c="* "[n*8>>k&1])=>~k?c+g(k-1)+c:'')(12))

Try it online!

saved 3 bytes
Source Link
Arnauld
  • 197.6k
  • 20
  • 179
  • 650

JavaScript (ES6), 112 112  109 bytes

Returns an array of strings.

_=>[p=8160_=>[p=1020,q=7680960,r=6144768,4120515,4096512,0,0,22428,4208526,4159519.9,r768,q960,p].map(n=>(g=(k,c="* "[n>>k&1]"[n*8>>k&1])=>~k?c+g(k-1)+c:'')(12))

Try it online!Try it online!

JavaScript (ES6), 112 bytes

Returns an array of strings.

_=>[p=8160,q=7680,r=6144,4120,4096,0,0,224,4208,4159,r,q,p].map(n=>(g=(k,c="* "[n>>k&1])=>~k?c+g(k-1)+c:'')(12))

Try it online!

JavaScript (ES6),  112  109 bytes

Returns an array of strings.

_=>[p=1020,960,768,515,512,0,0,28,526,519.9,768,960,p].map(n=>(g=(k,c="* "[n*8>>k&1])=>~k?c+g(k-1)+c:'')(12))

Try it online!

added the TIO link
Source Link
Arnauld
  • 197.6k
  • 20
  • 179
  • 650
Loading
Source Link
Arnauld
  • 197.6k
  • 20
  • 179
  • 650
Loading