Take the 2-minute tour ×
Programming Puzzles & Code Golf Stack Exchange is a question and answer site for programming puzzle enthusiasts and code golfers. It's 100% free, no registration required.

Your goal is to write the shortest program that outputs "Hello-World!" as ASCII art.

Rules :

  • It must be human readable, I don't care about it's size (cols/rows)
  • Output must contain only spaces (" "), sharps ("#") and newlines
  • The output must work with a monospaced font (but the letters doesn't necessary use a monospaced font)
  • In the result, each character must be separated from each other by at least one space

Please add a title with the language and the number of bytes in your code.

share|improve this question
5  
bash: 33 characters – pastebin.com/HZ1w8z8g Is this acceptable? –  manatwork Feb 6 at 13:51
4  
Why the hyphen though?... –  Timwi Feb 6 at 14:16
1  
I suppose to make impossible or unfeasibly hard the use of something predefined like HQ9+. –  manatwork Feb 6 at 14:23
1  
@PeterTaylor: The output consisting of spaces and hashes must work with a monospaced font, but the letters represented by the plethora of hashes need not all have the same width. –  Timwi Feb 6 at 14:39
1  
Related, but different: Say “Hello” to the world in ASCII art –  Ilmari Karonen Feb 6 at 15:58
show 11 more comments

31 Answers

up vote -3 down vote accepted

Shell + pyfiglet, 31 characters

pyfiglet can run as a shell tool, so we can simply go like this:

pyfiglet -f'3x5' 'Hello-World!'

which gives us:

# #      #   #          # #          #    #  #  
# # ###  #   #  ###     # # ### ###  #  ###  #  
### ##   #   #  # # ### ### # # #    #  # #  #  
# # ###  ##  ## ###     ### ### #    ## ###     
# #                     # #                  #  

Looks much better with less line spacing.

Letters are separated with one space, and in terminal it's well readable.

share|improve this answer
3  
You could save two chars by just dropping the py. Also, there's no need to quote 3x5. –  Ilmari Karonen Feb 7 at 23:29
6  
Big rule abuse, nothing even remotely similar to golfing. –  Tomas Feb 9 at 14:05
1  
No need for any of those quotes –  Kevin Feb 9 at 16:53
1  
Why not just compile one of the other solutions in this post, and give the binary a one character name? –  The111 Feb 9 at 21:43
1  
Taku, the purpose of code golf should be to write a short program that solves the problem, not just call another program or library or whatever that already solves the very problem! Otherwise we might get to the extreme @The111 mentions. Well, it's a hole in the rules, it's your decision to abuse it or not. But think why did you get zero upvotes.. –  Tomas Feb 10 at 10:23
show 2 more comments

JavaScript, 178 bytes

c=document.createElement("canvas").getContext("2d");c.fillText("Hello-World!",0,7);d=c.getImageData(1,0,56,7).data;s="";for(i=3;i<1568;i+=4){s+=d[i]?"#":" ";s+=(i+1)%224?"":"\n"}

That works in Firefox 27 Scratchpad.

#   #        #  #          #   #   #          #     #  #
#   #        #  #          #  # #  #          #     #  #
#   #   ##   #  #   ##      # # # #   ##   ## #   ###  #
#####  #  #  #  #  #  #     # # # #  #  #  #  #  #  #  #
#   #  ####  #  #  #  # ##  # # # #  #  #  #  #  #  #  #
#   #  #     #  #  #  #     # # # #  #  #  #  #  #  #   
#   #   ###  #  #   ##       #   #    ##   #  #   ###  #
share|improve this answer
    
I recognise Arial :-D –  Timwi Feb 6 at 14:35
4  
This is my favourite. You've used an interesting method to arrive at the solution. Wonderful! –  user973810 Feb 6 at 18:24
2  
Ingenious, I do believe you've just created Figlet for JavaScript ;) –  WallyWest Feb 6 at 21:06
    
Dagnammit, this was my first thought too! Here's an upvote instead. :) –  Jordan Gray Feb 17 at 16:33
add comment

Mathematica 101 99 98

This rasterizes the expression, obtains the binary image data, converts each 1 to "#", each 0 to "" (empty space) and displays output in a 12 by 136 character grid.

GraphicsGrid[ImageData@ImageResize[Binarize@Rasterize@Style["Hello-World!",99],130] 
  /.{1→"",0→"#"}]

hello

One character economized thanks to Jonathan Van Matre.

share|improve this answer
1  
Why does the thickness vary between the l's? –  MrZander Feb 7 at 1:26
    
I did the rasterization on the expression as a single image. If I had done it letter by letter, the l's would have been identical. Also, by increasing the rasterization grid size, the output tends to approach the quality of the printed characters. But a larger grid results in relatively smaller "#", to the point that they appear to be mere pixels. The question remains: why do 2 l's in an image receive different weights? –  David Carraher Feb 7 at 1:41
3  
@MrZander, that's the very reason fonts have hinting: When trying to fit fonts into a low-resolution pixel grid, like in ASCII art or on screen stem width is never really uniform because the font cannot have integral-pixel wide stems at all sizes. Here is a nice explanation with pictures. –  Joey Feb 7 at 8:50
    
@Joey, nice explanation and link. –  David Carraher Feb 7 at 12:26
1  
Jonathan Van Matre, Thanks. The first parameter could be reduced to 99 but I wouldn't want to reduce the second, due to output quality. (I realize that this is a code-golf challenge, but I do have my pride.) –  David Carraher Feb 12 at 17:33
show 2 more comments

Delphi 85 bytes

var s:tstringlist;begin s:=tstringlist.Create;s.LoadFromFile('\a');Write(s.Text);end.

I know, its not the prettiest solution but there was no rule that said you couldnt use external resources.
Result: Result

share|improve this answer
9  
+1 for the creativity of using # as background rather than foreground. –  gerrit Feb 7 at 12:32
1  
You can declare s as TStrings instead. (But keep the instantiation with TStringList.) –  manatwork Feb 7 at 19:58
    
Is the file you're loading from something that actually ships with Delphi, or did you write it yourself? If the latter, I think you'd need to count its length as part of your score. –  Ilmari Karonen Feb 8 at 2:36
    
@Ilmari, I'm sure Delphi doesn't ship with a file with "Hello-World" ASCII art :) Moreover, it's described in the answer, that it uses external resources. –  TLama Feb 9 at 7:24
2  
@TLama: I assumed so, too, I was just trying to phrase it politely. My point is that, even if external resources were allowed, this program would still fail on anyone's computer except its author's (and, in fact, we have no proof that it even works on his computer). Also, I can beat his score with the following Perl script: do X. The content of the "external resource" X is left unspecified (it works for me, isn't that enough?), but I've provided a couple of possible suggestions below... –  Ilmari Karonen Feb 9 at 7:44
add comment

I absolutely enjoyed this one

Perl, 126 116 114 102 98  87 (69) chars (ascii only & no external fonts)

As of now shortest ascii solution which doesn't use any external fonts.

Well, I wanted to present some elegant solution but @Ilmari Karonen challenged me with unpack... shouldn't have done that :-)

Well, this 92 88 69 chars code generates the uglish unreadable output identical to @Ilmari Karonen's:

say map{y/01/ #/r}unpack"((b6)7a)*",'eT@j@DE
UUBjdeE
wTujjTA
eUBTddE'

More elegant variant without unpack (88 chars):

map{print$"x$_,$/x/4/,"#"x!/7/}7&ord,7&ord>>3for'HRyYOKLIIjIRHBa@AJIAIIIJaQHQNSRH'=~/./g

But I think such |.|e||.-|||.,d! thing is nothing which resembles Hello-World! and shouldn't be allowed, so real solution goes here - unpack variant, 87 chars:

say map{y/01/ #/r}unpack"((b6)9a)*",'E`D@HB@Hd
EcD@HB@Hd
ggDsIbaIf
e`dDhRRHE
ECICPaQPf'

Output:

enter image description here

More elegant variant at 98 chars:

map{print$"x$_,$/x/1/,"#"x!/7/}7&ord,7&ord>>3for'PW{nw^QD[w}vK@X@PcP@jCDjXQk[rRRbSQD\CWbXeX'=~/./g

Output:

enter image description here

Older solution (114 chars), different type of coding:

print'#'x(3&ord),$"x($:=15&ord>>2),$/x!$:for'EmM}U}]MBEQSM}U}]MBOFNMQOKUMSKUOBEM]MMM]IIIMIUQIAEQWMMgFROYQOB'=~/./g

Output:

enter image description here

share|improve this answer
    
Forgot the exclamation at the end, i.e. Hello-World! Also, should be lower-case e, but I know you did upper-case to make it readable as a five pixel high font... –  Yimin Rong Feb 6 at 17:25
    
Thanks @YiminRong, fixed –  Tomas Feb 6 at 18:00
add comment

Perl 5, 54 bytes / 71 printable ASCII chars

Note: This is the second version of this answer. For the original 64-byte / 95-char version using PHP and gzinflate(), see the history of this answer.

Here's the 71-char printable ASCII version:

y/01/ #/,say for unpack'(B40)4',unpack u,'4I*`1`(JJI!$FFNRJU52HIJ0*))H'

The 54-byte version contains non-printable characters, so I'm providing it as a hex dump. On Unixish systems, you can use xxd -r to turn the hex dump back into an executable Perl script:

0000000: 792f 3031 2f20 232f 2c73 6179 2066 6f72  y/01/ #/,say for
0000010: 2075 6e70 6163 6b27 2842 3430 2934 272c   unpack'(B40)4',
0000020: 27a4 a011 008a aaa4 1126 9aec aad5 54a8  '........&....T.
0000030: a6a4 0a24 9a27                           ...$.'

Both need to be run with perl -M5.010 to enable the Perl 5.10+ say feature. They will produce the following output:

Screenshot of "Hello-World!" ASCII art

(Shown as a screenshot, because the huge line-height on SE makes ASCII art ugly and hard to read. The lower case "e" is kind of awkward, but I believe this qualifies as readable, if only barely so.)


Ps. If the output of the solution above feels too minimalistic for you, here's a 92-character variant that produces output similar to Tomas's solution:

y/01/ #/,say for unpack'(B56)*',unpack u,'CH!(`"(`"":,2``B``@GGDC\'(C#(YI!)("I)"2*,),`4,03D'

Here's a screenshot:

Screenshot of "Hello-World!" ASCII art


Pps. I'm pretty sure this (GolfScript, 51 chars) is the shortest printable-ASCII solution, if you don't count the ones that just call banner / FIGLet or that cheat in some other way:

'iJ@Q@HmURBIMM{JkUUJeMRAQIM'{2base(;{' #'=}/}%39/n*

The output is the same as for my 71-char Perl solution above.

share|improve this answer
    
I'd say you have just crossed the border of readability :-) –  Tomas Feb 6 at 22:47
1  
It's considerably more readable in my terminal than here on SE, because of the huge line spacing here. –  Ilmari Karonen Feb 6 at 23:09
    
I mean, it is unreadable anyway. BTW I can produce your output in 92 chars, with no external compression algorithm :-) –  Tomas Feb 7 at 10:24
    
@Tomas: You're right, zipping does not seem to be the winning answer here. I'd give you a +1 for that if I hadn't already. BTW, I can do it in 71 chars; see above. :-) –  Ilmari Karonen Feb 7 at 13:29
1  
Ilmari, you shouldn't have challenged me with unpack :-) Found a solution of 69 chars (87 with the nice output of mine). –  Tomas Feb 9 at 16:55
show 3 more comments

Shell + Figlet (35)

$ figlet -w 90 -f banner Hello-World!
#     #                                   #     #                             ### 
#     # ###### #      #       ####        #  #  #  ####  #####  #      #####  ### 
#     # #      #      #      #    #       #  #  # #    # #    # #      #    # ### 
####### #####  #      #      #    # ##### #  #  # #    # #    # #      #    #  #  
#     # #      #      #      #    #       #  #  # #    # #####  #      #    #     
#     # #      #      #      #    #       #  #  # #    # #   #  #      #    # ### 
#     # ###### ###### ######  ####         ## ##   ####  #    # ###### #####  ### 
share|improve this answer
    
What kind of font is this? Those just look like smaller upper-case characters. –  Cruncher Feb 6 at 19:14
    
it's banner -f banner It was the first font I found that used # instead of * or | and _. –  grim Feb 6 at 19:39
    
here's the same in pure Python –  J.F. Sebastian Feb 7 at 8:03
    
Changing "90" to "9" yields a tall and skinny hello world, however because the OP does not care about columns or rows, it should be acceptable. –  alexy13 Feb 7 at 11:42
    
Sometimes voters baffle me. How come this gets a net score of +8, but the other figlet answer gets a net score of -3? –  DigitalTrauma Apr 18 at 20:28
add comment

Python 260 215 186 152

>>> print'eJyNkFEKwDAIQ/93isC7/x3LyIJullHrR1BfJSIJPUHTlmiUPHbxC7L56wNCgZAxv3SjDWIxsoOb\nzMaBwyHYPJ5sVPNYxXism74vcIsFZlYyrg=='.decode('base64').decode('zip')
#   #        #  #          #   #   #          #     #  #
#   #        #  #          #  # #  #          #     #  #
#   #   ##   #  #   ##      # # # #   ##   ## #   ###  #
#####  #  #  #  #  #  #     # # # #  #  #  #  #  #  #  #
#   #  ####  #  #  #  # ##  # # # #  #  #  #  #  #  #  #
#   #  #     #  #  #  #     # # # #  #  #  #  #  #  #   
#   #   ###  #  #   ##       #   #    ##   #  #   ###  #

Python 196 183 130 114 (but uglyer)

>>> print'eJxTVlBWgCAgAQHKqBywAJeyAgJCZREcZWUYyaUMIpUVEKqRNcLEueDqEaZBLVVWQDITADIdFBw='.decode('base64').decode('zip')
# #  #  # #        # # #        #   # #
# # # # # #  #     # # #  #  ## #  ## #
### ##  # # # # ## # # # # # #  # # #
# #  ## # #  #      # #   #  #  #  ## #

I used zipped data in base64 encoding. and the code decode it from base64 encoding and then unzipping it.

share|improve this answer
    
Wow, that's really stretching legibility! –  Yimin Rong Feb 7 at 16:19
add comment

PHP — 183 bytes

Using sebcap26's ASCII art as the source...

foreach(str_split(base64_decode('iASAERACCYgEgBKQAgmIxIwKoxo5+SSSCqSSSYnkksqkkkmJBJIKpJJIiOSMBEMSOQ'))as$i=>$j)echo strtr(sprintf("%8s%s",decbin(ord($j)),($i+1)%7?"":"\n"),'01',' #');

#   #        #  #          #   #   #          #     #  #
#   #        #  #          #  # #  #          #     #  #
#   #   ##   #  #   ##      # # # #   ##   ## #   ###  #
#####  #  #  #  #  #  #     # # # #  #  #  #  #  #  #  #
#   #  ####  #  #  #  # ##  # # # #  #  #  #  #  #  #  #
#   #  #     #  #  #  #     # # # #  #  #  #  #  #  #   
#   #   ###  #  #   ##       #   #    ##   #  #   ###  #
share|improve this answer
add comment

Sclipting, 38 characters (76 bytes)

갦륈똄릵꺕녔꺒녪냕녪낷뚕년꺒녦냉괄낵要감嚙긂밃⓶掘⓶終丟併껧뜴꼧밍替現겠合終

Output:

# # ## #  #   #     #   #  #  ##  #  ##  #
# # #  #  #  # #    #   # # # # # #  # # #
### ## #  #  # # ## # # # # # ##  #  # # #
# # #  #  #  # #    # # # # # # # #  # #  
# # ## ## ##  #      # #   #  # # ## ##  #
share|improve this answer
4  
The code-golf info page says "If you use Unicode, byte count should use UTF-8." If I'm not mistaken, that makes your program-length 114 bytes. (The 76 bytes you mention would be for UTF-16 without a BOM.) –  r.e.s. Feb 6 at 14:52
    
@r.e.s.: I changed that, as it makes no sense to require that. My Sclipting interpreter understands UTF-16 just fine, so it’s a valid program encoded as UTF-16. –  Timwi Feb 6 at 16:28
1  
Timwi, case matters –  Tomas Feb 6 at 18:29
3  
@user689 - actually "Hello-World!" with an exclamation point at the end... –  Yimin Rong Feb 6 at 19:57
1  
I suppose "accepted by the community" means "accepted, without community discussion, by a small number of people with the power to do so." –  r.e.s. Feb 7 at 12:07
show 6 more comments

EcmaScript 6, 172 161

'¡I%e!c0ĄJ¥eìo0¸ËefMs0µKcÊIs0´Ê¢1éo'.split(0).map(s=>s.split('').map(c=>{for(i=8,s='';i--;)s+=(c.charCodeAt(0)-33)&(1<<i)?'#':' ';return s;}).join('')).join('\n')

Output:

#         # #        #   #   #           #    #
###   ##  # #  ##    #   #   #  ##  # ## #  ###
#  # #### # # #  #   #   #   # #  # ##   # #  #
#  # #    # # #  #    # # # #  #  # #    # #  #
#  #  ### # #  ##      #   #    ##  #    #  ###

Explanation:

The ASCII text is compacted into a string where each bit represent a pixel:

  • 0 for SPACE
  • 1 for #

An offset of 33 is applied in order to get only printable characters.

share|improve this answer
    
The first fat arrow function's brackets and return statement are not necessary. –  manatwork Feb 7 at 8:10
    
@manatwork I tried to removed it but then it was no longer compiling. Are you sure about that? –  Florent Feb 7 at 8:37
1  
Firefox 27.0: i.stack.imgur.com/VyqnC.png –  manatwork Feb 7 at 8:46
    
@manatwork Thanks! –  Florent Feb 7 at 8:50
add comment

Brainfuck, 372 Byte

(I know. but just for completeness, there has to be brainfuck ^^ It'S not going to get much shorter, as there are little repetitions. First and second line loop already...)

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

Interpreter here: http://koti.mbnet.fi/villes/php/bf.php


# #     # #          #     #          #    # #
# #  #  # #          #     #          #    # #
### # # # #  ##  ### #  #  #  ##   ## #  ### #
# # #   # # #  #     # ### # #  # #   # #  #
# # ### # #  ##       ## ##   ##  #   #  ##  #

Combining @ASKASK's number generator and image with my loops and some additional tuning, we get:

Brainfuck, 343 339 336 334 Bytes

Looks uglier than my original version though.

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

(image see @ASKASK's Answer)

share|improve this answer
add comment

Brainfuck, 362 bytes

Sorry @johannes-h, I saw yours and was inspired to make my own. It uses a combination of faster number generation at the beginning and a simpler picture to generate the result in less bytes. It does not however use loops anywhere else so it is up for optimization.

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

which generates:

pic

share|improve this answer
    
Hm. How much shorter is the number generation? 'cause changing the image looks like cheating to me (at least when directly comparing our solutions - perfectly valid in this contest of course) ^^ BUt I'm going to look into yours later on :) You can take my loop for the first two lines however. It's a lot shorter (was about 10-20 bytes if I remember correctly) –  Johannes H. Feb 7 at 6:29
    
got your version down to 343 Byte, see my answer –  Johannes H. Feb 7 at 7:11
    
and even shorter, replacing more repetitions by loops. 339 now. –  Johannes H. Feb 7 at 7:31
    
I dont have neough reputation to comment on yours but if you look closely at your new version you will find a "><" in there that can be deleted to take away two bytes :) –  ASKASK Feb 8 at 2:41
    
got it, thanks! –  Johannes H. Feb 8 at 11:41
add comment

Postscript, 154 133

<~GasbQ8I>GO#QsOD7:?,pa&5XCgo@jeLPX:a4F9kN1nu1B@8KjD"^]WgY[MA.2VBjpTNo5$Pi%uI9Lr>,9`~>/FlateDecode filter 999 string readstring pop =

i.e.

    <~GasbQ8I>GO#QsOD7:?,pa&5XCgo@jeLPX:a4F9kN1nu1B@8KjD"^]WgY[MA.2VBjpTNo5$Pi%uI
9Lr>,9`~>
/FlateDecode filter 
999 string readstring pop 
=

ASCII-only source, inspiration for ASCII-art was Johannes H.'s answer :-)

# #     # #         #    #          #    # #
# #  #  # #         #    #          #    # #
### # # # #  ##  ## #    #  ##   ## #  ### #
# # #   # # #  #    # ## # #  # #   # #  #
# # ### # #  ##      #  #   ##  #   #  ##  #

(more readable in terminal)

Perl, 102

print$-%44?'':"\n",vec(unpack(u,'<!040`A!:4@`A`*%7918REEM1":T4)75E(#&1"0``'),$-++,1)?'#':' 'for 0..219

Same output as above. I know I lost to both Perl answers above, but I publish it anyway. At least I tried and was moving in the right direction (and hadn't seen shortest answer) :-).

share|improve this answer
add comment

Pure Bash, no external utilities - 133 characters:

c=" #";for x in 0x{5250088045,55520A914D,74556AAA54,535205124D};do while((s=(t=x)^(x/=2)*2,t));do L=${c:s:1}$L;done;echo "$L";L=;done

Uses right and left shift (divide and multiply by 2) and xor to find the one bits.

Font data stolen from Blender/Ilmari Karonen.

Tested in Bash 3.2 and 4.2

By the way, this is only 166 characters:

echo "# #  #  # #        #   #        #   # #
# # # # # #  #     # # #  #   # #  ## #
### #   # # # # ## # # # # # #  # # #  
# #  ## # #  #      # #   #  #  #  ## #"
share|improve this answer
add comment

Python 3, 114

print('\n'.join(bin(x)[2:]for x in[353530052677,366448644429,499649260116,357858349645]).translate({48:32,49:35}))

Output (4-character tall e and W stolen from @Ilmari Karonen):

# #  #  # #        #   #        #   # #
# # # # # #  #     # # #  #   # #  ## #
### #   # # # # ## # # # # # #  # # #  
# #  ## # #  #      # #   #  #  #  ## #

And a shorter one (107):

print('\n'.join(bin(x)[2:]for x in[11993933918769,16391913257513,12021315382193]).translate({48:32,49:35}))

Output:

# # ### #   #   ###   # # ### ##  #   ##   #
### ### #   #   # #   # # # # ### #   # #  #
# # ### ### ### ###   ### ### # # ### ##   #
share|improve this answer
    
It's mostly unreadable. Your World from 2nd output is actually Uorld. –  Silviu Burcea Feb 7 at 13:39
    
@SilviuBurcea: It looks better on an actual terminal emulator. Also, "Human-readable" gives you a bit of wiggle room. I'm sure you can guess what `"HELLO ⊔ORLD!" means. –  Blender Feb 7 at 17:35
    
Use hex constants and shave a few characters off –  Floris Feb 8 at 13:08
    
@Floris: I tried that. The two-character prefix makes them just as long up until around 20 digits. –  Blender Feb 9 at 0:15
add comment

Python 154 Characters, (Char 5X7 in size)

print'\n'.join(map(''.join,zip(*(''.join("# "[int(e)]for e in"{:07b}".format(ord(c))[1:])for c in"€÷÷÷€ÿñêêòÿ€ÿ€ÿñîîñÿûûÿŸáþÁ¿ÁþáŸÿñîîñÿàïÿ€ÿÿñîî€ÿ‚"))))

Output

#   #      # #         #   #   #         #     # #
#   #      # #         #  # #  #         #     # #
#   #  ##  # #  ##      # # # #   ##  ## #   ### #
##### #  # # # #  #     # # # #  #  # #  #  #  # #
#   # #### # # #  # ##  # # # #  #  # #  #  #  # #
#   # #    # # #  #     # # # #  #  # #  #  #  #  
#   #  ### # #  ##       #   #    ##  #  #   ### #
share|improve this answer
add comment

bash -- 175 170

You need to waste quite a few characters in order to produce a pretty output!

base64 -d<<<H4sICKaT9FICAzAxAK2RQQ7AIAgE776CZP7/x1ZjERebcJAL0QybhcV6YdWizAPNaUatQQLFpj6h+c/XA05WF9Wtk9WJcxz4oe6e1YPQa7Wiut2wfjJ16STY30lSnNIlzvdpHhd6MiTOB65NYc+LAgAA|zcat

Output:

#     #                                         #     #                                   ###
#     #  ######  #       #        ####          #  #  #   ####   #####   #       #####    ###
#     #  #       #       #       #    #         #  #  #  #    #  #    #  #       #    #   ###
#######  #####   #       #       #    #  #####  #  #  #  #    #  #    #  #       #    #    #
#     #  #       #       #       #    #         #  #  #  #    #  #####   #       #    #
#     #  #       #       #       #    #         #  #  #  #    #  #   #   #       #    #   ###
#     #  ######  ######  ######   ####           ## ##    ####   #    #  ######  #####    ###
share|improve this answer
add comment

Bash:

(103 89 Bytes)

Code:

base64 -d<<<rohBEmRiqIihFVRS7IitVWRSqIihVVRQru5Aoldi|xxd -b|sed -e's/ //g;s/1/#/g;s/0/ /g'|cut -b'9-55'

Output:

# # ### #   #    #     #   #  #  ##  #   ##   #
# # #   #   #   # #    #   # # # # # #   # #  #
### ##  #   #   # # ## # # # # # ##  #   # #  #
# # #   #   #   # #    # # # # # # # #   # #   
# # ### ### ###  #      # #   #  # # ### ##   #

Smaller, but less readable (Based on http://mckgyver.pbworks.com/f/1240440791/3PixelFont.jpg):

Code:

base64 -d<<<V0nCLsmQdklaqslQV23BTq2Q|xxd -b|sed -e's/ //g;s/1/#/g;s/0/ /g;'|cut -c'9-52'

Output:

 # # ### #  #  ###    #   # ### ##  #  ##  #
 ### ##  #  #  # # ## # # # # # ##  #  # # #
 # # ### ## ## ###     # #  ### # # ## ##  #
share|improve this answer
add comment

Javascript / ES6 (108 bytes)

Copy into console:

[,0xa0a028045,0xeeae2bb5d,0xacaabaa54,0xaeae2ba5d].map(a=>a.toString(2).replace(/./g,b=>' #'[b])).join('\n')

Output:

"
# #     # #       # #        #   # #
### ### # # ###   # # ### ## # ### #
# # ##  # # # # # ### # # #  # # #  
# # ### # # ###   # # ### #  # ### #"

(Needs ECMAScript6 compatible browser ie. Firefox 22+)

Inspired by @maximeeuziere, @p01, @aemkei

share|improve this answer
add comment

Authors: xem, aemkei, p01, jonas

Execute this in the JS console.

JavaScript, cross-browser,133 132 126 117 bytes

for(i=s="";l=[43117609029,64070269789,46349920852,46890400349][i++];)for(j=0,s+="\n";c=l.toString(2)[j++];)s+=" #"[c]

JavaScript, ES6, works on Firefox, 108 bytes

[,0xa0a028045,0xeeae2bb5d,0xacaabaa54,0xaeae2ba5d].map(a=>a.toString(2).replace(/./g,b=>' #'[b])).join('\n')

Result:

>
# #     # #       # #        #   # #
### ### # # ###   # # ### ## # ### #
# # ##  # # # # # ### # # #  # # #  
# # ### # # ###   # # ### #  # ### #
share|improve this answer
    
@p01 made a shorter version (118 bytes) here: twitter.com/p01/status/433230019419471872 –  aemkei Feb 11 at 13:43
add comment

F# - 204 characters

for s in(Seq.map(Seq.unfold(function|0L->None|i->Some(" #".[int(i%2L)],i/2L)))[173948798213L;174770890021L;191304848727L;182715110773L;45277009173L;191279670629L])do printfn"%s"(new string(Seq.toArray s))

Output:

# #     # #        # #         #   # #
# #  #  # #  #     # #  #   ## #   # #
### # # # # # #    # # # # #   #  ## #
# # ### # # # # ## # # # # #   # # # #
# # #   # # # #    ### # # #   # # #  
# #  ## # #  #     # #  #  #   #  ## #
share|improve this answer
add comment

Python + pyfiglet -- 87 characters

from pyfiglet import figlet_format     
print(figlet_format('Hello-World!', font='banner'))

Output

#     #                                   #     #                             ### 
#     # ###### #      #       ####        #  #  #  ####  #####  #      #####  ### 
#     # #      #      #      #    #       #  #  # #    # #    # #      #    # ### 
####### #####  #      #      #    # ##### #  #  # #    # #    # #      #    #  #  
#     # #      #      #      #    #       #  #  # #    # #####  #      #    #     
#     # #      #      #      #    #       #  #  # #    # #   #  #      #    # ### 
#     # ###### ###### ######  ####         ## ##   ####  #    # ###### #####  ### 

To install pyfiglet, run:

$ pip install pyfiglet
share|improve this answer
add comment

Python with pyfiglet: 66 using argv, 69 without

66:

from pyfiglet import*
print(figlet_format(sys.argv[1],font='3x5'))

69:

from pyfiglet import*
print(figlet_format('Hello-World!',font='3x5'))

firs must be called as, for example:

python asciiart.py 'Hello-World!'

second:

python asciiart.py.

Output:

    # #      #   #          # #          #    #  #  
    # # ###  #   #  ###     # # ### ###  #  ###  #  
    ### ##   #   #  # # ### ### # # #    #  # #  #  
    # # ###  ##  ## ###     ### ### #    ## ###     
    # #                     # #                  #  

(Well, it looks kinda crappy with this font. Nevertheless :) )

[edit] removed obsolete dash from the argument.

share|improve this answer
    
Why the extra dash in front of the output? –  Ilmari Karonen Feb 7 at 17:32
    
My mistake, that's the output from the one using argv, where I used a dash before the argument (matter of habit, as I use bash all the time). I'll edit it, thank you. –  Taku Feb 7 at 17:44
add comment

Javascript 137 (134)

Uses the bits of integers to represent sharps an white spaces. Tested with Firefox 27.

137 character

s="";[0xadb73eead9,g=0xa9252aaa94,0xed252aac95,g+1,0xad272aee99].map(n=>{for(;n>0;n/=2)n%2?[s="#"+s,n--]:s=" "+s;s="\n"+s});console.log(s)

# # ## #  #  ###  # # # ### ### #  ##  #
# # #  #  #  # #  # # # # # # # #  # # #
### ## #  #  # #  # # # # # ##  #  # # #
# # #  #  #  # #  # # # # # # # #  # #  
# # ## ## ## ###  ##### ### # # ## ##  #"

134 character (rotated 180°)

s="";[0xadb73eead9,g=0xa9252aaa94,0xed252aac95,g+1,0xad272aee99].map(n=>{s+="\n";for(;n>0;n/=2)n%2?[s+="#",n--]:s+=" "});console.log(s)

"
#  ## ## # # ### #####  ### ## ## ## # #
  # #  # # # # # # # #  # #  #  #  # # #
# # #  #  ## # # # # #  # #  #  # ## ###
# # #  # # # # # # # #  # #  #  #  # # #
#  ##  # ### ### # # #  ###  #  # ## # #"
share|improve this answer
add comment

Python3 (126)

There's an additional space between the chars to make it better readable. So technically it's a 125 character solution.

print(' '.join(['','\n'][i%40==0]+['#',' '][int('72liw1j4glyc34dum02j2a4ipxa8b7vvp65x511',36)//2**i%2==0]for i in range(200)))

Output:

#   #   # #   #     #     # # #     #   #   #   # # #   # # #   #     # #     # 
#   #   #     #     #     #   #     #   #   #   #   #   #   #   #     #   #   # 
# # #   # #   #     #     #   #     #   #   #   #   #   # #     #     #   #   # 
#   #   #     #     #     #   #     #   #   #   #   #   #   #   #     #   #     
#   #   # #   # #   # #   # # #     # # # # #   # # #   #   #   # #   # #     #
share|improve this answer
add comment

Shell, 19 characters:

banner Hello-world.

For this to work, of course you need the banner program. On Debian, you can get it by installing the bsdmainutils package.

This prints a beautifully rendered version of your message, designed to be printed on one of the old continuous-feed printers, so the output of the above text is 322 lines long by 123 columns wide, and you turn the printout on its side to read the message. You could hang the resulting paper on the wall as a banner, hence the name.

http://en.wikipedia.org/wiki/Banner_%28Unix%29

EDIT: Looks like Debian also has the sysvbanner package, which installs a banner program that prints the text horizontally for display on a terminal. However, this only prints the first 10 characters of the message, so it is kind of annoying for this code-golf problem!

share|improve this answer
1  
I believe you meant to write banner hello-world. –  Floris Feb 8 at 13:01
    
@Floris, thanks for the heads-up. Fixed. –  steveha Feb 8 at 23:00
1  
Note that banner appeared on Unix v7 in 1979 and is found on virtually every Unix. –  sch Feb 9 at 16:33
    
@sch, I agree that banner is available for virtually every UNIX. I just put the Debian package as a convenient proof that I wasn't just making something up, for people who didn't know about it. These days I wouldn't expect to find banner installed by default on a UNIX, any more than I would expect to find a continuous-feed printer in a computer lab anymore. But any code golf on making banner text really ought to have the banner program in it somewhere. It's part of our rich cultural history as computer geeks. :-) –  steveha Feb 9 at 21:46
add comment

Smalltalk, 151

although this golf game is already over, for the reference:

i:=((Form extent:115@14)displayString:'Hello world'x:0y:12;asImage).0to:13 do:[:y|i valuesAtY:y from:0to:114 do:[:x :p|({$#.$ }at:p+1)print].Stdout cr]

output:

 ***  ***             ***       ***                                                         ***           **       
  *    *                *         *                                                           *            *       
  *    *                *         *                                                           *            *       
  *    *     ***        *         *        ***              ***   ***    ***     *** ***      *        *** *       
  ******    *   *       *         *       *   *              *     *    *   *      **   *     *       *   **       
  *    *   *     *      *         *      *     *             *  *  *   *     *     *          *      *     *       
  *    *   *******      *         *      *     *              * * *    *     *     *          *      *     *       
  *    *   *            *         *      *     *              * * *    *     *     *          *      *     *       
  *    *    *    *      *         *       *   *               ** **     *   *      *          *       *   **       
 ***  ***    ****    *******   *******     ***                *   *      ***     ******    *******     *** **      
share|improve this answer
    
You have to only use ' '(spaces) and '#' characters(also newline characters). –  Mukul Kumar Mar 7 at 3:32
    
my mistake; the output was from a previous run; the code is correct "{$#.$ }at:p+1". –  blabla999 Mar 17 at 16:26
add comment

ImageMagick + sed, 71 bytes

I don't see any other ImageMagick entries, so here's my late stake in the ground:

convert +antialias label:Hello-World! xpm:-|sed '8,+9y/ /#/;s/[^#]/ /g'

I think the sed portion can probably be golfed some more.

Output:


  #    #          #  #            ##   #    #            #      #  #     
  #    #          #  #             #   ##  ##            #      #  #     
  #    #          #  #             #  ###  #             #      #  #     
  #    #   ####   #  #  ####       #  # #  #  ####   # # #  ### #  #     
  ######  #    #  #  # ##  ##      #  # #  # ##  ##  ##  # ##  ##  #     
  #    #  ######  #  # #    # ###   # #  # # #    #  #   # #    #  #     
  #    #  #       #  # #    #       ##   ##  #    #  #   # #    #  #     
  #    #  ##  ##  #  # ##  ##       ##   ##  ##  ##  #   # ##  ##        
  #    #   ####   #  #  ####        ##   ##   ####   #   #  ### #  #     

share|improve this answer
add comment

"cURL", 16 characters:

program: (computer science) a sequence of instructions that a computer can interpret and execute;

curl floris.us/h

Produces:

#   #      #  #           #   #          #     #  #
#   #  ##  #  #   ##      #   #  ##   ## #   ###  #
##### #### #  #  #  # ### # # # #  # #   #  #  #  #
#   # #    #  #  #  #     # # # #  # #   #  #  #
#   #  ##   #  #  ##       # #   ##  #    #  ###  #

I guess if I had a cooler domain, it would be shorter...

share|improve this answer
    
Personally, I would consider this cheating. –  The Guy with The Hat Feb 7 at 22:40
    
@RyanCarlson yes, but it's short... –  Floris Feb 8 at 0:53
3  
How is this different from putting an arbitrarily large program into a script called x, setting execute permission on x, setting the PATH to include the current directory, and then saying you have a one-character solution (just type x!). I think this whole class of solution is cheating. –  steveha Feb 8 at 4:31
1  
@mojo, figlet is at least a common program, to which people have access. Some people already have it installed, and others can install it. I don't think it's "cheating" to use such a program. But I do think this problem would be better if it required answers to be written in a programming language and not run any external programs or include any library modules. (That would of course invalidate my own answer, which depends on the user having the banner program installed.) –  steveha Feb 8 at 4:37
1  
@Floris You can transform your answer in a shell one: curl floris.us/h ;-) –  Ionică Bizău Feb 9 at 14:26
show 5 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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