# Obfuscated Hello World

Create the shortest possible obfuscated program that displays the text "Hello World".

In order to be considered an obfuscated program, it must meet at least two of the following requirements:

• Does not contain the characters: h, l, w and d in any case
• Does not contain the characters: e, o, r, 0, and 1 in any case
• Does not contain the characters: 2 or 7

Input:
none

Output:
Hello World

• I guess import in python is not permitted. – Alexandru Feb 1 '11 at 0:07
• Does these rules apply to language keywords as well? – hallvabo Feb 1 '11 at 13:04
• are those case insensitive restrictions? – oenone Aug 4 '11 at 14:22
• Could someone explain why 2 and 7 are not allowed? I'm just curious as I don't see why those were chosen in particular. – Thomas Eding Aug 5 '11 at 23:01
• @trinithis, and others, ASCII character 72 is "H" which is why I chose those two – Kevin Brown Sep 18 '11 at 23:18

# Python: 66 characters

op=""
for i in "Tqxx{,c{~xp":
op=op+chr(ord(i)-(4*3))
print op

void main(){
int a[100]={4,1,8,8,11,-68,19,11,14,8,0,0,0};
for(;a[13]<a[4];a[13]++)
{
printf("%c",100+a[a[13]]);
}

}


Funny,isn't it?

## XeTeX

Compile with xetex, output is in generated PDF. Of course, this still breaks some of the rules (still uses forbidden digits) and could be obfuscated and compacted a lot more, but I am tired and have to go to bed. Well, maybe you like it anyway :-)

\let~\def
\toksdef\|0
\let\ea\expandafter
~\>{\uppercase{\|\ea{\the\|.}}}
~\.{\uccode.\numexpr32+}
~\u#1{\|{}\ea\v\number#1 \^^J{\iffalse}..\fi\relax}
~\v1#1#2#3#4{\.#1#2\>\.#3#4\>\ea\v\number}
\u{㛵䔌䘣䘾䔄}\the\|
\bye


## Brainfuck, 94 Characters

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


Obvious, being BF it breaks none of the rules.

If I lowercase the output it's only 86, but I don't think that's allowed.

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


The first one is a balanced nested loop generator, the second is a slipping (or sliding) loop generator

NB: The newlines in the code are for this message, they should be removed for running or counting.

# PHP

This is a very cheap trick (30 bytes):

<?=cONSTAnTINO_^'+*"?;a9;;"+'


Not much to see here.

Rules broken: none (the O.P. said o, not O)

Going really cheap on this one (25 bytes):

Create a file called cONSTAnTINO_ and run:

<?=__FILE__^'+*"?;a9;;"+'


There's nothing saying about file names being forbidden.

But if we want to go REALLY dirty, just do (10 bytes):

<?=__DIR__


And run a file from a directory called Hello World.

Enough of being cheap!

Here is another attempt (97 bytes):

4?cH(aS(mI(a$,a,a/a))-a/a);:a=a-a/a:ifagO4  # Swift 2.0, 243 bytes Works for Swift 2.0 on Xcode 7 and above. var s = " ".join(["Gdkkn", "Vnqkc"].map({ var usv = String.UnicodeScalarView() for a in$0.unicodeScalars.map({
UnicodeScalar(($0.value + 4 - 3)) }) { usv.append(a) } return String(usv) })); print(s, appendNewline: false)  • Welcome to PPCG, this challenge type is called code-golf, and for that we include the length of our program in bytes/characters in the title. Also, as a side challenge, you should try and get your program as short as possible by removing unnecessary whitespace, newlines etc. – Beta Decay Jul 6 '15 at 13:13 # C#, 143 bytes First i put in an array the decimal values for each letter in text Hello World. Then in each world i call (char)decimalValue Example (char)111  returns o in C#. namespace N{class P{static void Main(){int[] i={13*8,69,36*3,36*3,111,119,111,114,19*4,68};foreach(int v in i)System.Console.Write((char)v);}}}  • You should say a little something about how this works in your answer. – Justin Feb 20 '14 at 19:55 • Breaks the rules. Have a look at TimWi's solution. That's how it's done. – RobIII Feb 21 '14 at 1:15 # Detour, 18 bytes <u @'Ifmmp!Xpsme'  Basically the same as @gnibbler's answer, only breaks rule 2. Try it online! The 19-byte version breaks none of the rules: # Detour, 19 bytes <<u @'Jgnnq"Yqtnf'  Try it online! # JavaScript, 7770 69 characters This satisfies conditions number 2 and 3. "H"+([]+![])[4]+"ll"+([]+{})[+!![]]+" W"+([]+{})[+!![]]+([]+!![])[+!![]]+"ld"  a=!![];b=([]+{});c=b[+a];"H"+([]+![])[4]+"ll"+c+" W"+c+([]+a)[+a]+"ld"  a=!![];b=([]+{});c=b[+a];H${([]+![])[4]}ll${c} W${c}${([]+a)[+a]}ld  Please help me shorten this up. # Molecule, 7 chars (18 bytes) "ৣ҆͢๡Ԫł"C  Molecule uses Chocolate Compressor to compress strings. So I just decompress it. # Vim, 31 keystrokes ia<C-v><C-v>92<esc>22<C-a>SU<C-o>@"yyb Jb<C-v>x65yq<esc>g?g  This was really fun! I'll write an explanation a little bit later. # tcl, 104 \u6cmap x {G d k k n \U1F V n q k c} {scan$x %c n;incr n;puts -n\u6Fn\u65w\u6cin\u65 [f\U6Frmat %c $n]}  Almost meets 3 requirements. Unfortunately I am not successful when I try to use directly the char by key pressing Alt+Num 31, representable as: Dec U-Hex Oct \31 \U1F \037  which happens to have forbidden chars in all number bases! Available to run on: http://rextester.com/live/GQBHU26987 ## Ruby, 51 bytes Chars not used: hlwd27 puts "Ifmmp!Xpsme".chars.map{|i|(i.ord-1).chr}.join  Perl, 33 bytes print 'Ifmmp Xpsme'=~y/G-t/F-s/r  Breaks rule 2. Alternatively: perl -E "say 'Ifmmp Xpsme'=~y/G-t/F-s/r"  I think this counts as one byte shorter... ## AWK, 164 bytes #!/bin/awk -f BEGIN{n++ system("awk 'printf(\"%c",$n)}'<<<\""69+3"\n"98+3"\n"36*3"\n"36*3"\n"36*3+3"\n"35-3"\n"84+3"\n"36*3+3"\n"36*3+6"\n"36*3"\n"94+6"\n"6+4"\"")}


Usage: Place the code in a file, FILE, and set the 'executable-bit' to true. Sending a single string input will print Hello World. Multi-line input results in the string being printed once for each line.

Example:

File <<< "42"


Since a program was requested, I assume the code is running on some UNIX-like environment with the awk executable available at /bin/awk. I further assume that /bin is in your path.

Not sure if this really counts as just an AWK program, since it is using the system command, but at least the system call is calling AWK. :)

I do violate the second rule, simply because I couldn't come up with a way around using the printf command. :(

Excel 138

(Not actually a language and not really obfuscated, but why not)

=CONCAT(CHAR(69+3),CHAR(98+3),CHAR(99+9),CHAR(99+9),CHAR(45+66),CHAR(35-3),CHAR(33+86),CHAR(43+68),CHAR(48+66),CHAR(44+64),CHAR(45+55))


Violates rule #2 tho, as it contains 'o' and 'r'

• it also contains H (rule #1). – Andrey Jan 18 '17 at 9:27

## Mathematica 144 Bytes

StringJoin@Insert[ToUpperCase@StringPart[#,1]<>StringPart[#,5-3;;]&/@IntegerString[{349644888483444,656639565449499}/(498331*8*3+3),36]," ",5-3]


This is a pain in Mathematica because so few functions adhere to rules 2 & 3. This answer adheres to rules 1 & 2 and also takes care to do the Capitalization. I couldn't even use the built in Capitalize function. The basic idea is to find the base 10 representation of the string assuming it's in base 36.

as can be seen by running

Select[Names["System*"],StringFreeQ[#,{"h","l","w","d"},IgnoreCase->True]&&StringFreeQ[#,{"e","o","r","0","1"},IgnoreCase->True]&&UpperCaseQ[StringPart[#,1]]&]

which yields a handful of built in symbols, only some of which are functions, and none of which are helpful with string manipulation.

{Abs,Annuity,Ask,Assuming,Axis,Back,C,Cap,Csc,Cubics,Cup,CupCap,Cyan,Fit,Gamma,I,If,Im,In,Infinity,Infix,Inpaint,Input,K,Magnify,Map,MapAt,Masking,Max,Min,MinMax,Minus,Missing,MissingQ,N,NSum,Pi,Pick,Pink,Put,QGamma,Quantity,QuantityQ,QuantityUnit,Quit,Scan,Sign,Sin,Sinc,Skip,Spacings,Span,Stack,Stub,SubMinus,Sum,Syntax,SyntaxQ,Tab,TabSpacings,Tan,Ticks,Timing,Tiny,Up,Using}


A single function solution that came to mind was:

Transliterate["הֶללֳ וֳרלד"]


which translates from Hebrew characters, but as you can see it it violates rules 2 and 3.

# Jelly, 7 bytes (non-competing)

“½,⁾ẇṭ»


Try it online!

<?for(;$a='Gdkkn vnqkc'[$p++];print++$a);  Complies with rules 1 and 3. Brainf*** (106 characters) ++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.  • Welcome to PPCG! – FlipTack Nov 11 '17 at 19:53 • BTW, there's an open-ended +500 bounty for anyone beating the current Brainfuck "Hello, World!" record (78 bytes -- with a comma and an exclamation point). – Arnauld Nov 11 '17 at 20:01 # Data URI 28 bytes data:;base64,SGVsbG8gV29ybGQK Copy and paste into the browser url bar # Befunge-93, 24 bytes 9"mu{x)xuunQ">9#,-#$:_@


Try it online!

Violates no rules. Simply pushes the text shifted by 9 and subtracts 9 from each character before printing.

# Japt, 9 bytes

HÁM WŽld


Try it online!

The built-in shoco compressor just did the perfect job to remove eor.

Alternatively, slightly less obvious:

## 16 bytes

"Ifmmp!Xpsme"c_É


Try it online!

c maps over the charcodes, and _É is a decrement function. É is a shorthand for -1.

# PI based bash program: 168 char

#!/bin/bash

pi=$(bc -l <<<'scale=4000;4*a(1)') pi=${pi//[$'\n\\']} for v in aF Fb e3d F78 67a 172 496 12A 867 52D E3d 667 eAc;do printf -vv %b \${pi:16#v:3} o+=v done echo o  Do render: Hello, World!  Nota: in order to prevent long time compute, you could use pre-computed 4k pi value: #!/bin/bash pi=(gunzip < <(base64 -d <<-eof H4sIAHM1DVwCAyXXB3IDMQwDwB9lJFH1/x/L4pxJcWwVEgRAXv312dcbe9W677wadecee1bdGuetNu6d/Z2+X71XZ/W27mjvzDenjdXO7Xu2Pe4e7b7nz20171g1R++n7fPu6PO2u1evcW3Ze5723DR3e2vlxFH92LLebLePO2+3d+b62ds4rVu+nNfWWm/bOMab9635qtXt eUukXWBr7/WqLMk5/hVL1bn73Op7jdOH09rrMx9ZLQlxCHn3NtessbOlV73a7YzdxrS4j1NnzHVPE3/b1ddy4Zl+LYD4lvl4Y01nn74KiO70xmsOat2Jbfm2Y7QpSnfIbu63+lOF3qExs+hIuPY6663Xnz1vdNH1k0zF59UrUPR+ndZO4KjzBKAsa59a/V7bh4Dv60Mh7bwl hieX8W4Jzc+YKgeCWarTxOPjueutMaZ0wXS8q4BfZF6fIwXRnH72EMPZbgll4NDzB5yzpc6ttbWV8sB57Fq7XbtFdTpiHH/v20GqtovOPTiyMaK9JmBplKC8pcLrLkvaaucllR1M/dSaqaSEex+S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ozmOXdkkFPKnWP+AVkFcIuiDwAA eof )) for v in af fB e3D F78 67a 172 496 12A 867 {52,E3}d 667 EaC;do printf -vv %b \${pi:16#$v:3}
o+=$v done echo$o


Will render (same, but quicker):

Hello, World!


# Z80Golf, 21 bytes

Contains unprintable bytes, so here's xxd (breaks rule 1):

00000000: 0063 6b71 6e56 1f6e 6b6b 6447 2e0b 7e3c  .ckqnV.nkkdG..~<
00000010: ff2d 20fa 76                             .- .v


Try it online!

    nop
ld h, e ; 'Hello World' backwards if you add 1 to each byte
ld l, e ; execution falls through
ld (hl), c
ld l, (hl)
ld d, (hl)
rra
ld l, (hl)
ld l, e
ld l, e
ld h, h
ld b, a
ld l, loop - 3
loop:
ld a, (hl)
inc a
rst $38 dec l jr nz, loop halt  # DOS .com executable: 31 bytes BE 13 01 AC B4 02 34 FF 88 C2 75 03 80 C4 4A CD 21 EB F0 B7 9A 93 93 90 DF A8 90 8D 93 9B FF  Stores the string byte-inverted, outputs using DOS syscalls. Contains none of the banned characters. source: .code16 .org 0x100 start: movw$str, %si
l:
lodsb
mov $0x02, %ah xor$0xff, %al
mov %al, %dl
jnz 1f
add $0x4a, %ah 1: int$0x21
jmp l
str:
.ascii "\xb7\x9a\x93\x93\x90\xdf\xa8\x90\x8d\x93\x9b\xff"


# Runic Enchantments, 39 bytes

\>''
\+kw+kwb8qn;' 83*´34 f-;@


Try it online!

As seen in Notepad++ to better distinguish the non-printing bytes:

Violates only rule 1. I had fun computing the first line (a sequence of raw byte values). Alternatively I could have violated rule 2, but I felt that doing so was less obfuscated. There's four different methods used in the 39 byte solution for generating integer values, making it hard to figure out what's going on (compared to just some mathematical operators in the 17 byte solution).

39 byte solution must occupy two lines.