# 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

Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.

/* Configuration */

var QUESTION_ID = 307; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 48934; // This should be the user ID of the challenge author.

/* App */

return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

}

jQuery.ajax({
method: "get",
dataType: "jsonp",
crossDomain: true,
success: function (data) {
data.items.forEach(function(a) {
});
comment_page = 1;
}
});
}

jQuery.ajax({
method: "get",
dataType: "jsonp",
crossDomain: true,
success: function (data) {
data.items.forEach(function(c) {
if (c.owner.user_id === OVERRIDE_USER)
});
else process();
}
});
}

var SCORE_REG = /<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

function getAuthorName(a) {
return a.owner.display_name;
}

function process() {
var valid = [];

var body = a.body;
if(OVERRIDE_REG.test(c.body))
body = '<h1>' + c.body.replace(OVERRIDE_REG, '') + '</h1>';
});

var match = body.match(SCORE_REG);
if (match)
valid.push({
user: getAuthorName(a),
size: +match[2],
language: match[1],
});

});

valid.sort(function (a, b) {
var aB = a.size,
bB = b.size;
return aB - bB
});

var languages = {};
var place = 1;
var lastSize = null;
var lastPlace = 1;
valid.forEach(function (a) {
if (a.size != lastSize)
lastPlace = place;
lastSize = a.size;
++place;

.replace("{{NAME}}", a.user)
.replace("{{LANGUAGE}}", a.language)
.replace("{{SIZE}}", a.size)

var lang = a.language;
if (/<a/.test(lang)) lang = jQuery(lang).text();

languages[lang] = languages[lang] || {lang: a.language, user: a.user, size: a.size, link: a.link};
});

var langs = [];
for (var lang in languages)
if (languages.hasOwnProperty(lang))
langs.push(languages[lang]);

langs.sort(function (a, b) {
if (a.lang > b.lang) return 1;
if (a.lang < b.lang) return -1;
return 0;
});

for (var i = 0; i < langs.length; ++i)
{
var language = jQuery("#language-template").html();
var lang = langs[i];
language = language.replace("{{LANGUAGE}}", lang.lang)
.replace("{{NAME}}", lang.user)
.replace("{{SIZE}}", lang.size)
language = jQuery(language);
jQuery("#languages").append(language);
}

}
body { text-align: left !important}

width: 290px;
float: left;
}

#language-list {
width: 290px;
float: left;
}

font-weight: bold;
}

table td {
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr>

</tbody>
</table>
</div>
<div id="language-list">
<h2>Winners by Language</h2>
<table class="language-list">
<tr><td>Language</td><td>User</td><td>Score</td></tr>
<tbody id="languages">

</tbody>
</table>
</div>
<table style="display: none">
</tbody>
</table>
<table style="display: none">
<tbody id="language-template">
</tbody>
</table>

• I guess import in python is not permitted. Feb 1, 2011 at 0:07
• Does these rules apply to language keywords as well? Feb 1, 2011 at 13:04
• are those case insensitive restrictions? Aug 4, 2011 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. Aug 5, 2011 at 23:01
• @trinithis, and others, ASCII character 72 is "H" which is why I chose those two Sep 18, 2011 at 23:18

# Perl

Since the obvious answer uses shifting of some kind, I feel obligated to post something using Acme::EyeDrops, however with the extra power I thought mine ought to be a little more fun.

                            ''=~('('."\?".
'{'.(''|'%').('['^'-'
).(''|'!').  ("\"|       ','
).'"'.('['^'.').   (((           '['
))^'(').(''|('%')).(                  '{'
^'[').('{'^'/').(''|')')                  .+(
''|'-').(''|'%').':'.':'.(                   ''
^'(').(''|')').('{'^')').(                      ''
|((  '%'))).('['^'(').'\\'.'"'                       .+(
'['   ^'.').('['^'(').("\"|                           ','
).(    ''|'%').(''|"\%").(                             '['
^((      '+'))).'\\'.'"'.';'.                              (((
(((        '\\')))))).('$'). '|' .(( '+')).'+'.(';'). ((( ((( '\\')))) ) ).+ '$'            .'\\'.                                          '"'
.((               '=')    ). "'".                                "'"
.((                (';'))).       '\\'                           .((
'@'                   )).(''|                                     '#'
).+                        '='                                     .+(
''                          |+    "\-").(                         ''
|((                            '!'))).("\["^                       '+'
).+                              '\\'.'{'."\[".                    (((
(((                              '\\'))))))."$". '_' .(( ',')).'\\'.''.(''| '*' ).+ ','.('^'^(''|('+'))).( '^' ^+( ''|'.')).'+'.('^'^('' |(( '+' )))).'*'.'\\'.('').( '' |(( '*'))).'+'.'+'.']'. ((( ((( '\\'))))))."\}".( '[' ^(( '('))).('['^'+') .+( '' |',').(''|')') .+( '[' ^'/').('/'). '/' .(( ',')).'\\'. '"' .+( ''^'('). ((( '' ))|'%') .+( '' |','). ((( '' ))|',' ).( '' |'/') .+( '{' ^'[' ).( '{' ^(( ',' ))) .( ( '' )|+ (( '/' ))) .+( '[' ^(( ')'))).(('')| ',').(''|'') .(( '\\')).'"'. ';' . ('['^',').(('')| '(' ). (''|')').(''|',').( '' |'%').'('.('^'^(''|'/')) .(( ')')).'\\'.'{'.(''|'-').('['^ '"' ).(( ( '\\'))).''.(''|('*')). ';' .+( ( ( ''))|'-').('['^('"')). '\\' .+ '@'.('['^'(').'='.("\"| '-'). (''|'!' ).('['^'+').'\\'.'{'. "'".( '{'^"\["). (( "'")).'\\'.'}'.('(').( '^'^( ''|'.')).'.'.'.'.('^'^(''|'+')).('^'^(''| '.')) .')'.';'.(''|'&').(''|'/').('['^')').'('.'\\' .'@' .(''|'#').')'.'\\'.'{'.'\\'."$".(   '['^"$$"). '[' .'\\'.''.'_'.'-'.'>'.'['.('^'^('' |',') ).+ ']' .']'.'='.'\\'.''.'_'.'-'.'>'."\[".( '^'^ ((( '' ))|'.')).']'.(''|')').(''|('&')). ((( ((( ((( '\\'))))))))).''.'_'.'-'.'>'.'['. +( '^' ^+( ''|',')).']'.'<'.'='.('^'^(''| ( ( '+' ))) ).('^'^(''|'.')).';'.'\\'.''.'_'. ( ( '-' )). '>'.'['.('^'^(''|'/')).']'."\>". ( ((( ((( '\\') )))))).''.'_'.'-'.'>' .(( '[' )).('^'^(''|(','))). ']' .(( '?')).'\\'.''.(''| '*' ).(( '+')).'+'.':'.'\\'. '' .('_'). '-'.'>'.'['.('^'^ ((( ''))|',' )).']'.'-'."\-". ((( '\\'))).+ '}'.('['^'+').( '['^ "$$").(                        ''|')').("\"|              (   '.')
).('['^                        '/').'\\'."\"".                   (((
'\\'))                        ).'\\'.('['^')'    )             .((
'\\')).                      '@'.('['^"\(").   ((              (((
'\\'))                       ))).'"'.';'.(   '['        ^    '.'
).('['                        ^'(').(''|    ((        (     ','
)))).                         (''|'%')     .              (((
'')                         )|'%').(                    '['
^((                          '+')))                    .((
'('                         )).                      (((
'^'                                          )   )^(
''                                         |  '/'
)).                                       (''
|((                                    '%'
)))                              .+(
'^'                        ^+(
''                |((
'+')))).(')').

';'.(''|',').
(''|'!').('['^    '('
).('['^'/').(('{')^        '['
).(''|')').("\"|    (          '&'
)).'\\'.'$'.(''|"\*"). '=' .'='.'\\'.'@'.(''|"\#"). ((( '\\'))).'}'.('['^'+').('['^ ( ')' )).(''|')').(''|'.').('['^ ( '/' )).'\\'.'"'.'\\'.'\\'.('' |+ '.' ).'\\'.'"'.('!'^'+').'"'.'}'. ')' );($:)='.'^'~';$~='@'|'(';$^=')'^                           '['
;$/=''|'.';$,='('^'}';$\="\"| '!' ;$:=')'^'}';$~='*'|'';$^=('+')^                             '_'
;($/) ='&'|'@';$,='['&'~';$\ =(( "\,"))^ '|';$:  ='.'^'~'; $~ =(( '@'))| "\(";$^=')'^                                    '['
;($/)= ''| '.';$,                                    =((
'(')        )^+         '}';$\ =(( '') )| "\!"; ( ($:)
)=')'         ^+        (   (         (                   (        '}'
))));          (           (          (                            $~) ))=( ( ( ( ( '*' )))) ) | (( ( '' ))) ;$^=         (                       '+'
)^+                       ((    ((  ((     '_'                     )))
)))                                          ;($/) =(( '&' ) ) |'@';$,=
'['                                                                &((
'~'                                      ))   ;                  $\= ',' ^"\|";$:                  =((
'.'                               ))^"\~"; $~= '@' |(( '('));$^=')'^       (         '['
);(                          $/)=''|"\.";$,=    (           '('
)^+                         '}';$\=''|'!';$:                =((
')'                        ))^'}';$~='*'|'' ;$^
=((                       '+'))^'_';$/='&' |(( '@' ));$,   =('[')&               '~'
;$\ =','^ '|' ;$:                              =(      ((      '.'
)))                                   ^+       '~'
;$~ =( '@' )|+ '(' ;$^                              =((
')'                        ))^
'['                ;$/ =''|('.');#;#  Caveat Since Perl version 5.18, the mechanism that allows this code to run has become so powerful that it has been disabled by default to prevent misuse. Therefore on versions 5.18+ you can either add use re 'eval'; to the top of the script or, if the script is named world.pl you can run it like perl -Mre=eval world.pl. It is unfortunate that these unsightly characters must be added, but c'est la vie. (Note: I want to emphasize that enabling this feature is not using some library or addon, the code displayed is valid Perl code, the mechanism is simply no longer enabled by default). • I tried it and it is just great! +1 Oct 10, 2011 at 17:55 • @TomasT. thanks, it was fun to do, and it actually did take some golfing to get that to run in only 3 pictures! Oct 10, 2011 at 18:15 • FYI It uses the Perl regexp feature (?{ code }) to evaluate custom Perl code while regexp matching. The custom Perl code prints the message. It's nice because it doesn't violate any of the rules. – pts Aug 23, 2013 at 22:54 • You sir, are the hello world king! Jan 4, 2014 at 15:27 • Wow! Just wow! Now I need to learn Perl just to see how on earth you did that. Jun 10, 2017 at 13:39 # C# (175 chars) It was quite a challenge to do this in C# because the restrictions preclude any use of quite a lot of the common keywords. It is possible in C# to use \uxxxx Unicode escape sequences in identifiers, but unfortunately not in keywords. I suspect that this solution only works when compiled against .NET 4.0. See explanation for why. using System;struct a{static int Main(){object[]c={"\u0048e\x6c\x6co "+(C\u0068ar)(86+1)+"or\x6c\x64"};typeof(Conso\u006ce).GetMet\u0068o\u0064s()[101].Invoke(c,c);return 0;}}  ## Explanation // I won’t be able to get anywhere without using “System”. // Even if I write it as “Syst\u0065m”, it still violates rule 2. // Therefore, that is the rule we’ll violate. using System; // Thus, we can’t use: H L W D 2 7 // We can’t write “class”, so the Main type must be a struct. struct a { // We can’t write “void”, so Main needs to return an int. static int Main() { // We can’t write “new”, but we can instantiate an array // using the initialisation syntax. object[] c = { "\u0048e\x6c\x6co " + (C\u0068ar) (86 + 1) + "or\x6c\x64" }; // We can use the character escape sequence to write “Console”, but not // “Write” because W is \u0057, which contains a 7. Therefore, we have to // use Reflection to get it. This relies on the fact that Console.Write(string) // is the 102nd method of the type Console in my copy of the framework. // Also, the first argument to Invoke can be anything for a static method // (needn’t be null). The second one is the actual argument to Console.Write. typeof(Conso\u006ce).GetMet\u0068o\u0064s()[101].Invoke(c, c); // Since Main returns int, we have to return something. return 0; } }  • You can use Uri instead of object for b. You can use \xHH in strings instead of \u00HH where it's unambiguous (\x is variable-length). On second thought, you don't need b at all and can just reuse c as the first argument to Invoke. MSDN states that for static methods the first argument is ignored. This brings it down to 175 for me. – Joey Apr 4, 2011 at 12:58 • @Joey: Whoa, thanks! Although if the first argument to Invoke can be anything, it needn’t even be c, it could be 0... :) Apr 4, 2011 at 13:27 • Yes, noticed that when I tried to inline c (which sadly doesn't work since new requires an e and .Split('x') is too long (came out at 177). – Joey Apr 4, 2011 at 13:31 • I had no idea this was possible. +1 Jun 4, 2011 at 20:58 • Very intelligent thing you did with GetMethods. +1 Apr 27, 2013 at 14:29 ## GolfScript, 17 chars '·š““ß¨“›'{~}%  When testing this submission, please save the file as straight binary, not UTF-8. Having trouble recreating the file? Here's the hexdump of it: 00000000 27 b7 9a 93 93 90 df a8 90 8d 93 9b 27 7b 7e 7d |'...........'{~}| 00000010 25 |%|  • Although I'd like to think it's an obvious solution, if you're at all unclear about how this entry works, you can read this spoiler: chat.stackexchange.com/transcript/message/442257#442257 :-) Feb 1, 2011 at 0:08 • It's not ISO-8859-1, it's actually Windows-1252. Apr 27, 2012 at 11:57 • @GlitchMr: I'm actually pretty certain the submission contains characters that are outside of Windows-1252 too. ;-) Apr 27, 2012 at 12:40 • @xfix It really isn't Windows-1252 either. Although Windows-1252 has more valid characters than ISO-8859-1, my entry contains characters, such as 0x8D and 0x90, that aren't valid in Windows-1252 either. Sep 25, 2015 at 0:45 • Fair enough, forgot that some characters are disallowed in Windows-1252. Sep 26, 2015 at 8:36 ## BrainFuck, 106 strokes ++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.  Meets all the rules and it sure is obfuscated. • I think I can still golf it down a bit, but that will have to wait until I get some sleep. Feb 2, 2011 at 1:25 • Isn't BrainFuck obfuscated by its definition? – mbx Jul 13, 2011 at 11:17 • Any competent BF programmer would be able to recognize this... Aug 5, 2011 at 4:10 • Brah, Protected by community, whatever, ++++++++++[>++++++>+++<<-]>++++++++++++.---.+++++++..+++.>++.<++++++++.--------.+++.------.--------. is just 100 strokes, mine is better than yours Aug 13, 2015 at 14:12 • @OverCoder -[------->+<]>-.---.+++++++..+++.+[----->++<]>.---[->+++<]>.--------.+++.------.--------. - 89 bytes. Jan 21, 2020 at 10:24 ## Javascript, 2595 This only breaks rule 2. ﾟωﾟﾉ=/｀ｍ´）ﾉ~┻━┻//*´∇｀*/['_'];o=(ﾟｰﾟ)=_=3;c=(ﾟΘﾟ)=(ﾟｰﾟ)-(ﾟｰﾟ);(ﾟДﾟ)=(ﾟΘﾟ)=(o^_^o)/(o^_^o);(ﾟДﾟ)={ﾟΘﾟ:'_',ﾟωﾟﾉ:((ﾟωﾟﾉ==3)+'_')[ﾟΘﾟ],ﾟｰﾟﾉ:(ﾟωﾟﾉ+'_')[o^_^o-(ﾟΘﾟ)],ﾟДﾟﾉ:((ﾟｰﾟ==3)+'_')[ﾟｰﾟ]};(ﾟДﾟ)[ﾟΘﾟ]=((ﾟωﾟﾉ==3)+'_')[c^_^o];(ﾟДﾟ)['c']=((ﾟДﾟ)+'_')[(ﾟｰﾟ)+(ﾟｰﾟ)-(ﾟΘﾟ)];(ﾟДﾟ)['o']=((ﾟДﾟ)+'_')[ﾟΘﾟ];(ﾟoﾟ)=(ﾟДﾟ)['c']+(ﾟДﾟ)['o']+(ﾟωﾟﾉ+'_')[ﾟΘﾟ]+((ﾟωﾟﾉ==3)+'_')[ﾟｰﾟ]+((ﾟДﾟ)+'_')[(ﾟｰﾟ)+(ﾟｰﾟ)]+((ﾟｰﾟ==3)+'_')[ﾟΘﾟ]+((ﾟｰﾟ==3)+'_')[(ﾟｰﾟ)-(ﾟΘﾟ)]+(ﾟДﾟ)['c']+((ﾟДﾟ)+'_')[(ﾟｰﾟ)+(ﾟｰﾟ)]+(ﾟДﾟ)['o']+((ﾟｰﾟ==3)+'_')[ﾟΘﾟ];(ﾟДﾟ)['_']=(o^_^o)[ﾟoﾟ][ﾟoﾟ];(ﾟεﾟ)=((ﾟｰﾟ==3)+'_')[ﾟΘﾟ]+(ﾟДﾟ).ﾟДﾟﾉ+((ﾟДﾟ)+'_')[(ﾟｰﾟ)+(ﾟｰﾟ)]+((ﾟｰﾟ==3)+'_')[o^_^o-ﾟΘﾟ]+((ﾟｰﾟ==3)+'_')[ﾟΘﾟ]+(ﾟωﾟﾉ+'_')[ﾟΘﾟ];(ﾟｰﾟ)+=(ﾟΘﾟ);(ﾟДﾟ)[ﾟεﾟ]='\\';(ﾟДﾟ).ﾟΘﾟﾉ=(ﾟДﾟ+ﾟｰﾟ)[o^_^o-(ﾟΘﾟ)];(oﾟｰﾟo)=(ﾟωﾟﾉ+'_')[c^_^o];(ﾟДﾟ)[ﾟoﾟ]='\"';(ﾟДﾟ)['_']((ﾟДﾟ)['_'](ﾟεﾟ+(ﾟДﾟ)[ﾟoﾟ]+(ﾟДﾟ)[ﾟεﾟ]+(ﾟΘﾟ)+(ﾟｰﾟ)+(ﾟΘﾟ)+(ﾟДﾟ)[ﾟεﾟ]+(ﾟΘﾟ)+((ﾟｰﾟ)+(ﾟΘﾟ))+(ﾟｰﾟ)+(ﾟДﾟ)[ﾟεﾟ]+(ﾟΘﾟ)+(ﾟｰﾟ)+((ﾟｰﾟ)+(ﾟΘﾟ))+(ﾟДﾟ)[ﾟεﾟ]+(ﾟΘﾟ)+((o^_^o)+(o^_^o))+((o^_^o)-(ﾟΘﾟ))+(ﾟДﾟ)[ﾟεﾟ]+(ﾟΘﾟ)+((o^_^o)+(o^_^o))+(ﾟｰﾟ)+(ﾟДﾟ)[ﾟεﾟ]+((ﾟｰﾟ)+(ﾟΘﾟ))+(c^_^o)+(ﾟДﾟ)[ﾟεﾟ]+(ﾟｰﾟ)+((o^_^o)-(ﾟΘﾟ))+(ﾟДﾟ)[ﾟεﾟ]+(ﾟΘﾟ)+(ﾟΘﾟ)+(c^_^o)+(ﾟДﾟ)[ﾟεﾟ]+(ﾟΘﾟ)+(ﾟｰﾟ)+((ﾟｰﾟ)+(ﾟΘﾟ))+(ﾟДﾟ)[ﾟεﾟ]+(ﾟΘﾟ)+((ﾟｰﾟ)+(ﾟΘﾟ))+(ﾟｰﾟ)+(ﾟДﾟ)[ﾟεﾟ]+(ﾟΘﾟ)+((ﾟｰﾟ)+(ﾟΘﾟ))+(ﾟｰﾟ)+(ﾟДﾟ)[ﾟεﾟ]+(ﾟΘﾟ)+((ﾟｰﾟ)+(ﾟΘﾟ))+((ﾟｰﾟ)+(o^_^o))+(ﾟДﾟ)[ﾟεﾟ]+(ﾟｰﾟ)+(c^_^o)+(ﾟДﾟ)[ﾟεﾟ]+(ﾟΘﾟ)+((o^_^o)-(ﾟΘﾟ))+((ﾟｰﾟ)+(o^_^o))+(ﾟДﾟ)[ﾟεﾟ]+(ﾟΘﾟ)+((ﾟｰﾟ)+(ﾟΘﾟ))+((ﾟｰﾟ)+(o^_^o))+(ﾟДﾟ)[ﾟεﾟ]+(ﾟΘﾟ)+((o^_^o)+(o^_^o))+((o^_^o)-(ﾟΘﾟ))+(ﾟДﾟ)[ﾟεﾟ]+(ﾟΘﾟ)+((ﾟｰﾟ)+(ﾟΘﾟ))+(ﾟｰﾟ)+(ﾟДﾟ)[ﾟεﾟ]+(ﾟΘﾟ)+(ﾟｰﾟ)+(ﾟｰﾟ)+(ﾟДﾟ)[ﾟεﾟ]+(ﾟｰﾟ)+((o^_^o)-(ﾟΘﾟ))+(ﾟДﾟ)[ﾟεﾟ]+((ﾟｰﾟ)+(ﾟΘﾟ))+(ﾟΘﾟ)+(ﾟДﾟ)[ﾟoﾟ])(ﾟΘﾟ))('_');  • I tried it on UglifyJS on it but it saved -2574 bytes. Apr 27, 2012 at 11:53 • I have no idea what I'm looking at here. – Bob Jan 13, 2014 at 5:59 • @Bob = obfuscated Javascript. Hint: it starts by assigning a regular expression literal (namely '/｀ｍ´）ﾉ~┻━┻/') to a variable with the name  ﾟωﾟﾉ. That's followed by a comment and the expression ['_'] in void context. Then the variable o (along with _ and (ﾟｰﾟ)) is assigned the value 3. It continues in that vein, doing lots of extra harmless work that is effectively no-ops, and using roundabout ways to do the intended work (calling alert("Hello world")) in a non-obvious fashion. Jan 21, 2014 at 3:15 • Mar 24, 2014 at 5:27 • You can explore the AST here: astexplorer.net Jun 15, 2020 at 14:46 ## Befunge-93 - 10x9 block va:)/v<>#< 9A:)."c:P^ >"iqwt\%"^ bv"Mjq"<.< c>v<-"x^x] (C:,3>>^:($,9^;)|:O]
>5-^-.--.-
^<_#?>@_@<


Sorry. :D

I wasn't going for small size here, I was trying to really OBFUSCATE the code by including as many smiley faces and noise as possible! :D

Should go with rules 2 and 3.

• "@_@" I laughed.
– Wug
Aug 3, 2012 at 15:06

## Golfscript - 17 chars

Easier to copy/paste than Chris'

'Ifmmp!Xpsme'{(}%


Basically a caesar cipher shifting by 1 char

• +1 Nice for being simpler to copy. Mine has the advantage of breaking none of the rules, and also (probably, depending on whether high-bit characters count as symbols) fulfilling symbol golf also. :-) Feb 1, 2011 at 3:30
• How does this break a rule? Feb 10, 2011 at 14:47
• @sims, it has an e in it Feb 10, 2011 at 20:05
• TWO of the three. :D
– Rob
Oct 4, 2011 at 14:08

## Python

Rule I & III (34 chars)

print'Uryyb Jbeyq'.decode('rot13')


Rule I & III, alternative (39 chars)

print"\110e\154\154o %cor\154\144"%~-88


Rule II & III (37 chars)

input("H\x65ll\x64 W\x64%cld"%(3*38))


Rule I and II (50 chars)

input('\x48\x65\x6c\x6c\x6f \x57\x6f\x72\x6c\x64')


All three rules (58 chars)

input("\x48\x65\x6c\x6c\x6f %c\x6f%c\x6c\x64"%(84+3,3*38))

• deleted my answer, i think yours is more comprehensive. Feb 1, 2011 at 13:37
• +1,great piece but no surprise I have seen you golfing :-) Mar 8, 2011 at 23:05
• You need to import codecs before you can codecs.decode
– cat
Oct 22, 2015 at 23:45
• You can remove the parens in the first solution Oct 17, 2016 at 2:38

## JavaScript, 366 chars

After seeing Joel Berger's Perl solution, I felt compelled to do some ASCII art prettiness myself... JavaScript, uses no alphanumerics, and contrary to JSFuck output it's actually reasonably sized.

                   $$=-~- ~[];_ =$$+ $$; _=$$+$$+- ~[];_=-~[]; =!![]+[];__={} +[];$$_=/\\ /+[]
_$$=(![]+[])[_]+(! []+[])[$$]+$[$_+~[]]
+$[_]+$[+[]];$=__[_$]+
__[_]+($[$]+[])[_]+(![]+
[])[$_+~[]]+$[+[]]+$[_]+$[
$$]+__[_]+[+[]]+__[_]+[_] _=$$_[_]+-~[];$[$][$](_$$+'("' +_+-~[]+-[]+_+_+_+_+_+_+_+_ +_+_+_+[$$+_$]+$$_[-~[]]+_+-[]+ _+$$+[$$+_]+_+_+[$$+_$]+_+[$$+_]+$$+ _+_$
+$_+_+$_
+$_+'")' )($)

• could you please display the number of characters in your code in the heading? I'm curious to see how many you got it to... Jan 20, 2014 at 22:32
• @Eliseod'Annunzio there you go, I forgot that this was code-golf. Length is given with whitespace stripped and the last ($) turned into () (because I added $ for symmetry). Jan 20, 2014 at 22:53
• Thanks for your tips... I had to resize my code out to account for the "W" and then shrunk it down using your advice... Jan 21, 2014 at 0:58
• +1, do tell us how you obfuscated your JS like that! :0 Nov 19, 2020 at 9:43

## rot13 - 11 chars

Uryyb Jbeyq

2019/2/12: This answer is being kept for historical reasons, and is no longer a valid answer under current site rules.

• Is rot13 a language? :/ Nov 16, 2015 at 8:12
• yes and I can create its interpreter :P Mar 14, 2016 at 17:07
• Technically, rot13 is just a cipher. It is as much a langauge as a Vigenère cipher. Sep 14, 2016 at 10:47

## Scala, 39

Solutions like print("Qnuux)x{um"map(_-9 toChar)) (35 chars) fall foul of rules 1 and 2 ("toChar" contains both "h" and "r"), which makes this a bit tough.

Finally came up with this:

print("䠀攀氀氀漀 圀漀爀氀搀"map(_.reverseBytes))


Suggestions for improvement welcome

# TeX, 95 Bytes

Breaks the third rule.

\^^5pp^^%^^2^^#^^!^^3^^%{^^(}^^%^^,^^,^^/
\^^5pp^^%^^2^^#^^!^^3^^%{^^7}^^/^^2^^,^^$! \^^%^^.^^$


Run with tex filename.tex to get a dvi output, or pdftex filename.tex to get a pdf.

• Wow, never knew TeX can be so obfuscated!
– gar
Jun 2, 2014 at 18:04

## Bash, 30 25 characters

tr G-t F-s<<<Ifmmp\ Xpsme


With thanks to Peter Taylor for the herestring usage.

• You can save 5 characters using a here string: tr G-t F-s<<<Ifmmp\ Xpsme Feb 5, 2011 at 20:35

## ><>, 2×20 = 40 characters

'mu{x)xuunQ'>9-o?v;
;^?o-9<


Violates Rule II, since I cannot output a character without using o.

### Windows PowerShell, 91 959798

($OFS='')+('Qnuux)x{um'|% t*y|%{"[convert]::"+([convert]|gm -s t*r).name+"($($_-9))"|iex})  Violates only Rule II. It's very evil that char violates two rules on its own already. And yikes, this one was hard to get working. • The first line sets $OFS to '' so when casting an array to a string no spaces appear between items.

• Casting to char actually was the hardest part of all and I spend around a day searching for a way. I got all the rest working nicely but once I do calculations on them I have ints, not chars. Putting those back in a string was kinda hard.

• I found a way of invoking Invoke-Expression without needing the e as well:

  &(gcm i?x)


but that still lacked the arguments. And I've thrown away my goal of satifying all three rules by then already. Also it didn't particularly help me in casting to char.

• Shortened a bit with a newer PowerShell version. No useful different way of creating the result emerged, though, sadly.

• There's still lots of "o"s and "e"s in here, and an "r". Not sure I'd have much better luck cleaning that out either, though. Might yet have to give it a shot sometime.
– Iszi
Nov 17, 2013 at 5:01
• Just re-read the rules - only needed two of the three rulesets met, and this does qualify. Good show! Would be uber-awesome if we could come up with one that takes 3/3, but I doubt that's very possible.
– Iszi
Nov 17, 2013 at 8:03
• Took me plenty of time to get to this point already, and I still doubt it's possible to follow all rules.
– Joey
Nov 17, 2013 at 11:43

# PHP (16 bytes)

I've noticed that my previous PHP example wasn't obfuscated enough, so let's see more blatantly obfuscated examples (warning, obfuscation!). Also, blatantly copying GolfScript example, except making it smaller (is it even possible?). This entry requires either PHP 5.4 or short_open_tag enabled. No rule was broken while making this. In fact, this entry doesn't contain any ASCII letters or digits.

This example doesn't break any of the rules. Have fun. To generate file, run following command.

printf "<?=~\xb7\x9a\x93\x93\x90\xdf\xa8\x90\x8d\x93\x9b;" > obfus.php


Or, in case you don't trust running printf command, I've prepared Base64 dump of the file.

PD89freak5OQ36iQjZObOw==


If you think that both methods to generate it break rules, I also have generated file on Dropbox.

And to run it.

php obfus.php


The resulting file should have 16 bytes. Have fun running it. Please note that if you have E_NOTICE warnings enabled, it will show notice. Just ignore it, fixing it would waste two characters one character (I can use @ operator, after all) and would make resulting Base64 look less awesome.

## Whitespace (167 characters)

To obtain the WS program, substitute a Space, Tab, or Linefeed character for S, T, L, respectively, in the following string:

SSSTSSTSSSLTLSSSSSTTSSTSTLTLSSSSSTTSTTSSLTLSSSSSTTSTTSSLTLSSSSSTTSTTTTLTLSSSSSTSSSSSLTLSSSSSTSTSTTTLTLSSSSSTTSTTTTLTLSSSSSTTTSSTSLTLSSSSSTTSTTSSLTLSSSSSTTSSTSSLTLSSLLL


When executed by this WS interpreter, this program prints "Hello World".

Explanation (ignore the whitespace here!):

SSS TSSTSSSL TLSS  <-- output H (ascii code 72 in decimal, 1001000 in binary)
SSS TTSSTSTL TLSS  <-- output e (ascii code 101 in decimal, 1100101 in binary)
SSS TTSTTSSL TLSS  <-- etc
SSS TTSTTSSL TLSS
SSS TTSTTTTL TLSS
SSS TSSSSSL TLSS
SSS TSTSTTTL TLSS
SSS TTSTTTTL TLSS
SSS TTTSSTSL TLSS
SSS TTSTTSSL TLSS
SSS TTSSTSSL TLSS
LLL                <-- end the program


The "middle" strings (e.g. TSSTSSSL) are the ascii codes (in binary, with S denoting 0, T denoting 1) for the successive letters in "Hello World". The prefix SSS pushes the number that follows it (terminated by an L) onto the stack. TLSS outputs the character whose ascii code is on top of the stack. Finally, according to this tutorial, a program must end with LLL for a clean exit by the interpreter.

NB: I'm entering this as a separate answer, because the other WS program entry is a 1287-character program that prints "Hello, world of spaces!" instead of the required "Hello World".

## Ruby - 63 characters

puts [%w{G d k k n},%w{V n q k c}].map{|l|l.map(&:succ)*''}*' '

• breaks #1, though Apr 29, 2013 at 5:54
• And even shorter: puts "Gdkkn~Vnqkc".split("").map(&:succ)*'' - 43 Jul 7, 2015 at 13:59
• I can only imagine what is going through this guy's head when he suggests a piece of code with the string succ in it. Mar 22, 2020 at 15:26

C (94)

On little Endian machines:

main(){int i[]={1819043144,((0x1bc5c81b|1<<0x14)*4)+3,0xa646c00|(0x39<<1),0};printf("%s",i);}


Violates rule II, but satisfies the rest.

• 79 characters: i[]={1819043144,((0x1bc5c81b|1<<0x14)*4)+3,0x646c00|(0x39<<1)};main(){puts(i);} Jun 18, 2020 at 22:51

C, 160 chars

Works only on little-endian machines with 4-byte int:

main(){int a='a',b=a/a,c=b+b,f=c+c,g=f+f,i=g+g,j=i*i,k=j*j,m=a+g+b+c,n=m+b+c;int p[]={a+g-b+(a+f)*j+m*k*(j+b),n+i*c*j+k*(n+g+n*j),a+i+b+m*j+(a+f-b)*k};puts(p);}


Satisfies all three rules.

• You could just use numeric constants without 0,1,2,7: p[];main(){p={(5*5*5*5*5*64+96696)*(443+5688),(5*3*4*3+4-3)*(66*45*6-6*6-4+3)*8‌​3*(3+4),6544494+36868};puts(p);} -- 111 chars.
– user21677
Jun 13, 2015 at 3:44
• Similar vein (actually tackled the problem in a few different ways before settling on this). x[]={45483*39994-3958,48465*38543-5584,6584695-3333};main(){puts(x);} - 69 characters. I'm sure I could shave a few more off given more time to mathify the literals some more. Was a fun way to spend a couple hours, anyway :) Jul 7, 2015 at 19:11

## PHP, 28 bytes

Not exactly obfuscated, but very short and obvious :). Showing that even when limiting characters you can make very easy to follow programs. Constraints 1 and 3 followed. Constraint 2 was abused.

<?=str_rot13('Uryyb Jbeyq');


Note that this requires short_open_tag being set, unless you're using PHP 5.4 or higher. Maybe some examples are shorter, but I think that this example is pretty short.

## Dis, 102 83 chars

Unrolled the code loop since the letters can be generated with less than five consecutive operations. Saved a few characters by reusing the accumulator value: two l are consecutive , SPACE can be generated from o and d can be generated from l.

*>|||{>|||{>||{{>|{|||{>||{>|{>|||{>||{||{!!>**_!!}|_}!^__}|__>*__}|_}|_>!!|_}!^__!


Old version

^}!>^^_^!__!>_^!^^**_^!^^**_
^_!{**_^__!{>_^__{>>!^_!{**_
^_!>^*_^!^^**_^_^^**_*______
___________>||||{^


With comments below. It is using a sequence of five identical operations to generate all the characters in Hello World: one rotation and four subtractions.

^     (move code pointer to data pointer value '^')
}!>^^ (store 'H' in accumulator)
_     (no-op)
^     (data pointer value used by code pointer jump)
!__!> (store 'e' in accumulator)
_     (no-op)
^     (data pointer value used by code pointer jump)
!^^** (store 'l' in accumulator)
_     (no-op)
^     (data pointer value used by code pointer jump)
!^^** (store 'l' in accumulator)
_     (no-op)
^     (data pointer value used by code pointer jump)
_!{** (store 'o' in accumulator)
_     (no-op)
^     (data pointer value used by code pointer jump)
__!{> (store ' ' in accumulator)
_     (no-op)
^     (data pointer value used by code pointer jump)
__{>> (store 'W' in accumulator)
!     (program termination)
^     (data pointer value used by code pointer jump)
_!{** (store 'o' in accumulator)
_     (no-op)
^     (data pointer value used by code pointer jump)
_!>^* (store 'r' in accumulator)
_     (no-op)
^     (data pointer value used by code pointer jump)
!^^** (store 'l' in accumulator)
_     (no-op)
^     (data pointer value used by code pointer jump)
_^^** (store 'd' in accumulator)
_     (no-op)
*     (data pointer value used by code pointer jump to reach '!' between 'W' and 'o')
________________ (no-ops)
>|||| (rotate data value and perform four subtractions)
{     (print value in accumulator)
^     (move code pointer to data pointer value '^' except for the last jump '*')

• Which interpreter did you use? I tried with mine but it output diffrently.
– user100411
Jun 21, 2021 at 13:57

## bash 28 chars:

printf 'p|ɹ°M ο||ǝ%b'"\x48"


p|ɹοM ο||ǝH

alternatively with /bin/echo (18 chars) *) see discussion below.

/bin/echo -e 'p|ɹοM ο||ǝ\0110'


Selftest:

echo "printf 'p|ɹοM ο||ǝ%b' "\x48"" | egrep -i "[^hlwd27eor01]"


Harder than thougth! Tools, for turning Words upside down, the tools think an 'H' or 'o' turned upside down is best displayed as H or o. This would be in conflict with group 1 (Hlwd:27:eor01) respectively 3.

H can be displayed with

echo -e "\0127"


but 01 and 2 are poisoned too. Gee! But the bash-buildin echo has not only the option to display octal ascii values, but hexadecimal too:

echo -e "\x48"


But if we use bash as a programming language, the echo command is part of the program, which not only counts to the character count, but also contains the poisoned characters (hlwd:27:eor01) eho from groups 1 and 3.

So this is moment the echo died. Fortunately, there is printf, which knows "%b" to display .

The r is the only problematic character in printf, and belongs to group 3. Since 'o' is in the last group, we could leave it in Hello and in World, but we can use the omicron ο which looks like an o, or ° &deg;.

• Would upvote this, but your reputation is too leet. Apr 28, 2012 at 7:18
• @GlitchMr: Now you can - I voted something down, and should be seet 500N. :) Apr 28, 2012 at 9:20
• dl.dropbox.com/u/63913412/stilltooleet.png. Also, downvoting questions doesn't decrease reputation. Downvoting answers does nevertheless. Apr 28, 2012 at 9:32
• @GlitchMr: Ah, that's it! :) Apr 28, 2012 at 12:34

## JavaScript - 132 characters

(_=(_=[][(f=!!(_='')+_)[3]+(b=({}+_)[(I=-~(z=_-_))])+($=(c=(d=!_+_)[I])+d[z])])())[f[I]+'l'+(a=d[3])+$]("H"+a+'ll'+b+' W'+b+c+'ld')


Breaks rule I

Usage:

• Paste "javascript: [script]" into browser address bar
• Make a blank html page, paste the script into a tag
• Breaks both rule 1 and 2. You are using the number 1 for the arrays. Feb 4, 2011 at 20:30
• You can replace 1 by !![]+![] and 0 by ""-"" to don't break rule #2. Feb 15, 2011 at 21:13
• Thanks @Bass5098 and @HoLyVieR, I kind of missed the 1 and 0 when minimizing the script. I replaced 0 with z=_-_ and 1 with I=-~z, I could also use ++z, but -~ looks nicer :)
– m0sa
Feb 16, 2011 at 7:46
• Huh? !![]+![]? Why not just 4-3? Mar 9, 2011 at 1:32
• @Timwi: More obfuscation Aug 5, 2011 at 23:06

# C: 162 characters (excluding unnecessary newlines)

I opted for readability and transparency when writing this.

a[3],b;main(){b=99
+9;b+=b<<8;b=b<<8|
97|4;b=b<<8|64|8;a
[3^3]=b;b=78+33<<8
;b+=87;b=b<<8|35^3
;b=b<<8|64|47;a[5^
4]=b;b=97+3<<8;b+=
99+9;b=b<<8|66|48;
a[6^4]=b;puts(a);}


It satisfies all three requirements.

• I like this, but unfortunately it doesn't satisfy all the rules, because it contains the digit 7, violating rule #3. But it would be easy to get rid of 7. Also by adding a few ints, and adding a few extra parentheses, and adding int puts(int*); to the beginning, it compiles with gcc -ansi -W -Wall only with a single warning: control reaches end of non-void function.
– pts
Aug 24, 2013 at 7:05
• > I opted for readability and transparency when writing this. That's saying something :) Mar 29, 2020 at 20:17

## Bash, 24 20 characters

You need to have the "bsdgames" package installed.

rot13<<<Uryyb\ Jbeyq


Thanks gnibbler :)

# PostScript, 41 chars

<64><~+BNK%C]~><48656c6c6f>3{print}repeat


Usage: $gs -q -dNOPROMPT -dNODISPLAY filename.ps • you could also run it like: gsnd -q -- filename.ps Nov 24, 2011 at 3:47 JavaScript, 66 chars Another JavaScript solution, this time breaking rule #2. top[(U=unescape)('a%6cert')](U('%48e%6c%6co %5'+(6+1)+'or%6c%64'))  The above follows the concept behind hallvabo's answer. Before I caught on to that approach, I had the arguably-more obfuscated version: top[8680439[n='toString'](30)]((16+1)[n](z=8*4)[u='toUpperCase']() +15960[n](33)+'o '+z[n](33)[u]()+1155505[n](36))  which also breaks rule #2 and comes in at 114 chars. (Remove the carriage return in this second solution as it is just there for readability.) • I read that as Runescape. Nov 1, 2011 at 23:43 • @MateenUlhaq I always read it as Runescape, and I only played for a year over a decade ago... What's wrong with me? Sep 16, 2015 at 16:30 ## Haskell, 38 Constraints 1 and 3 followed. main=putStr$map succ"G\x64kkn\USVnqkc"


# C (79*12=948)

Using no strings or characters, and only the number one.
I was a little creative with the bitshifts and subtractions to make them fit onto at 80x12 console. Ask me in the comments if you can't figure it out.

int i[(1+1)+1],*I=i;main(){*I++=(((1<<((1<<(1+1))*(1<<(1+1))))+((1<<((((1<<(1<<
(1+1)))-1)^(1<<1+1))-1))-(1<<1)-1+((1<<1)*(1<<1)*(1<<1)*(111-(((1<<(1<<(1+1)))-
1)^(1<<1+1))))))*(((((1<<(1+1))*(1<<(1+1)))*(1<<1)-((1<<(1+1))|1))*(((((1<<(1<<
(1+1)))-1)^(1<<1+1))*((((1<<(1<<(1+1)))-1)^(1<<1+1))-1)*((((1<<(1<<(1+1)))-1)^(
1<<1+1))-1)+(((1<<(1<<(1+1)))-1)^(1<<1+1)))-((((1<<(1<<(1+1)))-1)^(1<<1+1))*(((
(1<<(1<<(1+1)))-1)^(1<<1+1))-1)+1)))+((1<<1)|(1<<(1+1))))+(1<<1));*I++=i[1-(1<<
(1-1))]+(((1<<((((1<<(1<<(1+1)))-1)^(1<<1+1))+(1<<1)))+((1<<(((1<<(1<<(1+1)))-1
)^(1<<1+1)))-(1<<(1+1))*(1<<(1<<1))*((1<<(1<<1))-1)-(1<<1)-1))*(((1<<2)*(1<<2)*
((1<<(1+(1<<(1-1))))-1))*((((1<<(1<<(1+1)))-1)^(1<<1+1))-1)*((((1<<(1<<(1+1)))-
1)^(1<<1+1))-1)+(1<<1)+1));*I++=(((1<<(1<<(1<<(1<<1))))+(1<<(1<<((1<<1)+1)))+((
(((1<<(1<<(1+1)))-1)^(1<<1+1))-1)*(1<<1)+1))*((((1<<(1<<(1+1)))-1)^(1<<1+1))-1)
*((((1<<(1<<(1+1)))-1)^(1<<1<<1))-1)+(1<<((1<<1)*((1<<1)+1)))-(1<<1));puts(i);}