127
\$\begingroup\$

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

Leaderboard

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 ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 48934; // This should be the user ID of the challenge author.

/* App */

var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;

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

function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}

function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}

function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });  
}

getAnswers();

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

var OVERRIDE_REG = /^Override\s*header:\s*/i;

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

function process() {
  var valid = [];
  
  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      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],
        link: a.share_link,
      });
    
  });
  
  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;
    
    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);

    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)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }

}
body { text-align: left !important}

#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}

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

table thead {
  font-weight: bold;
}

table td {
  padding: 5px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">
<div id="answer-list">
  <h2>Leaderboard</h2>
  <table class="answer-list">
    <thead>
      <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr>
    </thead>
    <tbody id="answers">

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

    </tbody>
  </table>
</div>
<table style="display: none">
  <tbody id="answer-template">
    <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr>
  </tbody>
</table>
<table style="display: none">
  <tbody id="language-template">
    <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr>
  </tbody>
</table>

\$\endgroup\$
  • 7
    \$\begingroup\$ I guess import in python is not permitted. \$\endgroup\$ – Alexandru Feb 1 '11 at 0:07
  • 26
    \$\begingroup\$ Does these rules apply to language keywords as well? \$\endgroup\$ – hallvabo Feb 1 '11 at 13:04
  • 8
    \$\begingroup\$ are those case insensitive restrictions? \$\endgroup\$ – oenone Aug 4 '11 at 14:22
  • 20
    \$\begingroup\$ 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. \$\endgroup\$ – Thomas Eding Aug 5 '11 at 23:01
  • 4
    \$\begingroup\$ @trinithis, and others, ASCII character 72 is "H" which is why I chose those two \$\endgroup\$ – Kevin Brown Sep 18 '11 at 23:18

129 Answers 129

4
\$\begingroup\$

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);}
| improve this answer | |
\$\endgroup\$
3
\$\begingroup\$

Befunge-93 - 57 characters

554553943346**,"b"3+,366**::,,3+::,48*,699*+,,+,**,**,+,@

Should meet all three requirements.

| improve this answer | |
\$\endgroup\$
3
\$\begingroup\$

Perl

my @txt = (
  -38,
  -9,
  -6/3,
  -6/3,
  3/3,
  -468/6,
  -69/3,
  3/3,
  4,
  -6/3,
  -30/3,
);

$\ = "\n";
print map{pack 'C', 330/3 + $_} @txt;

I would have been able to do it without any of the of the "forbidden" characters, except there is no easy way, that I can think of to enable the use of anything other than print or die, without using, at least one of the "forbidden" characters.

use feature 'say' # e
use 5.010; # 10
BEGIN{ $^H{'feature_say'} = !'' } # eh
use Modern::Perl # ero

say ...
use IO::Handle; # e
STDOUT->say( ... )

So the only way is to load a module, that internally loads IO::Handle. Which will indirectly enable the use of STDOUT->say.

| improve this answer | |
\$\endgroup\$
3
\$\begingroup\$

C, ??? characters

Not very heavily golfed, but I was going more for obfuscation anyway. Your mileage may vary, you'll probably have to do some crap to get the hardcoded address of printf right. No forbidden characters. You could easily shorten up a lot of stuff by not using different numbers of underscores as variable names and instead using 1 letter things, but I think it looks uglier this way.

int main()
{
    int(*f)(int*,...)=467846797-333333333;
    int _=9-8,__=_<<_,___=__<<_,____=___<<_,_____=____<<_,______=_____<<_,$=_|((_____|____)<<__);
    
    f("%c", $+(_|__|___)^______);
    f("%c", $+(___));
    f("%c", $+(_|__|____));
    f("%c", $+(_|__|____));
    f("%c", $+(__|___|____));
    f("%c", ______);
    f("%c", $+(__|___|_____)^______);
    f("%c", $+(__|___|____));
    f("%c", $+(_|_____));
    f("%c", $+(_|__|____));
    f("%c", $+(_|__));
    f("%c", ______|_);
}
| improve this answer | |
\$\endgroup\$
3
\$\begingroup\$

Befunge-93, 8x6 grid

I know I'm a little late to the party, but I saw the Befunge-93 solutions and decided to see how small I could make one while still following all the rules.

"[uixn"v
Qv:,-9<"
v_vQQQ^)
>9+,>:|f
^Q>>^Q@"
^"?ncu"<
| improve this answer | |
\$\endgroup\$
3
\$\begingroup\$

><> (Fish), 80 bytes

Wait, I'm not the only one that uses ><>?

33-aa*:8+:6+:3-8a*843--+48*aa*:b+$8+::843---89*ab*43-+543-p33-43-.
 :?!;_33-43-.

Thanks to @Sp3000 for a method to print without "o".


Try it here.

| improve this answer | |
\$\endgroup\$
3
\$\begingroup\$

Minecraft command, 776 bytes

Let's do something explosive. These commands (break rule #1) generate "Hello World" made by TNT in a Minecraft superflat world.

Screenshot: enter image description here

/tp 33 4 3
/fill ~4 4 5 ~4 4 9 TNT
/fill ~4 4 5 ~6 4 5 TNT
/fill ~4 4 9 ~6 4 9 TNT
/fill ~6 4 5 ~6 4 6 TNT
/fill ~5 4 ~4 ~6 4 ~4 TNT
/fill ~8 4 3 ~8 4 9 TNT
/fill ~34 4 3 ~34 4 9 TNT
/fill ~38 4 3 ~38 4 9 TNT
/tp 3 4 3
/fill ~44 4 6 ~44 4 9 TNT
/fill ~54 4 3 ~54 4 9 TNT
/fill ~58 4 6 ~58 4 9 TNT
/tp 56 4 3
/fill ~4 4 6 ~4 4 6 TNT
/fill ~4 4 9 ~4 4 9 TNT
/fill ~8 4 ~4 ~8 4 ~4 TNT
/tp 66 4 3
/fill ~4 4 6 ~4 4 6 TNT
/fill ~4 4 9 ~4 4 9 TNT
/fill 33 4 3 33 4 9 TNT
/fill 34 4 6 34 4 6 TNT
/fill 35 4 3 35 4 9 TNT
/fill 43 4 3 43 4 9 TNT
/fill 45 4 6 45 4 9 TNT
/fill 46 4 6 46 4 6 TNT
/fill 46 4 9 46 4 9 TNT
/fill 53 4 9 56 4 9 TNT
/fill 53 4 3 53 4 9 TNT
/fill 55 4 3 55 4 9 TNT
/fill 59 4 6 59 4 9 TNT
/fill 63 4 6 63 4 9 TNT
/fill 65 4 6 65 4 6 TNT
/fill 69 4 6 69 4 9 TNT

Bonus: After explosion enter image description here

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Why are you teleporting? Can't you just increase the relative coordinates in the fill command? \$\endgroup\$ – Luca H Nov 23 '17 at 15:22
  • \$\begingroup\$ @LucaH I must avoid number 0, 1, 2 and 7. \$\endgroup\$ – Colera Su Nov 23 '17 at 15:23
  • \$\begingroup\$ Oh man, I feel stupid... It's not like I didn't read the challenge, I just forgot about it... Thanks for clarifying! \$\endgroup\$ – Luca H Nov 23 '17 at 15:30
  • \$\begingroup\$ Wouldn't 1 work instead of TNT? \$\endgroup\$ – NieDzejkob Dec 9 '18 at 18:24
  • \$\begingroup\$ @NieDzejkob he has to avoid 1 \$\endgroup\$ – Sagittarius Dec 24 '19 at 21:43
2
\$\begingroup\$

C (333 characters)

I decided to emphasize on obfuscate, with golf secondary. This is written entirely in C, and it only breaks rule #2 laid out in the original post. It also breaks I don't know how many C programming rules...

int main(){
int a[]={0x0a004000,0x0fc00109,0x04e01500,0x09e08400,0x03506a61,0x00f00000,0x0f010ae3,0x05f0fb16,0x0beb0030,0x0130a300,0x0bc00500,0x00000000};
int b,c=13,e,x,an;
goto _XX;
_00:an=e,x^=x,b^=b;
_10:if(!an)goto _XX;
b|=!!(an&0xf)<<x++;
an>>=4;
goto _10;
_XX:if(c<=1)goto _40;
if(c<13)printf("%c",b);
e=a[13-c--];
goto _00;
_40:return 0;
}
| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

J (23 characters)

a.{~<:a.i.'Ifmmp!Xpsme'

It doesn't beat Golfscript, but I figure J deserves an entry anyway. (This is just a minor tweak of the second example on the J vocabulary page for the word i..

| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

C Program (83 Characters)

#include<stdio.h>
void main(){printf("%ce%c%co %cor%c%c",104,108,108,119,108,100);}
| improve this answer | |
\$\endgroup\$
  • 1
    \$\begingroup\$ This program satisfies rules 1 and 3. \$\endgroup\$ – Aniket Suryavanshi May 1 '12 at 17:46
2
\$\begingroup\$

"C++"

329 bytes including newlines and extraneous backslashes on newlines (which are 7 bytes).

C++ is in scare quotes because of all the implementation dependent details (gcc, appropriate linux kernel, x86). Doing this challenge in C++ is difficult because right off the bat #include is forbidden.

int main(){int r[]={1819043144,1866980911+1000000,164353511+10000011};asm("sub \
$31,%%esp\nsub $1,%%esp\nmov $4,%%eax\nmov %%eax,0x1C(%%esp)\nmov %0,%%eax\nmov\
 %%eax,0x18(%%esp)\nmov %1,%%eax\nmov %%eax,0x14(%%esp)\nmov $1,%%eax\nmov %%ea\
x,16(%%esp)\npopa\nint $0x80"::"r"(r),"r"(9+3):"%eax","%ebx","%ecx","%esi",
"%ebx");}

I think there's technically a bit of undefined behavior here as well, since I don't tell gcc all the registers I clobber (Things like %edx cannot be referred to directly) which is unfortunate.

| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

JavaScript 155 142 122

This satisfies ALL the rules provided.

_=(!!4+"")[5-4],3[C="c\x6fnst"+_+"uct\x6f"+_][C]("a\x6c\x65"+_+
"t('\x48\x65\x6c\x6c\x6f \\x5"+-~6+"\x6f'+_+'\x6c\x64')")()
| improve this answer | |
\$\endgroup\$
  • 1
    \$\begingroup\$ You can do -~[] to get 1. Also, using my approach with constructor twice instead of going via []["sort"] saves you even more: 3[$="c\x6fnst"+(_=(!+[]+"")[-~[]])+"uct\x6f"+_][$] gets you Function and saves 14 chars. \$\endgroup\$ – FireFly Jan 20 '14 at 23:08
  • \$\begingroup\$ @FireFly, nice spotting... All rules now done in 142 characters... I had to account for the "W"... Damn hard character to get with the restrictions... \$\endgroup\$ – WallyWest Jan 21 '14 at 0:54
  • 1
    \$\begingroup\$ I took the liberty to edit the post with some more changes, I hope you don't mind... get boolean true via !!4, the number 1 via 5-4, and by making use of double-escaping (once because of the string literal, and then a second time due to the string literal inside the alert in the function body) we could simply concatenate the -~6 into the string instead of having to unescape. \$\endgroup\$ – FireFly Jan 21 '14 at 12:31
  • \$\begingroup\$ @FireFly As Humphrey Bogart said in Casablanca "This looks like the start of a beautiful friendship." :) But I have to ask, what the hell is the use of the 3? I see ',3[C="' but don't understand the number's importance in the code? \$\endgroup\$ – WallyWest Jan 21 '14 at 22:15
  • 1
    \$\begingroup\$ Haha. The 3 replaces [] in your code because both numbers and arrays (like all other types constructed via constructor functions) inherit a 'constructor' property from their prototype. It doesn't matter which of these that we use, so I switched to 3 since it saves a character. In the end, it's just a stepping stone to reach Function (as the constructor of the Number function, i.e. Number.constructor). If you want to discuss further we should probably use the chatroom instead... \$\endgroup\$ – FireFly Jan 21 '14 at 22:33
2
\$\begingroup\$

Sclipting, 8 characters

낆녬닆묠녶뭲닆밄

Of course, this doesn’t contain any of the restricted characters.

(This answer is technically cheating because Sclipting was invented after this challenge was posted.)

| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

Haskell (genetic programming), 306 chars

This is not really genetic programming. It's just a pun. The only violation of the rules is the function name putStrLn, which is a builtin I/O function, and follows the spirit of the rules even if it doesn't quite match the letter.

a=(['~','}'..]!!)
t=(succ)
y= \x->x-x
c=(y)$3
g=((t.t$c)*)
q=(a.g.t.g.t.g.g.t.g.t$c):(a.t.g.g.g.t.g.t$c):(a.g.t.g.g.g.t$c):(a.g.t.g.g.g.t$c):(a.t.g.t.g.t.g.t$c):(a.g.t.g.t.g.t.g.t.g.g.t$c):(a.t.g.t.g.t.g.g.g.t$c):(a.t.g.t.g.t.g.t$c):(a.g.g.t.g.t$c):(a.g.t.g.g.g.t$c):(a.g.t.g.g.t.g.t$c):[]
main=putStrLn$q
| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ +1. But what's the significance of the parens around y on line 4? \$\endgroup\$ – yyny Jan 30 '16 at 0:15
  • 1
    \$\begingroup\$ None whatsoever. I suppose you could shave off a couple extra chars, but this isnt a competitive answer in any case. \$\endgroup\$ – archaephyrryx Jan 30 '16 at 4:58
2
\$\begingroup\$

Golfscript 18 bytes

New code (saved 4 bytes thanks to Martin Büttner):

'Jgnnq"Yqtnf'{((}%

Old code (22 bytes):

"Jgnnq\"Yqtnf"{1 1+-}%

It basically preforms a Caesar cipher two times. Because you can't have a 2 in your code, I just used 1+1. It doesn't break any of the rules.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ (( (decrement twice) is shorter than 1 1+-. Also, does GolfScript support ' to delimit strings? In that case you wouldn't need to escape the " in the string. \$\endgroup\$ – Martin Ender Mar 9 '15 at 12:47
2
\$\begingroup\$

Clip, 17 chars

All rules followed.

m+'☻`"Fcjjm▲Umpjb

This just means, in a more readable form, map (add 2 to ascii value) "Fcjjm▲Umpjb".

| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

Pyth - 24 bytes. All 3 rules

Noticed there wasn't a Pyth entry yet (probably because the question's been around longer), but wanted to add one for completion's sake!

V"Qnuux)`x{um"=+kC-CN9;k

Try it out.

Explanation

# basically just a -9 int value translation on each character

V"Qnuux)`x{um"        ;     # for each chr (N) in the string "Qnuux)`x{um"
              =+k           #   append to k (initially an empty string)
                 C          #   the character value of the integer
                  -  9      #   that results from subtracting 9 from
                   CN       #   the integer value of the current chr (N)
                       k    # print k
| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

C 61 Bytes

main(){printf("%ce%c%co %cor%c%c",9*8,108,108,86+1,108,100);}

Went as small as possible on this guy. Hopefully y'all can see that. This breaks rule 2.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ The rules say you have to comply with two of the three rules. I follow rule 1 and 3 \$\endgroup\$ – bioweasel Oct 20 '16 at 19:47
2
\$\begingroup\$

Befunge-93, 49 45 bytes

Thanks to James Holderness for saving me two four bytes! (I don't know how to count)

Why is this 7-year-old challenge in the front page? I don't know! What I do know is that I came up with an answer before I realized the thread is ancient, so here goes:

554**:8+:6+:3-:83*-48*"q"2-:3-::7-"F"2+>:#,_@

Works in complete disregard to the third rule, but that's fine because rules are made to be broken anyway it meets 1 and 2.

Try it online!

| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

Java, 88

I'm surprised, nobody used java.

System.out.print\u006Cn("\u0048e\u006C\u006Co "+((c\u0068ar)(11*8-1))+"or\u006C\u0064");
| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ 1) this is not a complete function; 2) byte count is wrong. See my answer. \$\endgroup\$ – Andrey Jan 18 '17 at 8:04
  • \$\begingroup\$ @Andrey 1) it won't compile, but you can run it in jshell under java 9, as for 2 i fixed it. \$\endgroup\$ – user902383 Jan 18 '17 at 8:17
2
\$\begingroup\$

Java, 71 bytes

Violates restriction #2, but doesn't contain [HLWDhlwd27].

String m(){return String.format("\u0048e\154\154o %cor\154\144",86+1);}

OR to print to stdout (the same length)

voi\u0064 m(){System.out.printf("\u0048e\154\154o %cor\154\144",86+1);}
| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ task is to "Create the shortest possible obfuscated program that displays the text "Hello World"." and you are not displaying it \$\endgroup\$ – user902383 Jan 18 '17 at 8:19
  • \$\begingroup\$ @user902383 function can use its return value for output. Anyway, I've updated the answer. \$\endgroup\$ – Andrey Jan 18 '17 at 8:53
  • \$\begingroup\$ v->"\u0048e\154\154o "+(char)(86+1)+"or\154\144" for 48 bytes. \$\endgroup\$ – Olivier Grégoire Jun 15 at 14:33
2
\$\begingroup\$

pb, 72 bytes

b[69+3]>b[101]>b[108]>b[108]>b[111]>>b[86+1]>b[111]>b[114]>b[108]>b[100]

Violates rule II

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ oh hey, someone else wrote a pb answer! (i'm a little late) \$\endgroup\$ – undergroundmonorail Sep 8 '17 at 6:13
  • \$\begingroup\$ @undergroundmonorail hey you're back! (?) \$\endgroup\$ – Erik the Outgolfer Sep 8 '17 at 9:16
  • \$\begingroup\$ i check this site every day... has it really been that long since i posted anything? o_o \$\endgroup\$ – undergroundmonorail Sep 9 '17 at 5:55
2
\$\begingroup\$

C, 2066 bytes

NOTE: Little-endian only. (That should give readers a hint at what this strange code does.)

Certainly not going to win, but it's kinda neat anyway (IMO). Satisfies first and third requirements.

int _(){return 0;}int __(_){return(1+_);}int _____(_
,__){return(_+__);}int ______(_,___){return(_*___);}
int ___(_,__){return _<<__;}int main(){int ____[4]={
___(_____(______(__(___(__(_()),__(_()))),______(__(
___(__(_()),__(__(___(__(_()),__(_())))))),______(_\
____(___(______(__(___(__(_()),__(___(__(_()),__(_()
))))),__(___(__(_()),__(_())))),__(___(__(_()),__(_(
))))),__(__(__(___(__(_()),__(__(_()))))))),__(___(\
__(__(__(___(_____(___(__(_()),__(___(__(_()),___(_\
_(_()),__(_()))))),__(__(__(___(__(_()),___(__(_()),
__(_()))))))),___(__(___(__(_()),__(_()))),__(_())))
))),__(___(__(_()),__(_())))))))),___(__(_()),___(__
(_()),__(_())))),(_____(___(__(_()),__(_())),__(_())
))),______(_____(___(__(___(_____(___(_____(___(__(_
()),___(__(_()),___(__(_()),__(_())))),__(__(__(___(
__(_()),__(___(__(_()),__(_())))))))),___(__(_()),__
(_()))),__(___(__(_()),__(_())))),___(__(_()),__(_()
)))),___(___(__(_()),__(_())),__(_()))),__(___(__(_\
__(__(_()),__(_()))),__(_())))),(_____(___(______(_\
____(___(__(___(__(___(__(___(__(_()),__(_()))),__(_
()))),__(_()))),___(___(__(_()),__(_())),__(_()))),\
__(___(__(_()),__(_())))),__(___(______(__(___(__(_(
)),__(_()))),______(__(___(__(_()),___(__(_()),__(_(
))))),__(___(__(___(__(_()),__(_()))),__(_()))))),__
(_())))),___(__(_()),__(_()))),(__(___(__(_()),___(\
__(_()),__(_())))))))),______(__(__(__(___(__(_()),\
__(___(__(_()),__(_()))))))),______(__(______(___(__
(_()),__(_())),______(__(___(__(_()),__(_()))),__(_\
__(__(_()),___(__(_()),___(__(_()),__(_())))))))),__
(___(__(___(______(__(___(__(___(__(___(__(___(__(_(
)),__(___(__(_()),__(_()))))),___(__(_()),__(_()))))
,__(_()))),__(_()))),__(______(___(__(_()),__(_())),
______(__(___(__(_()),__(_()))),______(__(___(___(__
(_()),__(_())),__(_()))),__(___(__(___(___(__(_()),\
__(_())),__(_()))),__(___(__(_()),__(_())))))))))),\
___(__(_()),__(_())))),__(_()))))),__(___(__(___(__(
___(___(__(_()),__(_())),__(_()))),___(___(__(_()),\
__(_())),__(_())))),__(___(___(__(_()),__(_())),__(_
())))))};printf("%s",____);return(______(_(),_()));}
| improve this answer | |
\$\endgroup\$
  • 1
    \$\begingroup\$ Yes, but the original problem statement stipulated that answers "...must meet at least two of the following [3] requirements." Mine does this. \$\endgroup\$ – pr1268 Jan 27 '17 at 18:18
  • 1
    \$\begingroup\$ @pr1286 Sorry, my bad, goes to show everyone is capable of misreading questions. Anyway the welcoming to the site still stands. \$\endgroup\$ – 0 ' Jan 27 '17 at 22:45
  • 2
    \$\begingroup\$ Oh my, CFuck? I didn't know such a thing existed. \$\endgroup\$ – Matthew Roh Mar 31 '17 at 8:05
2
\$\begingroup\$

Pyt, 161 bytes

é⎶⁻Đ²ř₊↔Áŕŕá↔ƖǰƇ5!Ś!!ɓąžƩ3*Ḟ533/Ɩ»/⎶Đąµ+ĐąҏҏžΠ-3Ḟ-Ƈ5³ĐðŚƩ-533/Ɩ»²+ƇĐ533/Ɩ»3*⁺ɓƇ84*Ƈ9²3!+Ƈ6⁺ɓƇ9⬠3-Ƈ533/Ɩ»Đ³⇹⁺!‼⁺⁺533/Ɩ»*⁰⁰533/Ɩ»/Ḷ⎶533/Ɩ»/533/Ɩ»³+⇹ŕƇ6Ć533/Ɩ»⁵-Ƈáǰ

Try it online!

I'd say just the language itself obfuscates it, but I tried to do this in as much of a roundabout way as possible

| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

17, 80 bytes

It isn't much bigger than the normal hello world for 17 due to it using base 17. I have to break rule 3 since the "main" function for 17 is 777, so all 17 programs must contain 7, so I am following the other 2.

777{44 $ 5g $ 66 : : $ $ 69 : $
22 4 - $ 52 $ $ 6c $ $ 5f $ 22 3 - $ a $ - @}
| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Welcome to PPCG! Nice first post! Is that your language as well? \$\endgroup\$ – Rɪᴋᴇʀ Feb 4 '18 at 18:33
  • \$\begingroup\$ Thanks, yes, I made 17, though not for this challenge \$\endgroup\$ – Hugh Williams Feb 4 '18 at 18:42
2
\$\begingroup\$

Python 3, 85 bytes

Not golfed, but obfuscated.

input(('%c'*11)%(9*8,93+8,99+9,9+99,3999//36,4*8,9*9+6,3996//36,4353//38,36*3,5*4*5))

Try it online!

| improve this answer | |
\$\endgroup\$
  • 1
    \$\begingroup\$ From a golfing standpoint, the fact that you're already using 11 to break rule 2 means that every code point except 72, 32, and 87 are valid (since 0 will also be allowed). From an obfuscation standpoint, I'm sure there are more creative and fun numbers you can use, like idk, 33**3//399-3 for 87, 3225%346 for 111, etc. \$\endgroup\$ – Value Ink Jun 7 '19 at 21:45
2
\$\begingroup\$

Ruby, 46 bytes

Aims to match all rules, unlike the other Ruby answers that only match 2. Based on @Nemo157's original answer and subsequent improvement suggestions, but uses succ twice to avoid breaking rule 1.

Note that the TIO link creates a string and compares it to a regex (proving that it matches all the rules) and then evals it, instead of just running the code directly. Running it directly will still work, of course.

$><<"Fcjjm Umpjb".gsub(/[a-z]/i){$&.succ.succ}

Try it online!

Ruby, 31 bytes

Same technique, but using tricks with tr to make it shorter than the other Ruby answers. (Unfortunately, tr causes it to break rule 2.)

puts"Fcjjm Umpjb".tr'A-x','C-z'

Try it online!

| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

Help, Wardoq!, 1 byte, Rules #2 and #3

l

This esolang has a 1-byte solution for most spellings of Hello, World.

| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

(K+R)eg, 16 bytes

1 byte shorter than the accepted solution (GolfScript).

Jgnnq\"Yqtnf(;;'

This encodes the string by adding all characters by 2.

| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

W d, 10 bytes

Glad that none of the characters appear in the compressed source.

,├▌♥♀√╫◙g5
| improve this answer | |
\$\endgroup\$

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