# Hello world!!! Fibonacci distribution

1. Your program should output exactly: Hello world!!! with or without linefeed after.
2. Your program should take no input.
3. Sourcecode character distribution must be correct according to:
• The number of numeric characters (0-9) must be exactly one fibonacci sequence number.
• The number of other non-numeric characters !(0-9) in the sourcecode must be exactly the fibonacci sequence number before the above fibonacci sequence number.

Four examples of valid character distribution in sourcecode:

• 13 numeric, 8 non-numeric characters.
• 34 numeric, 21 non-numeric characters.
• 55 numeric, 34 non-numeric characters.
• 89 numeric, 55 non-numeric characters.

This is code-golf, shortest code in bytes wins! Good luck!

Edit: As this question has constraints on the sourcecode size in combination with being code-golf the accepted answer (if more than one share the equal winning character length) will be the answer with most votes (and least character-count): 2014-03-01.

• Thus, all solutions have a character count which is a fibonacci number. – Howard Jan 18 '14 at 9:02
• Here is a program to validate answers (paste the code into the input box.) – Justin Jan 18 '14 at 9:19
• Is it even possible to do this in less than 55 characters? The required output has 14 chars, and I can't think of a language that can use numbers to output chars without using at least one character per char. – Justin Jan 18 '14 at 9:24
• @Plarsen definitely not OK – John Dvorak Jan 18 '14 at 9:37
• Okay, I will not change the rules then :) – Plarsen Jan 18 '14 at 9:38

## Windows Command Prompt - 34, 8, 5 chars, (2 below)

*These ones may or may not be breaking rule 2, but here it is anyway

%~099


Name the file:

&start call echo Hello world!!!&exit -b .cmd


Now lets corrupt the file-system a little - 2 chars (or less if you want)

A1


Name the file (using your preferred unorthodox method):

"&start call echo Hello world!!!&exit&.cmd


How does this work:

Since cmd scripts are invoked with 'cmd.exe /C "%1" %*' the executed command will be:

cmd.exe /C "c:\PATH_TO_THE_SCRIPT\"&start call echo Hello world!!!&exit&.cmd"


which will in the following order:

• Fail to execute "c:\PATH_TO_THE_SCRIPT\"
• Open a new shell printing Hello world!\n
• Exit the original shell
• Wow! I think we had got a winner if the rules wasn't saying no input. +1 anyway for the outside-of-box thinking. – Plarsen Jan 18 '14 at 12:37
• Code golf with Windows CMD... +1. Also, it is arguable that "no input" could have meant "no reading STDIN" :P – Camilo Martin Jan 19 '14 at 5:06
• That's an interesting trick for other code golfs too… write the real code in the file name and use something like eval $0 to execute it <rolleyes> – Tobia Jan 19 '14 at 18:36 • That's impossible!! 5 chars? Really interesting approach – Plarsen Jan 20 '14 at 11:46 • In fact, I've just posted a 2 char solution below. – Tobia Jan 20 '14 at 13:32 # MySQL, 34 x'48656C6C6F20776F726C642121'||'!'  This is a MySQL expression that evaluates to Hello world!!!, assuming the sql_mode setting includes PIPES_AS_CONCAT. It contains exactly 21 digits and 13 non-digits. Whether this qualifies as a valid entry, I leave it to the jury. Example mysql> select x'48656C6C6F20776F726C642121'||'!'; +------------------------------------+ | x'48656C6C6F20776F726C642121'||'!' | +------------------------------------+ | Hello world!!! | +------------------------------------+ 1 row in set (0.00 sec)  • What the... CMD and SQL winning code golf?? – Camilo Martin Jan 19 '14 at 5:08 • The select and ; are arguably part of the statement, but still a clever solution. – primo Jan 21 '14 at 5:57 • @primo they are, that's why I'm unsure whether this qualifies. But I thought I'd post it for hilarity ;-) – Tobia Jan 21 '14 at 9:35 # C64 BASIC, 55 For fun and nostalgia! ### GolfScript, 55 characters [72 101 108 108 111 32 119 111 114 108 100 33 {.}2*]''+  Didn't find a way to have a 34 characters solution, thus I created this one. # Befunge 98 - 55 a"!!!dlrow olleH"ek,@1235813213455891442333776109871597  Decided to do it with a newline, since it doesn't cost anything. The numbers are the concatenated values of the Fibonacci sequence. ## Python 34-55 print "Hello world%s"%("!"*int(3.141592653589793238462643383279502884197169399375105820))  Yes. I waste them digits. What are you gonna do about it? • Who knew pi~3 would be so useful! – Kyle Kanos Jan 18 '14 at 15:52 • The question says 21 non-numeric plus 34 numeric, your answer is 34 non-numeric plus 21 numeric. – user12205 Jan 18 '14 at 15:55 • the "hello world" should be "Hello world"; that is capitalize the h. – Justin Jan 18 '14 at 18:04 # C (89 characters) main() { int i[0000000000000004]={1819043144,1870078063,560229490,2566922529}; puts(i); }  While the above is valid, unfortunately, my efforts to compact it with the following program doesn't meet the spec. I feel like it's worth looking at and maybe someone else can shorten it a bit though (64 characters, 37 numerals, 27 non-numerals). To compile it, you'll have to use clang and with -fms-extensions. main(){puts((__int128[]){671944380693508453879479574226248i8});}  • Compound literals, is the name for what you're looking for. I'm trying to use them to get this down to 21 characters now! – charmlessCoin Jan 20 '14 at 1:51 • The lowest non-numeric count I can reach is 26, by making i global (omitting int). Using long can save commas, but costs more. 21 is very far. – ugoren Jan 20 '14 at 13:20 • Yeah, it's a lot of wasted space. Using that little trick, I can get it to main(){puts((int[]){1819043144,1870078063,560229490,8481});} but that's still 60 characters. If I could eliminate just a few more... Edit: wow, so globals don't have to have a declaration? Who knew? – vmrob Jan 20 '14 at 19:55 • @vmrob, globals have to have a declaration. But the type defaults to int, so a; is equivalent to int a;. – ugoren Jan 21 '14 at 20:40 • @ugoren I knew that they had to have a declaration, I just didn't realize it defaulted to int! – vmrob Jan 21 '14 at 20:42 # Windows PowerShell (probably also Bash), 55 curl -L bit.ly/1b9q8ve?1=123581321345589144233377610987  You didn't say anything about network access, so here's a dirty solution. I've got a bit.ly URL with few enough letters on the second try. Unfortunately, It's still 21 non-digits, needing 34 digits to be used or wasted. • You know you can edit the bit.ly links right? – Timtech Jan 18 '14 at 15:03 • What do you mean, edit? Also, I wouldn't get this under 13 letters in any case. – John Dvorak Jan 18 '14 at 15:05 • You can hit the pencil next to "Copy" and edit the link. If you do, all the old versions will still work. – Timtech Jan 18 '14 at 22:18 • Shortened to 34! curl 37.187.42.18/?hw=112358132134 – Dom Hastings Jan 19 '14 at 8:55 # sh, 55 echo Hello world!!! #1234567890123456789012345678901234  # Korn Shell, 21 echo$0
#123456789012


The script must be called "Hello world!!!" :)

# Bash, 2 chars

Very well, in the unlikely case Robert's answer is not disqualified, here's mine:

\$0


Name the file echo Hello world!!! and execute with sh.

## Python

print'092020090920200948656c6c6f20776f726c642121212009200909200920'.decode('hex').strip()


digits : 55 non digits: 34

• Note there are no comments in the solution. only code. – Elisha Jan 21 '14 at 21:48

# PHP (55 bytes)

This program uses binary (wow, it's the third time I reuse the same trick). 21 non-numeric characters, 34 numeric characters. No letters, because letters are boring.

## xxd

0000000: 3c3f 3d7e b79a 9393 90df 8890 8d93 9bde  <?=~............
0000010: dede f53b 2331 3233 3435 3637 3839 3031  ...;#12345678901
0000020: 3233 3435 3637 3839 3031 3233 3435 3637  2345678901234567
0000030: 3839 3031 3233 34                        8901234

• @JanDvorak: I'm almost sure I read "before or after". Oh well, let me fix it then. – Konrad Borowski Jan 18 '14 at 10:38

# Mathematica 55

"Hello World!!!"(34+21!)/000000000051090942171709440034


Output

Hello World!!!


# Sclipting (34 characters)

丟0000000000긒괡뉆롲닷댠닶롬뉔밈0000000000併0反


Unfortunately Sclipting doesn’t use any ASCII characters at all, so I have to pad the program with 21 useless number characters :(

## Forth or Ruby, 55

(34 numeric + 21 non-numeric)

## Forth

." Hello world!!!" \ 3141592653589793238462643383279502


## Ruby

puts"Hello world!!!"#3141592653589793238462643383279502


# J (55 characters)

(34 numeric + 21 non-numeric)

(72 101 108 108 111 32 119 111 114 108 100{a.), 3#33{a.


# C#, 233 Bytes

233 Characters
144 Numeric
89 Non-Numeric Characters

/*I suck at CodeGolf!!!*/new List<int>{0072,00101,000108,000108,000111,0000032,00000119,00000111,0000000000114,0000000000108,00000000000000100,00000000000000033,00000000000000033,00000000000000033}.ForEach(c=>Console.Write((char)c));


Outputs:

Hello world!!!


# Japt, 55 bytes

"aaaaaaa1234567890123456789012345678901234"HÁM WŽld!!!


Try it online!

It is basically a simple hello world with some rubbish at the beginning that is ignored but makes the code satisfy the conditions.

## Windows Batch

echo Hello World!!!::0123456789012345678901234567890123

• Wow. This is so much different from my sh solution. – user12205 Jan 18 '14 at 16:08

http://esolangs.org/wiki/Hello%2B%2B

h000000000051090942171709440034

the h prints hello and the rest is just numbers

• This is not distributed according to Fibonacci, also, the output is not exactly Hello world!!!` – Timtech Jan 23 '14 at 12:38