8
\$\begingroup\$

You left your computer for too long, and it went to sleep. Wake it up again by printing the following coffee maker.

________._________
|      | \   -   /
|  ||  |  \  -  /
|  ||  |___\___/
|  ||  |     X
|      |    ___
|      |   / - \
|______|  /  -  \
| ____ | /_______\
||7:30||__________
||____|           |
|_________________|

Reference image I used.

Specs

  • Any input must be included in the byte total.
  • Leading newlines and trailing whitespace is allowed.
  • Shortest code in bytes wins.
\$\endgroup\$
9
  • 7
    \$\begingroup\$ I'm usually fine with different types of KC challenges, but the ASCII art (while pretty good) has no patterns that submissions could benefit from. \$\endgroup\$ Commented Nov 30, 2017 at 20:40
  • \$\begingroup\$ @totallyhuman better now? \$\endgroup\$
    – Nissa
    Commented Nov 30, 2017 at 20:45
  • 3
    \$\begingroup\$ @Pavel that'll be for the microwave challenge. \$\endgroup\$
    – Nissa
    Commented Nov 30, 2017 at 21:32
  • 2
    \$\begingroup\$ Bah, this question changed invalidating the 88-byte answer I had been writing: 7:30⸿⁴↑²←←⁴↓↓²P¹⁷←↑χ⁸Pχ.⸿↘↓²↗↑²M³→↓²P⁸↓³P←⁷↓³↗→χP↓³↖ ↑→¹↖²←²P<⁴←²P>⁴UMKA⎇⁼-ι_ι_↓x--P-×_⁴ Try it online! \$\endgroup\$
    – Neil
    Commented Dec 1, 2017 at 1:53
  • 2
    \$\begingroup\$ @luk3yx If you didn't ask and OP wouldn't have stated otherwise that would have been allowed by default for code-golf as far as I know. \$\endgroup\$ Commented Dec 7, 2017 at 15:19

14 Answers 14

20
\$\begingroup\$

CoffeeScript, 219 bytes

Thanks to @totallyhuman for saving 4 bytes!

->"""#{l="________"}.#{l}_
#{s="|      |"} \\   -   /
#{t="|  ||  |"}  \\  -  /
#{t}___\\___/
#{t}     X
#{s}    ___
#{s}   / - \\
|______|  /  -  \\
| ____ | /_______\\
||7:30||#{l}__
||____|           |
|#{l}#{l}_|"""

Try it online!

\$\endgroup\$
2
  • 13
    \$\begingroup\$ The irony of your language is not lost on me. \$\endgroup\$
    – Nissa
    Commented Nov 30, 2017 at 23:16
  • 10
    \$\begingroup\$ This is not ironic. It is apt. \$\endgroup\$
    – ratbum
    Commented Dec 1, 2017 at 11:43
8
\$\begingroup\$

SOGL V0.12, 78 bytes

≈p⁽.*%θ|»Y?v▼mB8█[=ρļiρKτ¾Γb    2⁴⅟┼¤Μ╬(׀⁾⌠○Yyλ{╝<-³|k¤↑E*UH∙æ¹ΘNσx↔§÷πm‛⁾ņμ׀⁴@≤‘

Try it Here!

SOGL compression beats bubblegum!

\$\endgroup\$
2
  • 1
    \$\begingroup\$ @totallyhuman the whole thing is a compressed string - it ends with and there is no starting ". \$\endgroup\$
    – dzaima
    Commented Nov 30, 2017 at 21:31
  • 1
    \$\begingroup\$ Well of course it beats Bubblegum, it was designed with ASCII-art in mind :P \$\endgroup\$ Commented Dec 1, 2017 at 1:48
6
\$\begingroup\$

Befunge, 166 162 bytes

55+31p"kvvvvvvvvgf:::::kvugvvvvvj6,jHvvvs>?vqg[@:P>vvvg[|P:f::>Jv"v
:0  /\|_-37X.v"vvvv{vvvvg:::>=:@:G>f>f:=|:G>f>fv`vUg:j:>::N>::f::"<
g1+2%+56:-*49<_@#:,g1/+56,

Try it online!

Explanation

This is using a fairly simple compression scheme where every two characters are encoded into a pair as a base 11 number.

We start by translating the characters into indices in a lookup table to minimise their size - this gives us one index in the range 0 to 11, and a second in the range 0 to 8. These indices are combined into a single number as n = i1 + i2*11. We then add a additional offset to translate that number into the range of printable ASCII characters, so it can be stored in a Befunge string.

When decoding we just perform this process in reverse. We subtract the offset, split the value into two parts with i1 = n%11 and i2 = n/11, and then lookup those indices in the translation table to obtain the final characters to output.

Bonus Coffee Mug

55+37p"kvvvvvvvvgf::"v
v",6jvvvvvguvk:::"   <
>"jHvvvs>?vqg[@:P"   v
v"vJ>::f:P|[gvvv>"   <
>"::f::>N::>:j:gU"   v
v"f>f:=|:G>f>fv`v"   <
>">G:@:=>:::gvvvv"   v
:0 X/\|_-37X.v"vvvv{"<
 @v2%+56:-*49<<_>
  >+7g,65+/7g,:^

Try it online!

\$\endgroup\$
4
\$\begingroup\$

JavaScript (ES6), 176 bytes

_=>`22__.222511| 31-1/4636-6/4232/416X511| 12511|1/ - 3522|6/6-635 2_ | /2_235|7:0||222_5|2_|6111|522222__|`.replace(/\d/g,s=>[30,'   ','___','\\',`
|  ||  |`,`
|`,'  '][s]||s)

Try it online!

RegPack'd version, 186 184 bytes

_=>[...'CaFfEiNe!'].reduce((s,c)=>(x=s.split(c)).join(x.pop()),`!E_.C!
f| \\a-aiN\\e-ei|!\\!iNaX
fNe!
fN / - FCN/e-eF E | /!EF|7:30||CE
||Efea|
|CCE_|E__a N|ei/
N|NE!_fNeeF\\
|ae C!!`)

Try it online!

\$\endgroup\$
3
\$\begingroup\$

Bubblegum, 83 bytes

00000000: 4d8c d501 0230 1403 ff3b 4507 c01d 16c1  M....0...;E.....
00000010: c922 199e abf7 9eab 2a2b 3582 63c6 f183  ."......*+5.c...
00000020: 5f62 eb60 4a0c a5b7 9c3b 923e d8bc 028f  _b.`J....;.>....
00000030: f104 e6a7 d89a 0f9f 6065 4c9d 5fd2 8902  ........`eL._...
00000040: 56d6 2ad0 f2f9 b6df d8ea d0aa 671d d75f  V.*.........g.._
00000050: 33fe 03                                  3..

Try it online!

\$\endgroup\$
3
\$\begingroup\$

Bash, 169 165 bytes

Thanks to Nahuel Fouilleul for saving 4 bytes!

base64 -d<<<H4sIAECtIFoCA1WOUQqAMAxD/3uKXmBO8EPwJH4MepEc3sRVrQ86WJZkjZgs8WDwG/jg2ThdEjQurVWFgcGpFnJ+JeRXyjAbhmH+Bt1VSUXGoKXnJpSwH9sKRNkOGXuBlfcEdgGenVY82QAAAA==|zcat

Try it online!

gzip seems to compress it a lot better than bzip2 and xz.

\$\endgroup\$
0
3
\$\begingroup\$

C# (.NET Core), 189 bytes

()=>@"uu__.uuu
|ss| \s-s/
|  ||  |  \  -  /
|  ||  |u\u/
|  ||  |s  X
|ss| su
|ss|s/ - \
|uu|  /  -  \
| u_ | /u_u\
||7:30||uuu_
||u_|  sss|
|uuuuu__|".Replace("u","___").Replace("s","   ")

Try it online!


The lazy solution:

C# (.NET Core), 223 bytes

()=>@"________._________
|      | \   -   /
|  ||  |  \  -  /
|  ||  |___\___/
|  ||  |     X
|      |    ___
|      |   / - \
|______|  /  -  \
| ____ | /_______\
||7:30||__________
||____|           |
|_________________|"

Try it online!

\$\endgroup\$
2
  • \$\begingroup\$ @StephenLeppik I'm keen to see a C# way of compressing this that is shorter than the hardcoded solution, but I haven't been able to find anything. \$\endgroup\$
    – Ayb4btu
    Commented Nov 30, 2017 at 23:13
  • \$\begingroup\$ @StephenLeppik If I go down the Replace route I save some bytes, but I'm still thinking that run-length encoding, or decompressing some compressed string will be longer than hardcoding (keen to be proven wrong though). \$\endgroup\$
    – Ayb4btu
    Commented Nov 30, 2017 at 23:48
1
\$\begingroup\$

brainfuck, 689 bytes

+++++++++>+++>++++++++++++>++++>+++++++++>+>++++>++++>++++>+++++>+++++>++++++++>+++++<<<<<<<<<<<<[[->>>>>>>>>>>>>>++++++++++<<<<<<<<<<<<<<]>]>+++++>++>++++>+++++++>++>>+++++>++++++>++++++++>+>+++++>++++++++>++++++++<<<<<<<<<<<<........>>>>>>>.<<<<<<<.........>>>>>.<<<.<......>.<.>>>.<<<...>>>>>.<<<<<...>>.>>.<<<.<..>..<..>.<..>>>.<<<..>>>>>.<<<<<..>>.>>.<<<.<..>..<..>.<<...>>>>.<<<<...>>>.>>.<<<.<......>.<.....>>>>>>>>>>.<<<<<<.<<<.<......>.<....<...>>>>>.<<<.<......>.<...>>.<<.>>>>>.<<<<<.>>>.>.<<<.<<......>>.<..>>.<<..>>>>>.<<<<<..>>>.>.<<<.<.<....>.>.<.>>.<<<.......>>>>.>.<<<..>>>>>>>>.>>.<<<.<.<<<<<<..<<..........>>>>>.<<<..<<....>>.<...........>.>>>.<<<.<<.................>>.

Try it online!

First I generate a table of 13 characters that are used. To save bytes, I first generate their closest character codes that are divisible by 10. Then I add 0-9 to each of them. Finally I just print them in particular orders.

Unminified source:

+++++++++>+++>++++++++++++>++++>+++++++++>+>++++>++++>++++>+++++>+++++>++++++++>+++++<<<<<<<<<<<<
[[->>>>>>>>>>>>>>++++++++++<<<<<<<<<<<<<<]>]
>
+++++>++>++++>+++++++>++>>+++++>++++++>++++++++>+>+++++>++++++++>++++++++
<<<<<<<<<<<<
........>>>>>>>.<<<<<<<.........>>>>>.
<<<.<......>.<.>>>.<<<...>>>>>.<<<<<...>>.>>.
<<<.<..>..<..>.<..>>>.<<<..>>>>>.<<<<<..>>.>>.
<<<.<..>..<..>.<<...>>>>.<<<<...>>>.>>.
<<<.<......>.<.....>>>>>>>>>>.<<<<<<.
<<<.<......>.<....<...>>>>>.
<<<.<......>.<...>>.<<.>>>>>.<<<<<.>>>.>.
<<<.<<......>>.<..>>.<<..>>>>>.<<<<<..>>>.>.
<<<.<.<....>.>.<.>>.<<<.......>>>>.>.
<<<..>>>>>>>>.>>.<<<.<.<<<<<<..<<..........>>>>>.
<<<..<<....>>.<...........>.>>>.
<<<.<<.................>>.
\$\endgroup\$
5
  • 2
    \$\begingroup\$ Nice but seems to miss out the 3rd || on the 5th line \$\endgroup\$
    – ElPedro
    Commented Dec 1, 2017 at 13:22
  • 1
    \$\begingroup\$ You can change the initialization to ++++++++++[>+++++++++>+++>++++++++++++>++++>+++++++++>+>++++>++++>++++>+++++>+++++>++++++++>+++++<<<<<<<<<<<<<-]. And after adding 0-9, use [<]> to get back to origin. That would save 37 bytes. \$\endgroup\$
    – Colera Su
    Commented Dec 1, 2017 at 13:29
  • 1
    \$\begingroup\$ And round to nearest would save another 19 bytes. Try it online! \$\endgroup\$
    – Colera Su
    Commented Dec 1, 2017 at 13:36
  • 2
    \$\begingroup\$ Good stuff. Since brainfuck only understands eight symbols, I contend that this solution is only 258 and three eighths of a byte long. \$\endgroup\$
    – Fax
    Commented Dec 1, 2017 at 15:32
  • 1
    \$\begingroup\$ @Fax That would be for binaryfuck. \$\endgroup\$
    – Nissa
    Commented Dec 2, 2017 at 21:18
1
\$\begingroup\$

Python 2, 282 265 bytes

a,b,c,d,e,u='_ . | \ / ||'.split();s=' ';t=s*2;z=c+t;y=c+s*6;v=z+u+t
for x in a*8+b+a*9,y+c+s+d+s*3+a+s*3+e,v+z+d+t+a+t+e,v+c+a*3+d+a*3+e,v+c+s*5+"X",y+c+s*4+a*3,y+c+s*3+e+s+a+s+d,y+z+e+t+a+t+d,c+s+a*4+s+c+s+e+a*7+d,u+"7:30"+c*2+a*10,u+a*4+c+s*11+c,c+a*17+c:print x

Try it online!

Actually a fair bit longer than just

print'''TheCoffeePot'''

which would be 227 but it works so posting it anyway as it's the shortest (and so far only) Python answer :)

\$\endgroup\$
3
  • \$\begingroup\$ You can shave of a few bytes from that first line: a,b,c,d,e,s='_.|\/ ';u=2*c;t=s*2;z=c+t;y=c+s*6;v=z+u+t \$\endgroup\$ Commented Dec 1, 2017 at 18:45
  • \$\begingroup\$ @DanielHepper - many thanks but I don't think this is going to go under 200 so have had enough of this challenge now. Will remember your tips for next time and thanks again :) \$\endgroup\$
    – ElPedro
    Commented Dec 2, 2017 at 0:22
  • 1
    \$\begingroup\$ Actually in python 2 print '''the coffee pot''' doesn't work because of the backslashes at the end of the line, you have to escape them which costs you 3 bytes, giving a total of 230. \$\endgroup\$
    – qqq
    Commented Jan 22, 2018 at 22:06
1
\$\begingroup\$

J, 174 164 bytes

Some silly RLE-like compression, lengths encoded as base 99 number :)

_19]\(10#.inv 99x#._28+a.i.'Ls}DR#Er-B{SBh(+dXQwBE=]|LrC$v:x5u}sa"z>f=#Y*?Tzzo8PmK7rZay')#,'_._||\-/|||\-/|||_\_/|||x||_||/-\|_|/-\|_|/_\|7:30|__|_| ||__|',.' '

Try it online!

\$\endgroup\$
1
\$\begingroup\$

brainfuck, 546 bytes

-[+>+[+<]>+]>>++++++++++>------->-[<++>-----]<........<<.+>>.........<.>>>++++[<++++++++>-]--->--[<+>--]++>-[<+>-----]+++>-[<+>---]<<<.<......>.<.<---.>...<<<--.++>>>...<<<.>.>>>.<..>..<..>.<..<.+++>..<<<--.++>>>..<<<.>.>>>.<..>..<..>.<<...---.+++...<<.>.>>>.<..>..<..>.<.....>>>.<<<<<.>>>.<......>.<....<...<.>>>.<......>.<...<<<.>>>.<<<--.++>>>.<---.+++<.>>>.<<......>>.<..<<<.>>>..<<<--.++>>>..<---.+++<.>>>.<.<....>.>.<.<<<.>>.......---.+++<.>>>..>++.+++.-------.---.<..<<..........<.>>>..<<....>>.<...........>.<<<.>>>.<<.................>>.

Try it online!

\$\endgroup\$
0
\$\begingroup\$

Python 3, 220 216 213 bytes

b=0;c='\n -./037:X\\_|'
for i in r"*Z_7stu{NzKBNJ,IOOe-0qj9?s7C?r/XYUX_Fs\hM-\NY+VJ+A.E]?vAx&=gUVSBRq4>PB+]OtO3%PWn%^0c0'B]d5P-$X,(7U$nVq02NRjMp'AAvl!Da(zyVyI":b=b*92+ord(i)-32
while b:print(c[b%13],end='');b//=13

Try it online!

Code to generate code

\$\endgroup\$
1
  • \$\begingroup\$ print(c[b%13],end='') can be print(end=c[b%13]) for -3 bytes \$\endgroup\$
    – Jitse
    Commented Oct 15, 2020 at 11:33
0
\$\begingroup\$

Bash, 108 bytes

zcat

Input is a 104 byte sequence on stdin (represented in hexadecimal below) of the coffee pot compressed in gzip format:

1F 8B 08 01 0F 2D 32 5A 02 00 5D 8C 41 0A 80 30
0C 04 EF 7D 45 3E A0 15 3C 08 BE C4 43 20 1F D9
C7 3B B1 96 56 87 A6 90 21 BB F1 B2 46 A7 C8 1E
64 CE BF 30 35 95 18 9E A3 66 43 C0 99 F9 04 AE
51 02 9F 52 C2 34 78 11 16 94 3B 22 8D 05 70 52
A3 81 D2 71 EE 9B B8 ED A0 5A 6C 20 BA FE A8 DC
9E 9D 56 3C D9 00 00 00
\$\endgroup\$
1
  • \$\begingroup\$ Might as well be Bubblegum. \$\endgroup\$
    – Nissa
    Commented Dec 14, 2017 at 14:35
0
\$\begingroup\$

Cubically, 652 626 bytes

⇒@@@@@@@@
RU+532f1-411@+411f1@-3320@+5432@-4422@@@@@@+4422@-4422@+220@-220@@@+4-0@-4+0@@@+1@-4000@+5432@-4422@@+4422@@-4422@@+4422@-4422@@+220@-220@@+4-0@-4+0@@+1@-4000@+5432@-4422@@+4422@@-4422@@+4422@-50+4@@@-1+00@+1-00@@@-50@-4000@+5432@-4422@@+4422@@-4422@@+4422@-4422@@@@@+311@-333@+5432@-4422@@@@@@+4422@-4422@@@@+510@@@-3320@+5432@-4422@@@@@@+4422@-4422@@@+1@-1@+4-0@-4+0@+220@-3311@+5432@-50+4@@@@@@+50-4@-4422@@+1@-1@@+4-0@-4+0@@+220@-3311@+5432@-4422@+510@@@@-510@+4422@-4422@+1@+50@@@@@@@-1+00@-3311@+5432@@-52@+1-00@-3+4@-1+00@+541@@-50+4f1@@-3320@+5432@@-50+4@@@@+50-4@-4422f1@@@+4422@-5432@+5432@-50+4f1f1@+50-4@

Found via this tool and golfed via search-and-replace, plus a couple custom optimizations.

Try it online!

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.