78
\$\begingroup\$

Dilbert is awesome
source: Dilbert, September 8, 1992

I'm hoping to add a new twist on the classic "Hello World!" program.

Code a program that outputs Hello World! without:

  • String/Character literals
  • Numbers (any base)
  • Pre-built functions that return "Hello World!"
  • RegEx literals

With the exceptions of "O" and 0.

†"O" is capitalized, "o" is not acceptable.

\$\endgroup\$
  • 4
    \$\begingroup\$ One of [code-golf] and [code-challenge] please, not both. The point of these tags to to help people find questions with the rules they want to use. Essentially every question on this site should be a game of some kind or another. \$\endgroup\$ – dmckee Mar 11 '11 at 22:29
  • 4
    \$\begingroup\$ -1 We've already had Obfuscated Hello World, and I think this challenge is too similar. I'd have cast a "close as duplicate" vote, if I weren't a mod. \$\endgroup\$ – Chris Jester-Young Mar 11 '11 at 22:35
  • 2
    \$\begingroup\$ @zzzzBov: I don't think it's different enough to warrant another question in the "hello world" theme; a different theme would have been better. But, that's just my opinion. \$\endgroup\$ – Chris Jester-Young Mar 11 '11 at 23:39
  • 1
    \$\begingroup\$ I think this is a fine code golf - and better than the prior one. \$\endgroup\$ – MtnViewMark Mar 12 '11 at 6:58
  • 2
    \$\begingroup\$ Some people seem to assume that "O"* means they can have a string literal with any number of O’s, including zero. I don’t think that was the intention. Please clarify. \$\endgroup\$ – Timwi Mar 12 '11 at 21:12

100 Answers 100

1
\$\begingroup\$

C# (130 chars)

class 聇聤聫聫聮耟聖聮聱聫聣耠{static void Main(){foreach(var c in typeof(聇聤聫聫聮耟聖聮聱聫聣耠).Name)System.Console.Write((char)(c-short.MaxValue));}}

Even though this beats my 131 chars solution, posting this as a separate answer because it works very differently and the other one is more interesting. (And also because the other one is ASCII-only and thus only 131 bytes long.)

\$\endgroup\$
1
\$\begingroup\$

Python 2, 116

def Hello(n,m,j):print n.func_name,m.func_name+chr(j)
def World():pass
o=-~0;O=o+o;P=O<<O*O;Hello(Hello,World,P+o)

This is the best I can do so far. Hooray, func_name! (I may or may not try this in Befunge as well.)

(Oops, someone already did this better. Upvote that one instead.)

\$\endgroup\$
1
\$\begingroup\$

Python (99 bytes)

o=-~0
def World():0
def Hello():print Hello.__name__,World.__name__+chr(o+(o<<(o+o+o+o+o)))
Hello()

(similar to my bash version ).

EDIT: Cut another byte by optimising 0**0 to -~0 (== 1), thanks to @kasran for the tip!

\$\endgroup\$
  • 1
    \$\begingroup\$ -~0 is a shorter way to get 1 than 0**0. \$\endgroup\$ – Kasran Nov 23 '14 at 1:36
1
\$\begingroup\$

Ruby, 182 bytes

->{o=?O.ord;o/=o;t=o+o;"O00O000OO00O0OOO0OO00OO0OO00OO0OOOO0O00000O0O0OOOOO0OOOOOOO00O0OO0OO00OO00O000O0000O".tr(?O,o.to_s).chars.each_slice(t+t+t+o).map{|i|i.join.to_i(t).chr}.join}

Lambda function, returns desired value.

\$\endgroup\$
1
\$\begingroup\$

Dyalog APL, 115 bytes

Needs ⎕IO←0 which is default on many systems.

Inspiration.

Plain ASCII encoding using 0 for 0 and O for 1.

⎕UCS(⍴⍬⍬)⊥'0O'⍳'OOOOO0OOOOO00OOOOO0OOOOO000000O0O000O0OOO00O0O000OOOO0OO0OO00000O0OOO0000O00O0OO000O'⍴⍨≢¨⎕TS(⎕D,⍬⍬)

⎕UCS Convert Unicode code points to character

(⍴⍬⍬)⊥ base-2 decode of (⍴⍬⍬ is the length of a list of two empty lists, i.e. 2)

'0O'⍳ indices into 0O for each character in

'OOO...00O' the 7×12 character encoded string

⍴⍨ reshaped into a matrix of dimensions

≢¨ the tally of each of

⎕TS(⎕D,⍬⍬) the Time Stamp and the Digits appended with two empty lists

TryAPL online!

\$\endgroup\$
1
\$\begingroup\$

J, 134 124 bytes

Thanks to miles for a bugfix!

echo u:#.((+:+:>.^#a:),<.^+:*_)$'0O'i.'O00O000OO00O0OOO0OO00OO0OO00OO0OOOO0O00000O0O0OOOOO0OOOOOOO00O0OO0OO00OO00O000O0000O'

Try it online! This was much easier to write than the below.

Alternatively, no strings, 134 bytes:

echo u:(-:*:>.>:C),(>:*:<.C),A,A,B,(+:+:>.C),(+:*:<.^.A),(<.*:+:^.A),(B=:>:>:>:A),(+:>:>:>:-:A),A,(*:<.C=:%:A),>.*:>:^.A=:+:<.^+:+:#a:

Try it online! This. Was. A. Triumph Pain to write. I should really write a program to help me automate this...

\$\endgroup\$
  • \$\begingroup\$ I think _ counts as a number. Another way to get 1 is #a: \$\endgroup\$ – miles Jan 21 '17 at 2:40
  • \$\begingroup\$ @miles True. I'll make the change accordingly. \$\endgroup\$ – Conor O'Brien Jan 21 '17 at 2:58
1
\$\begingroup\$

PHP, 136 bytes

a different approach, inspired by Adám´s APL answer:

for(;$c=[O00O000,OO00O0O,$l=OO0OO00,$l,$o=OO0OOOO,O00000,O0O0OOO,$o,OOO00O0,$l,OO00O00,O0000O][+$i++];)echo chr(bindec(strtr($c,O,!0)));

loops through array of 0O encoded ASCII values to print corresponding characters. Run with -nr.

breakdown

for(;$c=[O00O000,OO00O0O,$l=OO0OO00,$l,$o=OO0OOOO,  // binary ascii codes,
    O00000,O0O0OOO,$o,OOO00O0,$l,OO00O00,O0000O]    // 1 replaced with O
    [+$i++];)           // loop through array
    echo                    // 4. print
        chr(                // 3. convert to character
        bindec(             // 2. convert to decimal
        strtr($c,O,!0)      // 1. replace capital O with 1  
    ));
\$\endgroup\$
1
\$\begingroup\$

JavaScript (ES5), 79 bytes

b=-~!0;for(c in{Hello:a="",World:b<<=b*b})a+=c+String.fromCharCode(b++);alert(a)

Explanation

Like the other JavaScript answers, this is just a code snippet that alerts the string'Hello World!'.

The first trick is creating an object with the key names Hello and World. These are not string literals, so it obeys the rules. It is not allowed to put the exclamation mark or the space in there, so we get those characters through the second trick.

The second trick is getting the characters through their ASCII value. Sadly, we have to use String.fromCharCode for that, which is really long. Luckily, the space (32) and exclamation mark (33) are right next to each other in the ASCII table, and the character code for the space is a nice power of 2, which is easily obtainable though bitshifting. Getting 32 using only zeroes is a little bit tricky: 32 equals 1 << 5, which is not very golfable, but it also equals 2 << 4 = 2 << 2 * 2. All these two's allow us to assign 2 to a variable, and use that (note that -~!0 equals 2).

The third trick is that we don't need the values in the object we loop over, and you can assign values to variables in the object declaration. This doesn't just save 2 semicolons, but also 2 dummy values, so 4 bytes in total.

JavaScript (ES6) (non-competing), 82 bytes

_=>eval('b=-~!0;for(c in{Hello:a="",World:b<<=b*b})a+=c+String.fromCharCode(b++)')

Explanation

This is a full function with the same body as the competing version, but we use a fat-arrow function with "the eval trick". eval returns the value of the last variable it assigned to, which is a in this case.

This is non-competing since ECMAScript 6 was released in 2015, more than 4 years after this challenge was made.

\$\endgroup\$
1
\$\begingroup\$

C, 177 bytes

enum{a,b,c=b+b,d=c*c,e=c*d,f=c*e,g=c*f,h=c*g,i=c*h};x[]={h+e,i-g+d+b,i-g+e+d,i-g+e+d,i-g+f-b,g,h+f+e-b,i-g+f-b,i-f+c,i-g+e+d,i-g+d,g+b,},j=a;main(){for(;j<f-d;putchar(x[j++]));}

Try it online

\$\endgroup\$
1
\$\begingroup\$

Lenguage, 12731474882444739483739382239546264946233453512894971245352595483589354073858968246926319892 bytes

It is 12731474882444739483739382239546264946233453512894971245352595483589354073858968246926319892 zeros. Or Os. Both of them if you want. Any character in fact. Thanks Lenguage.

Convert It Online! <-- Conversion from brainfuck Hello World!

Try It Online! <-- brainfuck Hello World! in action

\$\endgroup\$
1
\$\begingroup\$

Tcl, 62 bytes

proc Hello\ world! {} {puts {*}[info level 0]}
[Hello\ world!]

Try it online!

proc Hello\ World! is a function with name "Hello world"; [info level 0] gives the funtion name where I am presently now; [Hello\ world!] is a call to the "Hello world" function!

\$\endgroup\$
  • \$\begingroup\$ @Johannes Kuhn: I think my solution is farther from a literal than yours! \$\endgroup\$ – sergiol Apr 30 '18 at 0:20
1
\$\begingroup\$

Keg, 14 bytes

Hello World*

TIO

  • Keg does not have character literals, only instructions that push constants onto the stack, except for \, which pushes the character onto the stack.
  • This program does not use integers.
  • There are no built-functions that return the string in Keg.
  • Keg does not support regex.
\$\endgroup\$
0
\$\begingroup\$

Ruby 45 chars

p [:Hello,:World!].join :_20[-~0..~0].hex.chr
\$\endgroup\$
  • \$\begingroup\$ or :HelloWorld!.to_s.titleize in rails (26 chars) \$\endgroup\$ – Mikey Mar 20 '13 at 14:37
  • \$\begingroup\$ Since the rules are already being bent I'm pretty sure :"Hello World!" is technically a Symbol literal. \$\endgroup\$ – Kevin Cox Nov 22 '13 at 2:23
  • \$\begingroup\$ Never mind, added it as my own. \$\endgroup\$ – Kevin Cox Nov 22 '13 at 2:25
  • \$\begingroup\$ If that is allowed I should just use #| Hello World␤sub h{};say &h.WHY in Perl 6. \$\endgroup\$ – Brad Gilbert b2gills May 12 '16 at 19:28
0
\$\begingroup\$

Groovy, 117

def propertyMissing(p){p}
b="OOOOOOOO"
c={(char)it.size()}
a=b+b+b+b
println(Hello+c(a+b+"OOOO")+c(a)+World+c(a+"O"))

prints

Hello, World!
\$\endgroup\$
0
\$\begingroup\$

If we push the rules quite a bit.

Ruby, 20

puts :"Hello World!"

Technically :"Hello World!" is just the Symbol syntax.

\$\endgroup\$
  • 2
    \$\begingroup\$ Yeah... you are pushing the rules. \$\endgroup\$ – John Dvorak Nov 22 '13 at 14:13
0
\$\begingroup\$

Befunge 98 - 37

:0!g,:0!0!+:::**+`#@_0!+
Hello World!

The Hello World! is not a string literal. It is source code that would actually do something if you run it (I have no idea what it would do). This program works off the idea of a Befunge quine:

:            duplicate number on stack (note that if there is none, then pushes a 0)
0!           push 0 then not it, producing a 1
g            get the character at the location (:,1) (: = number determined by the previous :)
,            print that character
:            duplicate number on stack (same number as first duplicate)
0!0!+:::**+  push the number 10
`            compare the duplicated number with 10, if it is greater than it, push 1, else push 0.
#            jump over the next character, going to the _
_            move right if the number on the top of the stack is 0, otherwise, move left
@            end program
0!           push 0 then not it, producing a 1
+            add it to the counter (number on top of stack)

I'm working on a longer, more interesting version.

\$\endgroup\$
0
\$\begingroup\$

C#, 130 characters

A friend of mine came up with this solution, which is one character shorter than my own solution of 131 (but longer if you count bytes).

class 聇聤聫聫聮耟聖聮聱聫聣耠{static void Main(){foreach(var c in typeof(聇聤聫聫聮耟聖聮聱聫聣耠).Name)System.Console.Write((char)(c-short.MaxValue));}}

Readable:

class 聇聤聫聫聮耟聖聮聱聫聣耠
{
    static void Main()
    {
        foreach (var c in typeof(聇聤聫聫聮耟聖聮聱聫聣耠).Name)
            System.Console.Write((char)(c - short.MaxValue));
    }
}
\$\endgroup\$
  • \$\begingroup\$ I'm sorry, but counting by bytes is the standard here. \$\endgroup\$ – SuperJedi224 Oct 26 '16 at 15:04
  • \$\begingroup\$ @SuperJedi224: It is now. This answer is quite old. \$\endgroup\$ – Timwi Oct 29 '16 at 22:21
0
\$\begingroup\$

Rebol (23 chars)

print ['Hello 'World!]

NB. In Rebol these are word literals ('word) which are completely different to string literals ("string"):

>> type? 'Hello       
== word!

>> type? "Hello"
== string!

Alternative if you think using word literals is cheating!

print [quote Hello quote World!]
\$\endgroup\$
0
\$\begingroup\$

Forth (942)

I'm sure it's not the shortes forth solution... but it's binary! First 5 lines are driver.

: O0 0 ;
: OO 0 0 INVERT - ;
: 00 SWAP 2 * + ;
: OOOOOOOO EMIT ;
: O CR BYE ;

O0 OO 00 O0 00 O0 00 OO 00 O0 00 O0 00 O0 00  OOOOOOOO
O0 OO 00 OO 00 O0 00 O0 00 OO 00 O0 00 OO 00  OOOOOOOO
O0 OO 00 OO 00 O0 00 OO 00 OO 00 O0 00 O0 00  OOOOOOOO
O0 OO 00 OO 00 O0 00 OO 00 OO 00 O0 00 O0 00  OOOOOOOO
O0 OO 00 OO 00 O0 00 OO 00 OO 00 OO 00 OO 00  OOOOOOOO
O0 O0 00 OO 00 O0 00 O0 00 O0 00 O0 00 O0 00  OOOOOOOO
O0 OO 00 O0 00 OO 00 O0 00 OO 00 OO 00 OO 00  OOOOOOOO
O0 OO 00 OO 00 O0 00 OO 00 OO 00 OO 00 OO 00  OOOOOOOO
O0 OO 00 OO 00 OO 00 O0 00 O0 00 OO 00 O0 00  OOOOOOOO
O0 OO 00 OO 00 O0 00 OO 00 OO 00 O0 00 O0 00  OOOOOOOO
O0 OO 00 OO 00 O0 00 O0 00 OO 00 O0 00 O0 00  OOOOOOOO
O0 O0 00 OO 00 O0 00 O0 00 O0 00 O0 00 OO 00  OOOOOOOO

O

Edit #1: I'm stupid! I had to insert 2 noop instructions to make it look nearly like a real dump of /dev/zero...

: O0 0 ;
: OO 0 0 INVERT - ;
: 00 SWAP 2 * + ;
: OOOOOOOO EMIT ;
: 00000000 ;
: 0O ;
: O CR BYE ;

O0 OO 00 O0  00 O0 00 OO  00000000
00 O0 00 O0  00 O0 00 0O  OOOOOOOO
O0 OO 00 OO  00 O0 00 O0  00000000
00 OO 00 O0  00 OO 00 0O  OOOOOOOO
O0 OO 00 OO  00 O0 00 OO  00000000
00 OO 00 O0  00 O0 00 0O  OOOOOOOO
O0 OO 00 OO  00 O0 00 OO  00000000
00 OO 00 O0  00 O0 00 0O  OOOOOOOO
O0 OO 00 OO  00 O0 00 OO  00000000
00 OO 00 OO  00 OO 00 0O  OOOOOOOO
O0 O0 00 OO  00 O0 00 O0  00000000
00 O0 00 O0  00 O0 00 0O  OOOOOOOO
O0 OO 00 O0  00 OO 00 O0  00000000
00 OO 00 OO  00 OO 00 0O  OOOOOOOO
O0 OO 00 OO  00 O0 00 OO  00000000
00 OO 00 OO  00 OO 00 0O  OOOOOOOO
O0 OO 00 OO  00 OO 00 O0  00000000
00 O0 00 OO  00 O0 00 0O  OOOOOOOO
O0 OO 00 OO  00 O0 00 OO  00000000
00 OO 00 O0  00 O0 00 0O  OOOOOOOO
O0 OO 00 OO  00 O0 00 O0  00000000
00 OO 00 O0  00 O0 00 0O  OOOOOOOO
O0 O0 00 OO  00 O0 00 O0  00000000
00 O0 00 O0  00 OO 00 0O  OOOOOOOO

O
\$\endgroup\$
  • \$\begingroup\$ You used a literal 2 in : 00 SWAP 2 * + ;, which is forbidden. \$\endgroup\$ – mbomb007 Nov 20 '15 at 18:20
  • \$\begingroup\$ Look at the other solutions. That's driver. \$\endgroup\$ – max.haredoom Jan 21 '16 at 20:24
  • \$\begingroup\$ It's still part of your source code? Also, I looked through every solution rated +1 or more, and there are none that contain any number other than 0, like the rules state, with the exception of one answer using it to specific a version of the language, which may or may not be allowed. What you're doing is not allowed. \$\endgroup\$ – mbomb007 Jan 22 '16 at 3:17
  • \$\begingroup\$ You are free to ignore my solution. \$\endgroup\$ – max.haredoom Jan 25 '16 at 23:28
  • \$\begingroup\$ Also, SWAP 2 * +, could be written as OVER + +. \$\endgroup\$ – mbomb007 Jan 26 '16 at 14:27
0
\$\begingroup\$

Python:

print str().join([chr((~0*(~0+~0))**(~0*(~0+~0+~0))*(~0*(~0+~0+~0))**(~0*(~0+~(0)))),
                  chr((~0*(~0+~0))**(~0*(~0+~0))*(~0*(~0+~0+~0+~0+~0))**(~0*(~0+~0))+~0*~0),
                  chr((~0*(~0+~0))**(~0*(~0+~0))*(~0*(~0+~0+~0)**(~0*(~0+~0+~0)))),
                  chr((~0*(~0+~0))**(~0*(~0+~0))*(~0*(~0+~0+~0)**(~0*(~0+~0+~0)))),
                  chr((~0*(~0+~0))**(~0*(~0+~0+~0+~0))*~0*(~0+~0+~0+~0+~0+~0+~0)+~0),
                  chr((~0*(~0+~0))**(~0*(~0+~0+~0+~0+~0))),
                  chr((~0*(~0+~0))**(~0*(~0+~0+~0))*(~0*(~0+~0+~0))*(~0*(~0+~0+~0+~0+~0))+~0),
                  chr((~0*(~0+~0))**(~0*(~0+~0+~0+~0))*~0*(~0+~0+~0+~0+~0+~0+~0)+~0),
                  chr((~0*(~0+~0))**(~0*(~0+~0))*(~0*(~0+~0+~0+~0+~0))**(~0*(~0+~0))+(~0*(~0+~0))**((~0+~0)*(~0+~0))+~0+~0),
                  chr((~0*(~0+~0))**(~0*(~0+~0))*(~0*(~0+~0+~0)**(~0*(~0+~0+~0)))),
                  chr((~0*(~0+~0))**(~0*(~0+~0))*(~0*(~0+~0+~0+~0+~0))**(~0*(~0+~0))),
                  chr((~0*(~0+~0))**(~0*(~0+~0+~0+~0+~0))+~0*~0)
                  ])
\$\endgroup\$
0
\$\begingroup\$

Java @230 : Twisting the rules with Enumerator behavior

enum A{Hello,B,C,D,E,F,World;public static void main(String[]z){p(Hello);int b=(B.ordinal()),c=(b<<F.ordinal());p((char)(c|b<<D.ordinal()|b<<(b<<b)));p((char)c++);p(World);p((char)c);}static void p(Object o){System.out.print(o);}}

took me a while to figure the logic out, enums printed act like literals and cn donate numbers at the same time :P

\$\endgroup\$
0
\$\begingroup\$

VBScript: 279

o = Asc("O")
n = 0 ^ 0
w = Round(Cos(o) / Sin(o), 0)
r = Cos(0) + Sgn(o) + Exp(0)
u = Fix(Log(o))
v = Left(o, o ^ 0)
e = Int(Sqr(o))

MsgBox Join(Array( _
    Chr(v & w), _
    Chr(n & 0 & n), _
    Chr(n & 0 & e), _
    Chr(n & 0 & e), _
    LCase("O"), _
    Chr(u & u), _
    Chr(r & w), _
    Chr(e & v), _
    Chr(n & n & n), _
    Chr(n & n & u), _
    Chr(n & 0 & e), _
    Chr(n & 0 & 0), _
    Chr(r & r) _
), String(0, "O"))

Strategy

  1. Generate the numbers 1,2,3,4,7, and 8 from "O" and 0 and common functions

  2. Concatenate the numbers together as strings to form ascii values

  3. Put ascii values in an array

  4. Join the array into a string using an empty string (repeat "o" 0 times) as the delimiter

  5. Display!

This golfs down to (a very beatable) 279 by removing underscores, linebreaks, and all spaces except for one to seperate 'msgbox' and 'join' and more to keep &0s from behaving like hex literals

o=Asc("O"):n=0^0:w=Round(Cos(o)/Sin(o),0):r=Cos(0)+Sgn(o)+Exp(0):u=Fix(Log(o)):v=Left(o,o^0):e=Int(Sqr(o)):MsgBox Join(Array(Chr(v&w),Chr(n& 0&n),Chr(n& 0&e),Chr(n& 0&e),LCase("O"),Chr(u&u),Chr(r&w),Chr(e&v),Chr(n&n&n),Chr(n&n&u),Chr(n& 0&e),Chr(n& 0& 0),Chr(r&r)),String(0,"O"))
\$\endgroup\$
0
\$\begingroup\$

Javascript - 129 chars

s=[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,];c=String.fromCharCode;alert(Object.keys({Hello:s,World:s}).join(c(s.length))+c(++s.length));
\$\endgroup\$
  • \$\begingroup\$ You can make your code shorter by replacing console.log with alert and by removing the space between : and null. Also, you forgot to add the exclamation mark at the end of the output. \$\endgroup\$ – ProgramFOX Aug 28 '14 at 14:34
  • \$\begingroup\$ Okay, I've corrected it. \$\endgroup\$ – vpzomtrrfrt Aug 28 '14 at 14:48
0
\$\begingroup\$

Befunge-98, 120

'O0!::+::+*-++:,0!::+::*:**\::++-++:,0!::+::+*--+:,+:,0!::++++:,'O%+:,\#@_0!\0!::++/0!:++:0\-0!+:0!:+/:0!:++:0!-::0!:++*

One long line of Befunge. Yikes.

This basically just prints "Hello ", loads in a list of offsets, and then runs the Hello-printing bit again with some offsets applied to turn "Hello " into "World!". It can probably be golfed down a bit further with the representations of numbers.

Edit - Removed two extraneous spaces that had snuck in.

\$\endgroup\$
0
\$\begingroup\$

Hieroglyphy With 0s, 6129

Golfed down from a generated expression in pure hieroglyphy (itself a variant of the infamous JSF***) which was 7999 bytes long.

Basically exploits the oddities of javascript's type system to generate the string using only the character set [](){}+!0.

[][(![]+[])[!0+!0+!0]+([]+{})[+!0]+(!0+[])[+!0]+(!0+[])[0]][([]+{})[!0+!0+!0+!0+!0]+([]+{})[+!0]+([][0]+[])[+!0]+(![]+[])[!0+!0+!0]+(!0+[])[0]+(!0+[])[+!0]+([][0]+[])[0]+([]+{})[!0+!0+!0+!0+!0]+(!0+[])[0]+([]+{})[+!0]+(!0+[])[+!0]]((!0+[])[+!0]+([][0]+[])[!0+!0+!0]+(!0+[])[0]+([][0]+[])[0]+(!0+[])[+!0]+([][0]+[])[+!0]+([]+{})[!0+!0+!0+!0+!0+!0+!0]+([][0]+[])[0]+([][0]+[])[+!0]+([][0]+[])[!0+!0+!0]+(![]+[])[!0+!0+!0]+([]+{})[!0+!0+!0+!0+!0]+(+{}+[])[+!0]+([]+[][(![]+[])[!0+!0+!0]+([]+{})[+!0]+(!0+[])[+!0]+(!0+[])[0]][([]+{})[!0+!0+!0+!0+!0]+([]+{})[+!0]+([][0]+[])[+!0]+(![]+[])[!0+!0+!0]+(!0+[])[0]+(!0+[])[+!0]+([][0]+[])[0]+([]+{})[!0+!0+!0+!0+!0]+(!0+[])[0]+([]+{})[+!0]+(!0+[])[+!0]]((!0+[])[+!0]+([][0]+[])[!0+!0+!0]+(!0+[])[0]+([][0]+[])[0]+(!0+[])[+!0]+([][0]+[])[+!0]+([]+{})[!0+!0+!0+!0+!0+!0+!0]+(![]+[])[!0+!0]+([]+{})[+!0]+([]+{})[!0+!0+!0+!0+!0]+(+{}+[])[+!0]+(!0+[])[0]+([][0]+[])[!0+!0+!0+!0+!0]+([]+{})[+!0]+([][0]+[])[+!0])())[!0+!0+!0]+([][0]+[])[!0+!0+!0])()([][(![]+[])[!0+!0+!0]+([]+{})[+!0]+(!0+[])[+!0]+(!0+[])[0]][([]+{})[!0+!0+!0+!0+!0]+([]+{})[+!0]+([][0]+[])[+!0]+(![]+[])[!0+!0+!0]+(!0+[])[0]+(!0+[])[+!0]+([][0]+[])[0]+([]+{})[!0+!0+!0+!0+!0]+(!0+[])[0]+([]+{})[+!0]+(!0+[])[+!0]]((!0+[])[+!0]+([][0]+[])[!0+!0+!0]+(!0+[])[0]+([][0]+[])[0]+(!0+[])[+!0]+([][0]+[])[+!0]+([]+{})[!0+!0+!0+!0+!0+!0+!0]+([][0]+[])[!0+!0+!0]+(![]+[])[!0+!0+!0]+([]+{})[!0+!0+!0+!0+!0]+(+{}+[])[+!0]+([]+[][(![]+[])[!0+!0+!0]+([]+{})[+!0]+(!0+[])[+!0]+(!0+[])[0]][([]+{})[!0+!0+!0+!0+!0]+([]+{})[+!0]+([][0]+[])[+!0]+(![]+[])[!0+!0+!0]+(!0+[])[0]+(!0+[])[+!0]+([][0]+[])[0]+([]+{})[!0+!0+!0+!0+!0]+(!0+[])[0]+([]+{})[+!0]+(!0+[])[+!0]]((!0+[])[+!0]+([][0]+[])[!0+!0+!0]+(!0+[])[0]+([][0]+[])[0]+(!0+[])[+!0]+([][0]+[])[+!0]+([]+{})[!0+!0+!0+!0+!0+!0+!0]+(![]+[])[!0+!0]+([]+{})[+!0]+([]+{})[!0+!0+!0+!0+!0]+(+{}+[])[+!0]+(!0+[])[0]+([][0]+[])[!0+!0+!0+!0+!0]+([]+{})[+!0]+([][0]+[])[+!0])())[!0+!0+!0]+([][0]+[])[!0+!0+!0])()(([]+{})[0])[0]+(!0+!0+!0+!0+[])+(!0+!0+!0+!0+!0+!0+!0+!0+[]))+([][0]+[])[!0+!0+!0]+(![]+[])[!0+!0]+(![]+[])[!0+!0]+([]+{})[+!0]+([]+{})[!0+!0+!0+!0+!0+!0+!0]+[][(![]+[])[!0+!0+!0]+([]+{})[+!0]+(!0+[])[+!0]+(!0+[])[0]][([]+{})[!0+!0+!0+!0+!0]+([]+{})[+!0]+([][0]+[])[+!0]+(![]+[])[!0+!0+!0]+(!0+[])[0]+(!0+[])[+!0]+([][0]+[])[0]+([]+{})[!0+!0+!0+!0+!0]+(!0+[])[0]+([]+{})[+!0]+(!0+[])[+!0]]((!0+[])[+!0]+([][0]+[])[!0+!0+!0]+(!0+[])[0]+([][0]+[])[0]+(!0+[])[+!0]+([][0]+[])[+!0]+([]+{})[!0+!0+!0+!0+!0+!0+!0]+([][0]+[])[0]+([][0]+[])[+!0]+([][0]+[])[!0+!0+!0]+(![]+[])[!0+!0+!0]+([]+{})[!0+!0+!0+!0+!0]+(+{}+[])[+!0]+([]+[][(![]+[])[!0+!0+!0]+([]+{})[+!0]+(!0+[])[+!0]+(!0+[])[0]][([]+{})[!0+!0+!0+!0+!0]+([]+{})[+!0]+([][0]+[])[+!0]+(![]+[])[!0+!0+!0]+(!0+[])[0]+(!0+[])[+!0]+([][0]+[])[0]+([]+{})[!0+!0+!0+!0+!0]+(!0+[])[0]+([]+{})[+!0]+(!0+[])[+!0]]((!0+[])[+!0]+([][0]+[])[!0+!0+!0]+(!0+[])[0]+([][0]+[])[0]+(!0+[])[+!0]+([][0]+[])[+!0]+([]+{})[!0+!0+!0+!0+!0+!0+!0]+(![]+[])[!0+!0]+([]+{})[+!0]+([]+{})[!0+!0+!0+!0+!0]+(+{}+[])[+!0]+(!0+[])[0]+([][0]+[])[!0+!0+!0+!0+!0]+([]+{})[+!0]+([][0]+[])[+!0])())[!0+!0+!0]+([][0]+[])[!0+!0+!0])()([][(![]+[])[!0+!0+!0]+([]+{})[+!0]+(!0+[])[+!0]+(!0+[])[0]][([]+{})[!0+!0+!0+!0+!0]+([]+{})[+!0]+([][0]+[])[+!0]+(![]+[])[!0+!0+!0]+(!0+[])[0]+(!0+[])[+!0]+([][0]+[])[0]+([]+{})[!0+!0+!0+!0+!0]+(!0+[])[0]+([]+{})[+!0]+(!0+[])[+!0]]((!0+[])[+!0]+([][0]+[])[!0+!0+!0]+(!0+[])[0]+([][0]+[])[0]+(!0+[])[+!0]+([][0]+[])[+!0]+([]+{})[!0+!0+!0+!0+!0+!0+!0]+([][0]+[])[!0+!0+!0]+(![]+[])[!0+!0+!0]+([]+{})[!0+!0+!0+!0+!0]+(+{}+[])[+!0]+([]+[][(![]+[])[!0+!0+!0]+([]+{})[+!0]+(!0+[])[+!0]+(!0+[])[0]][([]+{})[!0+!0+!0+!0+!0]+([]+{})[+!0]+([][0]+[])[+!0]+(![]+[])[!0+!0+!0]+(!0+[])[0]+(!0+[])[+!0]+([][0]+[])[0]+([]+{})[!0+!0+!0+!0+!0]+(!0+[])[0]+([]+{})[+!0]+(!0+[])[+!0]]((!0+[])[+!0]+([][0]+[])[!0+!0+!0]+(!0+[])[0]+([][0]+[])[0]+(!0+[])[+!0]+([][0]+[])[+!0]+([]+{})[!0+!0+!0+!0+!0+!0+!0]+(![]+[])[!0+!0]+([]+{})[+!0]+([]+{})[!0+!0+!0+!0+!0]+(+{}+[])[+!0]+(!0+[])[0]+([][0]+[])[!0+!0+!0+!0+!0]+([]+{})[+!0]+([][0]+[])[+!0])())[!0+!0+!0]+([][0]+[])[!0+!0+!0])()(([]+{})[0])[0]+(!0+!0+!0+!0+!0+[])+(!0+!0+!0+!0+!0+!0+!0+[]))+([]+{})[+!0]+(!0+[])[+!0]+(![]+[])[!0+!0]+([][0]+[])[!0+!0]+[][(![]+[])[!0+!0+!0]+([]+{})[+!0]+(!0+[])[+!0]+(!0+[])[0]][([]+{})[!0+!0+!0+!0+!0]+([]+{})[+!0]+([][0]+[])[+!0]+(![]+[])[!0+!0+!0]+(!0+[])[0]+(!0+[])[+!0]+([][0]+[])[0]+([]+{})[!0+!0+!0+!0+!0]+(!0+[])[0]+([]+{})[+!0]+(!0+[])[+!0]]((!0+[])[+!0]+([][0]+[])[!0+!0+!0]+(!0+[])[0]+([][0]+[])[0]+(!0+[])[+!0]+([][0]+[])[+!0]+([]+{})[!0+!0+!0+!0+!0+!0+!0]+([][0]+[])[0]+([][0]+[])[+!0]+([][0]+[])[!0+!0+!0]+(![]+[])[!0+!0+!0]+([]+{})[!0+!0+!0+!0+!0]+(+{}+[])[+!0]+([]+[][(![]+[])[!0+!0+!0]+([]+{})[+!0]+(!0+[])[+!0]+(!0+[])[0]][([]+{})[!0+!0+!0+!0+!0]+([]+{})[+!0]+([][0]+[])[+!0]+(![]+[])[!0+!0+!0]+(!0+[])[0]+(!0+[])[+!0]+([][0]+[])[0]+([]+{})[!0+!0+!0+!0+!0]+(!0+[])[0]+([]+{})[+!0]+(!0+[])[+!0]]((!0+[])[+!0]+([][0]+[])[!0+!0+!0]+(!0+[])[0]+([][0]+[])[0]+(!0+[])[+!0]+([][0]+[])[+!0]+([]+{})[!0+!0+!0+!0+!0+!0+!0]+(![]+[])[!0+!0]+([]+{})[+!0]+([]+{})[!0+!0+!0+!0+!0]+(+{}+[])[+!0]+(!0+[])[0]+([][0]+[])[!0+!0+!0+!0+!0]+([]+{})[+!0]+([][0]+[])[+!0])())[!0+!0+!0]+([][0]+[])[!0+!0+!0])()([][(![]+[])[!0+!0+!0]+([]+{})[+!0]+(!0+[])[+!0]+(!0+[])[0]][([]+{})[!0+!0+!0+!0+!0]+([]+{})[+!0]+([][0]+[])[+!0]+(![]+[])[!0+!0+!0]+(!0+[])[0]+(!0+[])[+!0]+([][0]+[])[0]+([]+{})[!0+!0+!0+!0+!0]+(!0+[])[0]+([]+{})[+!0]+(!0+[])[+!0]]((!0+[])[+!0]+([][0]+[])[!0+!0+!0]+(!0+[])[0]+([][0]+[])[0]+(!0+[])[+!0]+([][0]+[])[+!0]+([]+{})[!0+!0+!0+!0+!0+!0+!0]+([][0]+[])[!0+!0+!0]+(![]+[])[!0+!0+!0]+([]+{})[!0+!0+!0+!0+!0]+(+{}+[])[+!0]+([]+[][(![]+[])[!0+!0+!0]+([]+{})[+!0]+(!0+[])[+!0]+(!0+[])[0]][([]+{})[!0+!0+!0+!0+!0]+([]+{})[+!0]+([][0]+[])[+!0]+(![]+[])[!0+!0+!0]+(!0+[])[0]+(!0+[])[+!0]+([][0]+[])[0]+([]+{})[!0+!0+!0+!0+!0]+(!0+[])[0]+([]+{})[+!0]+(!0+[])[+!0]]((!0+[])[+!0]+([][0]+[])[!0+!0+!0]+(!0+[])[0]+([][0]+[])[0]+(!0+[])[+!0]+([][0]+[])[+!0]+([]+{})[!0+!0+!0+!0+!0+!0+!0]+(![]+[])[!0+!0]+([]+{})[+!0]+([]+{})[!0+!0+!0+!0+!0]+(+{}+[])[+!0]+(!0+[])[0]+([][0]+[])[!0+!0+!0+!0+!0]+([]+{})[+!0]+([][0]+[])[+!0])())[!0+!0+!0]+([][0]+[])[!0+!0+!0])()(([]+{})[0])[0]+(!0+!0+[])+(+!0+[]))

Because this "language" is a subset of javascript, you can run this right from your browser console. It returns the string "Hello World!".

\$\endgroup\$
0
\$\begingroup\$

Burlesque, 28 bytes

blsq ) {Hello,}m]\[{world!}m]\[ClwD
Hello, world!

Explanation:

{Hello,} is actually a Block containing the commands He, ll and o,. The reason we can't use {Hello, world!} is because the parser skips whitespaces obviously. m] converts commands to strings and \[ concatenates them. With wD (which is unwords) we insert missing space.

For what it's worth a few notes about how Burlesque parses commands. Pretty much everything that does not start with a digit will be parsed as a command with the exception of the minus sign which tries to parse a double first, if that fails it tries to parse it as an integer and if that fails it tries to parse it as a command. For example a{b} contains NO block. That's the command a{ followed by the command b}. {ab} is a block that contains the command ab. {-}-}} is a block containing the command -} twice. a2.0 is the command a2 followed by the command .0. (That 2.0 is NOT a double in there).

\$\endgroup\$
0
\$\begingroup\$

Hassium, 264 Bytes

Well this was interesting.

use Math;func main(){a=Math.pi;a/=a;b=a+a;t=Math.pow(b+b,b+a);o=t+Math.pow(b*b+b,b);d(t+(b*b*b));d(o+a);c=o+(b*b*b)d(c)d(c)d(c+b+a)d(Math.pow(b*b,b)*2)d(o-((b*(b*b)+(b*b+a))))d(c+b+a)d((c+b+a)+(b+a))d(c)d(o)d(Math.pow(b*b,b)*b+a);}func d(m)print(Convert.toChar(m))

Run online and see expanded here

\$\endgroup\$
0
\$\begingroup\$

Prolog, 198 bytes

p:-atom_codes('O0',[O,N]),A is O-N,B is O/O,C is A-B-B,D is B+B+B,G is O+C,H is G+D,I is H+D,K is A+B,L is K+B,M is C*D,J is L*D+B,F is J+B,E is F-C,atom_codes(X,[E,F,G,G,H,K,M,H,I,G,J,L]),write(X).

Explanation

p:-atom_codes('O0',[O,N]),                      % O=79, N=48
   A is O-N,                                    % A=79-48=31
   B is O/O,                                    % B=79/79=1
   C is A-B-B,                                  % C=31-1-1=29
   D is B+B+B,                                  % D=1+1+1=3
   G is O+C,                                    % G=79+29=108
   H is G+D,                                    % H=108+3=111
   I is H+D,                                    % I=111+3=114
   K is A+B,                                    % K=31+1=32
   L is K+B,                                    % L=32+1=33
   M is C*D,                                    % M=29*3=87
   J is L*D+B,                                  % J=33*3+1=100
   F is J+B,                                    % F=100+1=101
   E is F-C,                                    % E=101-29=72
   atom_codes(X,[E,F,G,G,H,K,M,H,I,G,J,L]),     % X='Hello World!'
   write(X).
\$\endgroup\$
0
\$\begingroup\$

Emacs Lisp, 281 bytes

(defalias'O'string-to-char)
(setq O(1+(O"O"))O0(-(1+ O)(O"O"))OO(* O0 O0 O0 O0 O0 O0)O1(+ O(- O OO))OOO(+ O1 (* O0 O0 O0) O0 O0)OO1(1+ (+ OOO O0)))
(princ(string(-O(* O0 O0 O0))(1+(+ O1 O0 O0))OOO OOO OO1 (/ OO O0)(1+ (+ O O0 O0 O0))OO1(1+ (+ OO1 O0))OOO(+ O1 O0 O0)(1+(/ OO O0))))

1+ is not a number, but a function, that returns 1 + NUMBER with NUMBER as its argument.

Ungolfed:

(defalias'O'string-to-char)
(setq O (1+ (O"O"))                 ; 80 => "P"
      O0 (-(1+ O)(O"O"))            ; 2
      OO (* O0 O0 O0 O0 O0 O0)      ; 64
      O1 (+ O(- O OO))              ; 96
      OOO (+ O1 (* O0 O0 O0) O0 O0) ; 108 => "l"
      OO1 (1+ (+ OOO O0)))          ; 111 => "o"
(princ
 (string
  (- O (* O0 O0 O0))   ; "H"
  (1+(+ O1 O0 O0))     ; "e"
  OOO                  ; "l"
  OOO                  ; "l"
  OO1                  ; "o"
  (/ OO O0)            ; " "
  (1+ (+ O O0 O0 O0))  ; "W"
  OO1                  ; "o"
  (1+ (+ OO1 O0))      ; "r"
  OOO                  ; "l"
  (+ O1 O0 O0)         ; "d"
  (1+ (/ OO O0))))     ; "!"
\$\endgroup\$
0
\$\begingroup\$

Clojure, 19 bytes

Since I am not allowed to comment (yet) both of atrociously long Clojure answers, here is mine:

(pr 'Hello 'World!)

3 bytes shorter than print

\$\endgroup\$
  • \$\begingroup\$ 'something is a symbol, not string literal. Symbols evaluate to their names, which are string literals \$\endgroup\$ – Michael M Sep 30 '16 at 6:19
  • \$\begingroup\$ don't symbols have all caps? \$\endgroup\$ – Destructible Lemon Oct 26 '16 at 5:13

protected by a spaghetto Dec 30 '15 at 0:41

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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