Alphanumeric Hello World

44

12

Your goal is to write "Hello, World!" (minus the quotes). This is a , so most up votes wins. Code length will be used to break ties.
Anything goes, as long as it is within the following rules:

  • All characters must be either letters or numbers, so you may only use characters in the string "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".
  • All code you use must be in one file, with the exception of imported modules/classes/whatever they're called in your favourite language.
  • Only the standard libraries/frameworks for your language of choice are allowed (for example, Python's Math module is allowed, but Numpy, Scipy, and Pygame are not). I will allow TkInter as it is the de facto standard for GUIs in Python.
  • No input is permitted, be it reading from stdin, reading a file, displying an image, or reading from the web.

+10 brownie points if you figure out how to do it in Java without bending the rules.


On your marks, get set, code!

EDIT: braces ({}), brackets ([]), and parentheses (()) are allowed as this would be pretty much impossible for most languages without them. I'm also removing the character limit rule. Hopefully this will make it more interesting.

EDIT^2: white space is also allowed. My brain isn't working properly, sorry. >.<

wec

Posted 2014-03-05T13:57:07.643

Reputation: 661

Question was closed 2016-05-15T20:07:55.603

tcl: Possible if % is allowed: puts Hello[format %c 44][format %c 32]World[format %c 33] – sergiol – 2017-01-04T22:04:02.180

Would the downvoter care to explain his/her vote? I'dlike to know how I could make this better. – wec – 2014-03-05T13:59:32.257

Didn't DV, but what do you mean when you say "all characters must be..." Most languages use other characters for even the most basic tasks: (){}[]/-+., etc. Are those banned? – Geobits – 2014-03-05T14:00:53.980

Yes, they are. Should I widen the allowed characters a bit to include (), [], and {}? – wec – 2014-03-05T14:03:15.640

1Up to you, I'm just making sure. What about whitespace? – Geobits – 2014-03-05T14:04:10.573

Ok, I think I'll widen the character number restriction, because as it is this is basically a duplicate of [Hello world! With limited character repetition] (http://codegolf.stackexchange.com/questions/18721/hello-world-with-limited-character-repetition?rq=1). Does 5 sound like a petter number?

– wec – 2014-03-05T14:09:54.917

1Oh, right white space. My brain is clearly not functioning properly today. That should be allowed. One second, let me fix the rules. – wec – 2014-03-05T14:15:54.160

What about these: ;?:&<>/+-,. ? – Ismael Miguel – 2014-03-05T14:17:37.777

8So, no operators? And, most importantly, no ;? How can I write anything in C? – Oberon – 2014-03-05T14:22:05.077

1esolangs.org Hello, World! – Geobits – 2014-03-05T22:41:46.037

3+1 for figuring out how to exclude J in a natural way: 72 101 108 108 111 44 32 87 111 114 108 100 33{a. requires the period at the end to work, and a path through u: similarly requires a colon. Without . and : we are nothing. – algorithmshark – 2014-03-05T23:32:48.673

1"I will allow as it is the de facto standard for Python." Allow what? – Blorgbeard is out – 2014-03-06T06:10:26.967

Oops, I was talking about TkInter for Python GUIs. – wec – 2014-03-06T13:56:05.367

Damnit. I was thinking of Vim, but you still need to type the !, and the <> need to go around ESC. :/ – AlbeyAmakiir – 2014-03-10T00:10:52.463

No dots or commas? :( – nyuszika7h – 2014-03-10T16:39:05.547

1Java? Impossible. I've been thinking about this for about half an hour and I say there's no way to do it. – DankMemes – 2014-05-13T23:46:17.407

Answers

104

Perl

Some say perl is a language full of ascii noise and random symbols like $... That is not true :P

s zzHelloq worldmz and s zqzchr 44ze and s zmzchr 33ze and print

Let's break this up into subexpressions:

(s zzHelloq worldmz) and (s zqzchr 44ze) and (s zmzchr 33ze) and (print)
It should be obvious that it executes from left to right as long as every expression returns true. But what on earth is s zqzchr 44ze?

In perl, there is a group of "quote-like operators" which includes q(str), qw(li st), /regex/, s/from/to/ among other things. It turns out all of these operators can use almost any character as a delimeter, with a couple pecularities: opening parethesis has to be closed by a matching closing parenthesis, and if you wish to use a letter as a delimiter you have to put a space after the operator letter (to disambiguate it from a bareword).

In this case we see three uses of the s/// (regex substitution) operator:

s//Helloq worldm/
s/q/chr 44/e
s/m/chr 33/e
All delimited by the character z. The /e flag on the last two causes the substitution to be interpreted as code to be evaluated, rather literal text.

A fairly well-known fact about perl is that most operations default to operating on the $_ builtin variable unless otherwise specified. All these three substitutions and the print operate on $_ in this case, so first we put the words Hello world into the variable, then we fix the punctuation by using the numeric ascii values of the characters, then we print the contents of the variable.

mniip

Posted 2014-03-05T13:57:07.643

Reputation: 9 396

I read this as szarzabar 44 szsmchor33ze aaaand PRINT! – Joe – 2016-07-05T22:51:19.030

46+1 I don't know what the hell is going on here, but it works! – r3mainer – 2014-03-05T19:23:22.960

96@squeamishossifrage That could be the perl motto – mniip – 2014-03-05T19:54:27.023

6If you could, would you add a small explanation? – user12205 – 2014-03-05T22:21:03.513

@ace "If you could...." You are implying that he can't. Or that if he did, we wouldn't understand it. – Level River St – 2014-03-05T23:30:24.650

@steve verrill Sorry, I'm not so good at English. What I mean is that it is possible that he copied it from somewhere without understanding how it works, and if that is the case he wouldn't be able to explain it. – user12205 – 2014-03-05T23:34:16.737

@ace There's nothing wrong with your English. I was just taking your phrase too literally in order to make a joke. – Level River St – 2014-03-05T23:36:29.590

10I'm by no means an expert, but in perl a replacement is usually indicated by s/PATTERN/REPLACEMENT/FLAGS, but you can actually use most anything you want instead of the slashes. The code here uses "z" instead of slashes and turns (nothing) into "Helloq Worldm" then replaces "q" for chr 44 (using the \e flag to evaluate REPLACEMENT aka "chr 44" as an expression) which is ",". It then replaces "m" with chr 33, a "!", and prints it. – Amory – 2014-03-06T00:20:55.507

3@ace in a quote-like operator, e.g q//, any delimiter can be used, q!! q** q\\ q;;. A few exceptions are that to close ( you use ), q() q[] q{} q<>, and that to use an alphanumeric as a delimiter, it should be spaced from the operator to disallow ambiguity, eg q qq, q 66. The same tricks apply to other quote-like operators. – mniip – 2014-03-06T09:57:27.353

1+1 just for s. I actually muttered "s...space..." aloud to myself and chuckled. – Kyle Strand – 2014-03-06T21:44:24.590

Aah, Perl ! This is the weirdest answer I have seen on this site. – Nicolas Barbulesco – 2014-05-15T13:04:01.783

I think you should try and write a book using perl... – Beta Decay – 2014-08-20T13:13:54.257

73

C

int main(void) {
  if (putchar(72))
    if (putchar(101))
      if (putchar(putchar(108)))
        if (putchar(111))
          if (putchar(44))
            if (putchar(32))
              if (putchar(87))
                if (putchar(111))
                  if (putchar(114))
                    if (putchar(108))
                      if (putchar(100))
                        if (putchar(33)) 
                        {
                        }
}

mattnewport

Posted 2014-03-05T13:57:07.643

Reputation: 1 579

4Awesome! It CAN be done in C. And I thought I'd won this... – Level River St – 2014-03-05T21:42:05.660

You can do that with switch() as well - beat me to it. – Comintern – 2014-03-05T22:23:39.653

@Comintern switch() uses :, as in case 1: – user12205 – 2014-03-05T23:52:36.840

2@ace Only if you have cases defined. You can easily rewrite this as switch(putchar(72)){}switch(putchar(101)){}, etc. – Comintern – 2014-03-05T23:56:29.220

27+1 for putchar(putchar(108)) – Ilmari Karonen – 2014-03-06T07:54:19.787

2Just missing an "if(putchar(44))" for the comma. – Desty – 2014-03-06T13:07:59.907

1Well spotted, not sure how I missed the comma in the question. Fixed. – mattnewport – 2014-03-06T15:41:46.630

1@mattnewport WOW! I learned a new thing today! Thanks for your answer – Mukul Kumar – 2014-03-07T03:18:44.020

Can't you put if (putchar(33)); instead of if (putchar(33)) {}? – kirbyfan64sos – 2014-05-19T00:16:20.917

Not under the stated rules - () and {} are permitted characters but not ; – mattnewport – 2014-05-20T18:12:35.677

49

(edit - BBC basic moved to separate answer as suggested. Most of the votes on this are definitely for the LOGO answer.)

LOGO

Interpreter at http://www.calormen.com/jslogo/#

TO h        pd  fd 100 rt  90  pu  fd 50  rt 90  pd  fd 100  rt 180 fd 50  lt 90  fd 50  rt 90  pu END 
TO e        pu  fd 25  rt  90  pd  fd 25  rt 90  arc 270 25  lt 90  fd 25  lt 90  pu END  
TO l        pd  fd 100 pu  END  
TO o        rt  45 fd  35  pd  arc 360 25  lt  45  pu END 
TO comma    pd  rt 90  arc 90  15  lt  90  pu END 
TO w         l  rt 180 l   pd  lt  135 fd  35  rt  90  fd 35  lt 135  l  END  
TO r        pd  fd 25  rt  90  pu  fd  25  rt 180  arc 180 25 rt 90 END 
TO d         o  rt 135 fd  35  lt  135  l  END      
TO exclaim arc 360 5   fd  10  l  END 

clearscreen  
setpencolor 4 pu 
setxy 0 150      h 
setxy 100 150    e  
setxy 200 150    l 
setxy 250 150    l 
setxy 300 150    o 
setxy 350 150    comma  
setpencolor 1 
setxy 0 0        w 
setxy 100 0      o 
setxy 200 0      r  
setxy 300 0      l 
setxy 350 0      d 
setxy 450 0      exclaim 
fd 100

Output (the green triangle is the turtle cursor)

enter image description here

Level River St

Posted 2014-03-05T13:57:07.643

Reputation: 22 049

2You should split this answer into two. – Justin – 2014-03-05T19:11:17.280

@WallyWest I hardly know the language, but it was the tool for the job. You can print text too (it's called a label on your drawing) but you need a quotation mark for that (I think only the opening quote is required and the closing quote is optional.) – Level River St – 2014-03-06T01:01:43.580

1+1 for drawing it instead of printing words. – wec – 2014-03-07T17:58:58.597

@steveverril The second quote would be a syntax error, actually. – tomsmeding – 2014-05-21T15:01:39.923

30

Applescript

No brackets [], braces {} or parentheses () at all in this one:

set s to ASCII character 72
set s to s as list
set end of s to ASCII character 101
set end of s to ASCII character 108
set end of s to end of s
set end of s to ASCII character 111
set end of s to ASCII character 44
set end of s to space
set end of s to ASCII character 87
set end of s to item 5 of s
set end of s to ASCII character 114
set end of s to third item of s
set end of s to ASCII character 100
set end of s to ASCII character 33
display dialog s as text

Output is: enter image description here

Digital Trauma

Posted 2014-03-05T13:57:07.643

Reputation: 64 644

10Unbelievable! (Having to write the word "character" in full, I mean!) Now I understand what they mean about Apples being expensive. Only joking, +1 for something different :-) – Level River St – 2014-03-05T23:52:03.680

10AppleScript is ridiculously verbose, but the result is it really is one of the most comprehensible programming languages for a layperson. – Jonathan Van Matre – 2014-03-06T04:40:08.497

3@JonathanVanMatre Hard to write, easy to read – Digital Trauma – 2014-03-06T04:53:21.663

2even C is easier to read... – Display Name – 2014-03-10T11:41:22.577

@DigitalTrauma IDK. I have no idea what set s to s as list does. – Cruncher – 2014-05-12T17:53:04.130

@Cruncher Line 1 assigns the simple ascii char "H" to the scalar variable s. Then line 2 coerces that value to a list. Thus after line 2, s contains a list of one element whose value is "H". We can then append to that list in the subsequent lines. – Digital Trauma – 2014-05-12T17:56:29.223

1@Cruncher — This is easy. The command set s to s as list transforms "H" into {"H"} (a list). In other languages, like Java, it is usually way more complicated to do that. – Nicolas Barbulesco – 2014-05-15T13:22:36.647

1@NicolasBarbulesco Well strictly written it's impossible in Java. You can't change the type of a variable at runtime. However, I would prefer List<String> s = new ArrayList<String>(); s.add(oldS); ANY DAY. I know exactly what that does when I read it. It makes a list, and puts something in it. – Cruncher – 2014-05-15T13:28:47.173

@Cruncher — I was thinking, more generally, about set sl to s as list. In other languages, like Java, it is usually way more complicated to do that. – Nicolas Barbulesco – 2014-05-24T07:47:22.907

@Cruncher — But it is unnatural for humans. We humans first think about the subject and then, maybe, about the form. – Nicolas Barbulesco – 2014-05-24T07:58:24.337

25

Bash

This sort of works, if you squint your eyes:

echo NN i NN i i i iNN NNi i i i i i i NN i NN i i i i i i i NNi i i NN NN
echo NN i NNi i i i NN NN i i i i i i iNN i NN i i i i i i i NN i i iNN NN
echo NN i NN iNNNNi NN NN iNNNNi i i i NN i NN iNNNNi NN NN iNN iNNN NN NN
echo NNNNNNN NN iNN NN NN NN iNN i i i NN i NN NN iNN NNN iN NN NN iNNN N
echo NN i NN NNNNNN NN NN NNi NN i i i NN N NN NNi NN NN i i NN NNi iNN N
echo NN i NN NN i i NN NN NN iNN i i i NNN NNN NN iNN NN i i NN NN i NN
echo NN i NN iNNNi iNN NN iNNNNi N i i NN i NN iNNNNi NN i i NN iNNNN N NN
echo i i i i i i i i i i i i i i N

Digital Trauma

Posted 2014-03-05T13:57:07.643

Reputation: 64 644

1this works in windows bat/cmd file too – phuclv – 2014-03-10T05:45:20.643

banner Hello World or figlet Hello World – None – 2014-06-15T19:46:14.770

2@professorfish The tricky part of this challenge is getting the , and !. Otherwise, I'd just use plain old echo. – Digital Trauma – 2014-06-16T16:49:05.287

@DigitalTrauma oh, sorry, didn't see that... a bit slow – None – 2014-06-16T18:23:30.323

20

Python

So what, we just assume everybody reads horizontally? For those users who like to read vertically:

print chr(72) 
print chr(101)
print chr(108)
print chr(108)
print chr(111)
print chr(44)
print chr(32)
print chr(87)
print chr(111)
print chr(114)
print chr(108)
print chr(100)
print chr(33)

Geobits

Posted 2014-03-05T13:57:07.643

Reputation: 19 061

+1 and hahaha! This question had so many downvotes at the beginning, because people believed it was impossible. I don't know Python, but given all the moaning I couldn't believe it was THAT easy in such a common language. – Level River St – 2014-03-05T19:44:40.677

1I just wrote the exact same code before this answer was posted. I refreshed to post my answer and found this... – grovesNL – 2014-03-05T19:45:46.167

1@steveverrill The moaning wasn't for no reason. There's not a single answer here that would have passed the original rules (no braces/parens/brackets, no characters repeated more than once) – Geobits – 2014-03-05T19:47:00.173

1@grovesNL If it makes you feel better, this is the first thing I've ever used python for. I spent a while combing through docs, trying to figure out if there was any feasible way to concat them into one line before posting. – Geobits – 2014-03-05T19:48:58.837

@Geobits sys.stdout.write is the standard way to output text without newlines in most versions on Python (the behavior is slightly changed in 3.0). We can't do that here because of the periods. – grovesNL – 2014-03-05T20:05:42.477

@geobits Looks like I got here just in time for the relaxed rules. The only-alphanumeric I saw and knew I could work around. I missed the no-repeats rule. – Level River St – 2014-03-05T20:20:05.120

19

Polyglot: HQ9+, H9+, HQ9++, CHIQRSX9+, HQ9+B and HQ9+2D (1 byte)

H

Thank you @victor for the list of languages.

Ismael Miguel

Posted 2014-03-05T13:57:07.643

Reputation: 6 797

Necro: Don't forget http://esolangs.org/wiki/Help,_WarDoq%21

– RK. – 2015-09-17T21:32:48.177

@RK. I can't use that language since it was made after this challenge was published. – Ismael Miguel – 2015-09-17T22:16:12.063

Yeah, but just for the record :) – RK. – 2015-09-17T22:57:18.693

5This is a polyglot. It works too in H9+, HQ9++, CHIQRSX9+, HQ9+B and HQ9+2D. – Victor Stafusa – 2014-03-06T04:43:17.973

I'm pretty sure it also works in Hello. – wec – 2014-03-07T17:15:28.933

5It works in any language that you invent. – Zero Fiber – 2014-03-07T17:16:32.950

2I didn't invented anything... – Ismael Miguel – 2014-03-07T18:14:26.860

6

Unfortunately the output is "hello, world" (http://esolangs.org/wiki/HQ9%2B), or according to this interpreter "Hello world." (http://www.almnet.de/esolang/hq9plus.php) To get "Hello, world!" you might need to increment the accumulator a few times.

– tttppp – 2014-03-10T10:03:00.917

19

base64

SGVsbG8sIFdvcmxkIQ

Satisfies the original rules.

Kendall Frey

Posted 2014-03-05T13:57:07.643

Reputation: 2 384

1@ColeJohnson Strictly speaking, a language (mathematical/cs-theory term) is a set of finite strings formed using characters from a finite alphabet. Base 64 certainly satisfies this, as does base 10, etc. A programming language is something different. (I know this is a late response, but just for some clarification.) – apnorton – 2015-02-08T15:25:34.107

2Is base64 a language? And what's your output? Does it have the correct capitalization? – Level River St – 2014-03-05T14:55:26.870

23

Sure it's a language, it's just not Turing-complete. Also, http://base64decode.org

– Kendall Frey – 2014-03-05T14:56:49.960

1Haha. For that response, +1 your comment, but not your answer. Maybe your answer later if I feel like it. – Level River St – 2014-03-05T15:06:10.390

Alternatively you could evaluate the JavaScript expression atob("SGVsbG8sIFdvcmxkIQ"). – Neil – 2014-03-06T10:31:24.507

2@Neil you used " – mniip – 2014-03-06T10:51:46.550

1@mniip That was a suggestion to steve as to how to verify the output. – Neil – 2014-03-06T10:57:27.060

2@KendallFrey By that logic, base10 is a language: 1234567890. – Cole Johnson – 2014-03-07T00:19:14.353

@Cole — I don't get what you mean. – Nicolas Barbulesco – 2014-05-24T08:25:42.273

1@NicolasBarbulesco Base64 is just a way of encoding numbers. Each "digit" has the range 0-63, just as hexadecimal has the range 0-15 and decimal has the range 0-9. However, each "digit" needs its own representation so they each take up one character. Why? If I were to tell you 132 is base 16, how are you supposed to interpret that? {1,3,2} or {13,2}. To work around that, we use a for 11, b for 12, and so on. Base 64 works the same way. The "numbers" in base 64 just don't start with 0,1,2,.... – Cole Johnson – 2014-05-25T00:38:35.383

@NicolasBarbulesco My comment was directed towards Kendell Frey's (OP) comment where he says "Sure it's [base 64] a language...".

– Cole Johnson – 2014-05-25T00:39:56.983

19

COBOL

   ID DIVISION 
   DATA DIVISION 
   01  HELLOWORLDBINARY 
       05  HE                       COMP    PIC 9999 
       05  LL                       COMP    PIC 9999 
       05  OCOMMA                   COMP    PIC 9999 
       05  SPACEW                   COMP    PIC 9999 
       05  ORTEXT                   COMP    PIC 9999 
       05  LD                       COMP    PIC 9999 
       05  EXCLAMATION              COMP    PIC 9999 
   01  FILLER REDEFINES HELLOWORLDBINARY 
       05  HELLOWORLDTEXT                   PIC XXXXXXXXXXXXX
       05  FILLER                           PIC X 
   PROCEDURE DIVISION 
       MOVE 51333                   TO HE 
       MOVE 37779                   TO LL 
       MOVE 38507                   TO OCOMMA 
       MOVE 16614                   TO SPACEW 
       MOVE 38553                   TO ORTEXT 
       MOVE 37764                   TO LD 
       MOVE 23104                   TO EXCLAMATION 
       DISPLAY HELLOWORLDTEXT 
       GOBACK 

Required some changes to become truly alphanumeric source only.

PROGRAM-ID can be dropped. You get a generated program name (see messages).

WORKING-STORAGE can be dropped. Again the compiler moans.

Since both of these lines previously had missing full-stops/periods, which are no longer relevant now that the descriptions are entirely missing, the number of error messages is the same as before, and still does not affect the generated code for the program.

In changing COMP-5 to COMP, the VALUE clauses are no longer allowed, as COMP 9999 is only four decimal digits whereas COMP-5 is a two-byte binary with all bit-values available.

The values in the MOVEs are the decimal values which give the binary values which give the pairs of characters.

Even though the COMP fields have four digits, and do not allow VALUE clauses with more than four digits, you can use more digits in the MOVE of a literal value without truncation at that point... don't ask me why. Compiler option DIAGTRUNC (which I have turned off) will produce Warning diagnostics for these.

Compiler option TRUNC(BIN) could be used to treat COMP as COMP-5, but the MOVEs are another way to do it.

Since it is COBOL, the output must be in UPPER CASE (a lie, but just for fun).

HELLO WORLD!

OK, relented, now produces:

Hello, World!

Which, being an odd-number of characters, required some further changes, since we can't have odd-number-byte binary fields with this compiler. Look at that line of 13 Xs! It would normally be written as X(13), but can be as I've shown...

And ORTEXT is needed (or not OR, anyway) as a name because OR is a reserved word to the compiler (it means OR, of course).

These are EBCDIC values, not ASCII, since it is running on an EBCDIC-aware, and Big Endian, box.

Oh, COBOL requires lots of full-stops/periods. I left them out (they're banned) so got lots of compile messages. Just told the compiler to generate the code anyway (none of the messages relate to the object code).

Even without DIAGTRUNC, the messages are now up to 17...

  1  IGYDS1003-E   A "PROGRAM-ID" paragraph was not found. 
  Program-name "CBLNAM01" was assumed. 

  2  IGYDS1082-E   A period was required.  A period was assumed 
  before "DATA". 

  3  IGYDS1082-E   A period was required.  A period was assumed 
  before "01". 

                   Same message on line:     11 

  3  IGYDS1040-E   A data item was found in the "DATA DIVISION" 
                   before a section header was encountered. 
                   "WORKING-STORAGE SECTION" was assumed. 

  4  IGYDS1082-E   A period was required.  A period was assumed 
  before "05". 

                   Same message on line:      5      6      7      8
                   9     10     12     13 

 14  IGYDS1082-E   A period was required.  A period was assumed 
 before "PROCEDURE". 

 15  IGYPS2145-E   A period was required.  A period was assumed 
 before "MOVE". 

 23  IGYSC1082-E   A period was required.  A period was assumed 
 before "END OF PROGRAM". 

Bill Woodger

Posted 2014-03-05T13:57:07.643

Reputation: 1 391

1I don't think - is allowed – mniip – 2014-03-05T19:00:26.787

1Good point. Fixing. Habits. – Bill Woodger – 2014-03-05T19:06:13.143

@mniip Mmmm.... a little more tricky... I'll have to fix up the WORKING-STORAGE later. I have to leave now... – Bill Woodger – 2014-03-05T19:09:29.720

1I laughed at "Since it is COBOL, the output must be in UPPER CASE". Nice work! – Jonathan Van Matre – 2014-03-13T16:56:40.447

18

OMGROFL

I'm a big fan of esoteric languages. Luckily OMGROFL is alphanumeric:

lol iz 72
rofl lol
lol iz 101
rofl lol
lol iz 108
rofl lol
rofl lol
lool iz 111
rofl lool
loool iz 44
rofl loool
loool iz 32
rofl loool
loool iz 87
rofl loool
rofl lool
lool iz 114
rofl lool
rofl lol
lol iz 100
rofl lol
lol iz 33
rofl lol
stfu

The iz command sets a value to a variable, in this case lol, lool and loool serve as variables...

The rofl command echoes out the ASCII equivalent to the number stored in the variable.

The stfu command terminates the program ;)

WallyWest

Posted 2014-03-05T13:57:07.643

Reputation: 6 949

haha, nice! I wanted to attempt a LOLCODE version but the language requires using a colon and quotation marks to coerce ints to chars. – Jonathan Van Matre – 2014-03-06T04:41:24.030

16

Javascript

with (function SGVsbG8sIFdvcmxkIQ(){}) atob(name)

Use browser's console to test.

Fabricio

Posted 2014-03-05T13:57:07.643

Reputation: 1 605

15

Ruby (using only alnums and whitespace)

putc 72
putc 101
putc 108
putc 108
putc 111
putc 44
putc 32
putc 87
putc 111
putc 114
putc 108
putc 100
putc 33

Output: Hello, World!

histocrat

Posted 2014-03-05T13:57:07.643

Reputation: 20 600

14

JavaScript

with (String) with ([]) {
    push(fromCharCode(72))
    push(fromCharCode(101))
    push(fromCharCode(108))
    push(fromCharCode(108))
    push(fromCharCode(111))
    push(fromCharCode(44))
    push(fromCharCode(32))
    push(fromCharCode(87))
    push(fromCharCode(111))
    push(fromCharCode(114))
    push(fromCharCode(108))
    push(fromCharCode(100))
    push(fromCharCode(33))
    alert(join([]))
}

Neil

Posted 2014-03-05T13:57:07.643

Reputation: 95 035

1ARGH! I hit the same solution, but decided that since it was 2:00 am, I should go to bed and post it in the morning. Kudos to you! – DocMax – 2014-03-06T16:03:02.450

12

ferNANDo

h E R
e I S
h E
l L O
w O
r L
d U S
i N G
o N L
y L E
t T E
r S

H e L L o W O R
L d h E L l O w
O r l D h e L L
O w o R l d H E
L l o W o r l d
H E l L o w O R
L D h E L L O W
O r L d H e l l
O w o R l d h e
L l o w O R l D
H e l L o w O R
L d h E L l O W
O R l D H E L l
O w O
r L d

marinus

Posted 2014-03-05T13:57:07.643

Reputation: 30 224

Missing Comma and ! – VoronoiPotato – 2014-03-05T19:44:37.570

@VoronoiPotato: works fine over here – marinus – 2014-03-05T20:44:10.587

whoops sorry :X – VoronoiPotato – 2014-03-05T20:50:17.753

12

Rebol

Alphanumeric only solution:

prin quote Hello prin add space 12 prin space prin quote World print add space 1

Above is an update which uses Dr Rebmu excellent suggestion of add space 1 (which produces !) to get to all the characters.

Below is the original version:

prin quote Hello prin pick mold system 264 prin space prin quote World print pick mold system 12

Shorter version with brackets:

print rejoin [quote Hello pick mold system 264 space quote World pick mold system 12] 

And even shorter version with braces:

print join {Hello} join pick mold system 264 join { World} pick mold system 12

And shortest version with both brackets & braces:

print rejoin [{Hello} pick mold system 264 { World} pick mold system 12]

Rebol uses braces {} for multi-line quoting. So completely valid under rule changes but not quite in full spirit (IMHO) as my first two answers above.


NB. Printing the ! was a pain!

Rebol allows and uses punctuation characters routinely for function names and datatypes. So options like to-char 33 or to char! 33 would not be allowed under the rules (even though these punctuations are not operators par se).

Fortunately I found a cheeky way by turning the Rebol system object: make object! [...] into a string and cherry pick that ! from it :)

Update: And now also cherry picked comma from license text in system object.

draegtun

Posted 2014-03-05T13:57:07.643

Reputation: 1 592

1! is not allowed – grovesNL – 2014-03-05T20:19:36.530

2@grovesNL - Solution no longer uses - or ! so you may now remove the down vote – draegtun – 2014-03-05T21:12:26.140

1You are missing the comma – mniip – 2014-03-06T12:14:06.553

1@mniip - Thanks missed that! Have now fixed. – draegtun – 2014-03-06T12:32:55.920

1

Pretty tricky, but you could have just added to space to get the characters... ;-) See the Rebmu solution, which clocks in at 46 chars...

– HostileFork says dont trust SE – 2014-04-06T23:33:17.143

1@Dr.Rebmu - Nice one! That add could come in handy in other golfs. Have updated. – draegtun – 2014-04-07T08:29:06.340

12

C

Uses only alphanumeric characters, spaces and braces {}, brackets [] and parenthesis ().

main()
{
        if(printf((long long []){0x202c6f6c6c6548}))
                if(printf((long long []){0x21646c726f57})){}
}

printf( ) accepts a char * as an argument, but since we can't use quotes("), I typecast the string as a long long array. The values seen here are ASCII strings, in little endian (0x48=H, 0x65=e, 0x6c=l, and so on). I typecast it to long long [] since that way I can pass an 8-byte argument and hence use only two printf( ) calls instead of four.

pank4j

Posted 2014-03-05T13:57:07.643

Reputation: 221

It's not an int literal – note the {}s. – Ben Millwood – 2016-08-02T16:18:23.107

This breaks rule #1 – Timtech – 2014-03-07T21:31:15.423

1Chars, numbers, spaces and {} () [] are allowed. – pank4j – 2014-03-08T03:13:53.507

you can cast an int literal to array? I've never seen this before – phuclv – 2014-03-10T05:48:23.723

What does this do ? – Nicolas Barbulesco – 2014-05-24T08:54:28.513

@LưuVĩnhPhúc Array is a pointer. Pointer is an integer. – seequ – 2014-06-05T06:17:09.367

@TheRare yes but I've only seen casts such as (volatile int*)0x12345678 but not casts using [] like that – phuclv – 2014-06-05T06:35:59.353

@LưuVĩnhPhúc Afaik, the int[] is syntactic sugar for int*. – seequ – 2014-06-05T06:37:37.363

11

BBC BASIC

Emulator at bbcbasic.co.uk

Split from my LOGO answer.

The easy way

The numbers on the right are just ASCII codes. This is just the same as printing. If I was allowed a comma I could do it on a single line (VDU 72,101,108,etc.)

   10 VDU 72
   20 VDU 101
   30 VDU 108
   40 VDU 108
   50 VDU 111
   55 VDU 44
   60 VDU 32
   70 VDU 87
   80 VDU 111
   90 VDU 114
  100 VDU 108
  110 VDU 100
  120 VDU 33

A more creative way

    5 MODE 6
   10 READ B
   12 WHILE B
   15   PROC1(B)
   16   PRINT
   17   READ B
   18 ENDWHILE
   20 END

REM procedure prints first square on line, 
REM then calls itself recursively with A DIV 2 to print the next
REM VDU 17 tell VDU controller we want to change colour
REM Next line changes background colour. 
REM Then following line VDU 32 prints a space in that background colour.

  110 DEFPROC1(A)
  115 VDU 17
  120 IF A AND 1 THEN VDU VPOS DIV 6 EOR 133 ELSE VDU 128
  125 VDU 32
  130 IF A THEN PROC1(A DIV2)
  140 ENDPROC

REM binary bitmap data for each row, least significant at left
  150 DATA 463221
  160 DATA 332053
  170 DATA 332151
  180 DATA 332053
  190 DATA 2586485
  200 DATA 1048576
  210 DATA 4395895
  220 DATA 4527447
  230 DATA 4526935
  240 DATA 333143
  250 DATA 4420981
  260 DATA 0

enter image description here

Level River St

Posted 2014-03-05T13:57:07.643

Reputation: 22 049

11

Mathematica

Unprotect[Times]
ClearAll[Times]
Print[Hello FromCharacterCode[44] world FromCharacterCode[33]]

swish

Posted 2014-03-05T13:57:07.643

Reputation: 7 484

Haha, clever. Very nice! – Jonathan Van Matre – 2014-03-06T04:37:35.987

1Are the square brackets allowed? – Michael Stern – 2014-04-07T14:24:29.997

What is the output ? – Nicolas Barbulesco – 2014-05-24T08:32:23.593

1Isn’t a space missing ? – Nicolas Barbulesco – 2014-05-24T08:32:49.603

11

DC

DC is just about the perfect tool for the job.

5735816763073854918203775149089P

DCs P-command pops one number from the stack and outputs its raw computer representation to STDIO. Seeing as 5735816763073854918203775149089 = 0x48656C6C6F2C20576F726C6421, which is represented as 0x21, 0x64, 0x6C... = 'H', 'e', 'l'... in a little-endian architecture, it outputs Hello, World!.

Fors

Posted 2014-03-05T13:57:07.643

Reputation: 3 020

How does this work? Would you mind adding an explanation? – wec – 2014-03-07T17:52:26.417

1Not at all. An explanation will be added shortly. – Fors – 2014-03-07T17:55:00.643

2+1. You could do it in hex to save a few chars: 16i48656C6C6F2C20576F726C6421P – Digital Trauma – 2014-03-07T19:12:15.633

9

JavaScript!

And they said that it couldn't be done... No assignment operators, no concatenators, no quotes! Arghhhh!

Fear not... For the force is with you...

function w(x){
    with(document){
        with(String){
            write(fromCharCode(x))
        }
    }
}
w(72)
w(101)
w(108)
w(108)
w(111)
w(44)
w(32)
w(87)
w(111)
w(114)
w(108)
w(100)
w(33)

Output (on browser screen): Hello, World!

WallyWest

Posted 2014-03-05T13:57:07.643

Reputation: 6 949

He said "Bonus if you can do it in Java" not Javascript. – Almo – 2014-03-07T18:39:08.590

@Almo I wasn't aiming to do it in Java... I was focussing on JavaScript, which is my main strength here on this site... – WallyWest – 2014-03-07T19:22:31.983

But you said "And they said that it couldn't be done" which I thought was referring to the puzzle stating bonus for doing it in Java. Many people still confuse Java with Javascript. – Almo – 2014-03-07T19:23:48.187

@Almo, I was just using a general saying... And when I refer to "Javascript", I intend to use JavaScript... Trust me, I wasn't planning on going for a bonus... – WallyWest – 2014-03-07T19:28:05.383

9

Javascript

Update: Managed to cut a bunch of characters by introducing a World function as well.

Another Javascript solution that writes to console.log:

function World() { with (World) return name }
function Hello() {}
with (console)
with (String)
with (Hello)
with (name)
with (concat(fromCharCode(44)))
with (concat(fromCharCode(32)))
with (concat(World()))
log(concat(fromCharCode(33)))

Inspired by this entry.

First, I define functions named Hello and World. This will be used later on.

Then I start my chain of nested withs. The with (console) and with (String) are used so that I can later on invoke console.log and String.fromCharCode without using a dot.

The plan is now to build the string Hello, World! by abusing nested withs. Each time I invoked concat(), the resulting string will be the context in the next with-block. I take a short cut to quickly get "Hello" by accessing the name property of the Hello function. Then I concatenate the comma and space characters by using String.fromCharCode.

The next trick is to get the "World" part of the string. I cannot use the same method I used to get Hello, since I cannot invoke World.name. Instead I put that logic inside the World method, and invoke it.

Finally, I append the final exclamation mark and send the result right to the log function, which is of course console.log.

waxwing

Posted 2014-03-05T13:57:07.643

Reputation: 311

7

Perl

In a modern Perl (5.10 or newer):

print q{Hello} and print chr 44 and print q{ World} and say chr 33

In older Perl:

print q{Hello} and print chr 44 and print q{ World} and print chr 33 and print chr 10


Both solutions above use Perl q quote-like operator and allows selective delimiters for quoting a string, for eg. q{} q[] q() q//

This solution requires the rule change that allows braces, brackets or parens. So while totally valid I think mniip excellent Perl answer is more in the true spirit of the rules (+1).

However taking a leaf out of mniip answer my solution could be written like so:

print q xHellox and print chr 44 and print q x Worldx and say chr 33

and while harder on the eye it does work.

draegtun

Posted 2014-03-05T13:57:07.643

Reputation: 1 592

1You are missing the comma – mniip – 2014-03-06T10:53:11.433

1@mniip - Thanks again. Have now added missing comma. – draegtun – 2014-03-06T12:40:07.347

Looks like AppleScript without the verbosity – Ming-Tang – 2014-05-17T23:51:02.877

On my Mac, the first and third Perl lines do not work, only the second Perl line works. I have Perl 5.16.2. – Nicolas Barbulesco – 2014-05-24T09:16:51.353

syntax error at -e line 1, near "say chr" – Nicolas Barbulesco – 2014-05-24T09:21:41.447

Execution of -e aborted due to compilation errors. – Nicolas Barbulesco – 2014-05-24T09:27:03.057

@NicolasBarbulesco - Use perl -E from command line. Or if in script add use 5.010; (or newer) or use feature 'say';. NB. The "say" statement was added to Perl at version 5.10. – draegtun – 2014-05-25T10:11:25.673

With perl -E and with quotes around the commands, it works. But it does not give the exact string wanted by the question. – Nicolas Barbulesco – 2014-06-07T09:08:29.770

@NicolasBarbulesco - All 3 versions using perl -E '...code...' produce Hello, World! which is the correct answer. What do you see? Please post the exact command line you used to see whats wrong. – draegtun – 2014-06-07T19:06:06.540

In fact, it does give the correct string now. Sorry, I had confused. – Nicolas Barbulesco – 2014-06-08T01:41:33.373

7

Perl

print chr hex for qw z48 65 6c 6c 6f 2c 20 57 6f 72 6c 64 21z

aragaer

Posted 2014-03-05T13:57:07.643

Reputation: 431

6

Python:

import antigravity 

causes "Hello, world!" to appear on your screen. Don't believe me? Try it out for yourself! Also, this doesn't actually use the web, it opens a browser, that might lookup a website.

ɐɔıʇǝɥʇuʎs

Posted 2014-03-05T13:57:07.643

Reputation: 4 449

http://sciyoshi.com/2008/12/import-antigravity/ The code requires Python 3 to appear but will not run in Python 3 (unless that has been backported). – March Ho – 2015-02-08T16:07:53.610

1I have a 768-pixels height screen, so "Hello, world!" doesn't appear on my screen. – Olivier Grégoire – 2014-05-16T12:57:47.520

1

This does not write "Hello, world!" anywhere in my field of vision. But this opens xkcd.com/353/ in Safari !

– Nicolas Barbulesco – 2014-05-24T09:33:27.773

I am not using the Web now. I am writing in a browser, that might connect to a Web site. – Nicolas Barbulesco – 2014-05-24T09:46:35.507

5

dc, (26 bytes for the golfers)

Whitespace and [] brackets are now allowed:

[Hello]n44P[ World]n33P[]p

Output:

$ dc <<< "[Hello]n44P[ World]n33P[]p"
Hello, World!
$ 

Digital Trauma

Posted 2014-03-05T13:57:07.643

Reputation: 64 644

5

Rebmu, 46 characters

pnUPPqHELLO01pnADsp12pnSPpnUPPqWORLD01pnADsp01

Strongly parallels @dragetun's solution in Rebol (Because Rebmu is a Rebol/Red teaching tool which is a "dialect" that aims to draw attention to the languages by rocking at Code Golf. :-P)

However, to get the missing characters, I did something more obvious. I just added to space, instead of going and looking through system strings. You can get add space 1 to get character literal #"!" and add space 12 to get character literal #",".

If we run this we can see it get "unmushed":

>> rebmu/debug/stats "pnUPPqHELLO01pnADsp12pnSPpnUPPqWORLD01prADsp01"
Original Rebmu string was: 46 characters.
Rebmu as mushed Rebol block molds to: 46 characters.
Unmushed Rebmu molds to: 62 characters.
Executing: [pn upp q hello 1 pn ad sp 12 pn sp pn upp q world 1 pr ad sp 1]
Hello, World!

Which is fairly logial:

; print with no newline the result of doing an uppercase/part
; on the quoting of the symbolic word hello, of only the first
; N characters (where N is 1)
pn upp q hello 1

; print the character you get when you add 12 to the space
; character literal, a.k.a. comma...again no newline
pn ad sp 12

; print a space, no newline
pn sp

; do the same trick of printing the quoted word hello with the
; first letter converted to uppercase
pn upp q world 1

; print the character you get when you add 1 to the space
; character literal, a.k.a. exclamation point...with newline now
pr ad sp 1

HostileFork says dont trust SE

Posted 2014-03-05T13:57:07.643

Reputation: 2 292

5

Whitespace

Okay, we can use whitespace. It uses only Space, Tab, LineFeed and ignores any other characters.

   	  	   
	
     		  	 	
	
     		 		  
	
     		 		  
	
     		 				
	
     	 		  
	
     	     
	
     			 			
	
     		 				
	
     			  	 
	
     		 		  
	
     		  	  
	
     	    	
	
  


With comment: S, T or L means Space, Tab or LineFeed respectively.

S S S T S S T   S S S L
T   L
S S S S S T T   S S T   S T L
T   L
S S S S S T T   S T T   S S L
T   L
S S S S S T T   S T T   S S L
T   L
S S S S S T T   S T T   T   T   L
T   L
S S S S S T S T T   S S L
T   L
S S S S S T S S S S S L
T   L
S S S S S T T   T   S T T   T   L
T   L
S S S S S T T   S T T   T   T   L
T   L
S S S S S T T   T   S S T   S L
T   L
S S S S S T T   S T T   S S L
T   L
S S S S S T T   S S T   S S L
T   L
S S S S S T S S S S T   L
T   L
S S L
L
L

With highlighting: http://en.wikipedia.org/wiki/Whitespace_(programming_language)#Sample_code

Yous

Posted 2014-03-05T13:57:07.643

Reputation: 151

4

T-SQL, 52

Ah, this is better! Direct binary conversion, only 52 characters.

SELECT CAST(0x48656C6C6F2C20576F726C6421 AS VARCHAR)

Previously...

There's a much cleverer and golfier solution to this that would work if we could use = and + (Looking up standard built-in data in msdb and using that to construct an EXEC-able query string)

But since we can't, you get this naive approach:

SELECT CHAR(72)SELECT CHAR(101)SELECT CHAR(108)SELECT CHAR(108)SELECT CHAR(111)SELECT CHAR(44)SELECT CHAR(32)SELECT CHAR(87)SELECT CHAR(111)SELECT CHAR(114)SELECT CHAR(108)SELECT CHAR(100)SELECT CHAR(33)

Jonathan Van Matre

Posted 2014-03-05T13:57:07.643

Reputation: 2 307

1I know, the lack of concatenation operators is killing me... I'm trying to think of a way to do it with JavaScript... – WallyWest – 2014-03-05T21:37:22.877

1Yeah, although this challenge seems to produce mostly naive answers, it has definitely inspired some interesting brain-twisting to try to find interesting non-concatenative approaches. – Jonathan Van Matre – 2014-03-05T21:46:31.057

You can do better. Use PRINT rather than SELECT. And implicitly cast with LTRIM() or RTRIM(). I do something similar here.

– Muqo – 2014-09-24T01:23:18.193

4

Python:

Pfff, who needs the numeric part of alphanumeric?

from string import lowercase
from string import uppercase
from string import punctuation
print uppercase[len(str([[[len(str())]]]))]
print lowercase[len(str([[]]))]
print lowercase[len(str([[[[[len(str())]]]]]))]
print lowercase[len(str([[[[[len(str())]]]]]))]
print lowercase[len(str([[[[[[[]]]]]]]))]
print punctuation[len(str([[[[[len(str())]]]]]))]
print
print uppercase[len(str([[[[[[[[[[[]]]]]]]]]]]))]
print lowercase[len(str([[[[[[[]]]]]]]))]
print lowercase[len(str([[[[[[[[len(str())]]]]]]]]))]
print lowercase[len(str([[[[[len(str())]]]]]))]
print lowercase[len(str([len(str())]))]
print punctuation[len(str())]

This is locale-dependant, so your milage may vary. However, if you really want to replicate this result, you could use the following instead of the import statements:

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

(this is not part of my submission, it's just sharing my locals for recreatability)

ɐɔıʇǝɥʇuʎs

Posted 2014-03-05T13:57:07.643

Reputation: 4 449

4

J - 73 char

It can be done, after all!

72 101 108 108 111 44 32 87 111 114 108 100 33{do 1 8{show 0 def 0
take
)

Here's the thing about J. Most of the primitives are ASCII punctuation, followed by up to two dots or colons. Those primitives that aren't made of punctuation are an alphanumeric character followed up to two dots or colons. So we're allowed none of those, except for { } [ ]. [ and ] are identity verbs and are thus useless.

Luckily, { indexes arrays, so if we had, say, a string with every single ASCII character (a., called Alphabet), we could pull the letters out by their ASCII codepoints. We also have a backup way of making strings, 0 : 0 and then stuff and then a lone ); the colon in which has an alias in the standard library, def.

Then there's a verb in the standard library, show, that gives you the internal representation of a verb if you pass it the name as a string. There's another verb, do, that will eval a string. So if we can pull out an a. from any such representation, we can eval that and pull out Hello, World!.

Our saviour comes in the form of take, an alias for {. that has an a in its name. show'take' will return take=: {., so we have our a. and thus a solution.

We can get rid of { by using the essentially equivalent pick from the standard library, but the paren at the very end can't be avoided.

algorithmshark

Posted 2014-03-05T13:57:07.643

Reputation: 8 144

4

perl

How about a more straight-forward perl implentation?

print q zHelloz and print chr 44 and print q z worldz and print chr 33

skibrianski

Posted 2014-03-05T13:57:07.643

Reputation: 1 197

4

GolfScript

389960998265612367812323333 115base]zip

Try it online.

How it works

Since both number and square brackets are allowed, pushing an array containing the character codes of all bytes in the string “Hello, World!” is straightforward:

[72 101 108 108 111 44 32 87 111 114 108 100 33]

The highest character count is 114, so we could also push this array as a base 115 number:

389960998265612367812323333 115base

The problem lays in casting this array to a string. There's already a string on the stack (the empty string, since there was no input from STDIN). Strings have higher priority than arrays in GolfScript, so any way of combining the empty string with the array from above will yield a string.

Almost all built-ins are out, since they use non-alphanumeric characters (e.g., + for concatenation), but we can use zip, which transposes array rows with columns.

First, we append a ] to the array, so a two-dimensional array consisting of the empty string an the character array will lay on the stack.

Then, we append zip. The result of the transpose will be the following array:

[   "H"   "e"   "l"   "l"   "o"   ","   " "   "W"   "o"   "r"   "l"   "d"   "!"   ]

By default, GolfScript prints all item on the stack, one by one. The result is:

Hello, World!

Dennis

Posted 2014-03-05T13:57:07.643

Reputation: 196 637

3

GO (golang)

package main

func main() {
    print(string(72))
    print(string(101))
    print(string(108))
    print(string(108))
    print(string(111))
    print(string(44))
    print(string(32))
    print(string(87))
    print(string(111))
    print(string(114))
    print(string(108))
    print(string(100))
    print(string(33))
}

No "fmt" used... Just print.

rljoe

Posted 2014-03-05T13:57:07.643

Reputation: 31

3

Groovy

So updated. Much wat.

def wat(i) { print i
  this
}
def wat(int i) { wat i as char }
def getProperty(String p) { p }
wat Hello wat 44 wat 32 wat World wat 33

Will Lp

Posted 2014-03-05T13:57:07.643

Reputation: 797

3

Lua (112)

io[ [[write]]][[Hello]]io[ [[write]]](string[ [[char]]](44))io[ [[write]]][[ World]]print(string[ [[char]]](33))

Pretty straightforward. Lua's alternate string syntax is quite a boon here, in addition to "the only data structure is a table" which means that io.write is equilavent to io['write'].

AlliedEnvy

Posted 2014-03-05T13:57:07.643

Reputation: 1 384

2

Haskell

Not exactly a program, as it is impossible to create a program without main=. This is simply an expression for an interactive interpreter, such as ghci:

putStrLn (map toEnum (scanl (const id) 72 (scanl (const id) 101 (scanl (const id) 108 (scanl (const id) 111 (scanl (const id) 44 (scanl (const id) 32 (scanl (const id) 119 (scanl (const id) 111 (scanl (const id) 114 (scanl (const id) 108 (scanl (const id) 100 [33]))))))))))))

scanl (const id) is used instead of (:),
toEnum :: a -> Char is used instead of chr, as I'd have to import Data.Char then.

mniip

Posted 2014-03-05T13:57:07.643

Reputation: 9 396

2

Emacs Lisp

Displays "Hello, World!" in a browser when you eval it.

it's lisp as ascii values of base64 of lisp of base64 of ascii values if you start unobfuscating it.

(eval (read (eval (list (intern (string 98 97 115 101 54 52 45 100 101 99 111 100 101 45 115 116 114 105 110 103))
                        (string 75 71 120 108 100 67 65 111 75 71 90 112 98 71 85 103 75 71 86 50 89 87 119 103
                                75 72 74 108 89 87 81 103 75 71 74 104 99 50 85 50 78 67 49 107 90 87 78 118 90
                                71 85 116 99 51 82 121 97 87 53 110 73 67 74 76 83 69 52 119 89 50 49 115 100 86
                                112 53 10 81 84 86 78 97 85 70 52 84 85 82 82 90 48 49 85 81 88 104 74 82 69 86
                                51 84 48 78 66 101 69 49 69 90 50 100 78 86 69 86 52 83 85 82 70 101 69 57 84 81
                                88 104 78 86 69 86 110 84 86 82 70 77 69 108 69 82 88 100 80 81 48 70 52 84 85 82
                                66 10 90 48 49 85 82 88 104 74 82 69 86 52 84 110 108 66 101 69 49 85 87 87 100
                                78 86 69 86 53 83 85 82 70 101 69 53 53 81 88 104 78 86 70 108 110 84 107 82 90
                                90 48 49 85 81 84 66 74 82 69 86 52 84 109 108 66 101 69 49 69 97 50 100 78 86 69
                                69 48 10 83 49 69 57 80 83 73 112 75 83 107 112 75 83 65 111 100 50 108 48 97 67
                                49 48 90 87 49 119 76 87 90 112 98 71 85 103 90 109 108 115 90 83 65 111 97 87 53
                                122 90 88 74 48 73 67 104 108 100 109 70 115 73 67 104 121 90 87 70 107 73 67 104
                                105 89 88 78 108 10 78 106 81 116 90 71 86 106 98 50 82 108 76 88 78 48 99 109 108
                                117 90 121 65 105 83 48 104 79 77 71 78 116 98 72 86 97 101 85 69 121 84 85 78 66
                                101 69 49 69 85 87 100 79 86 69 86 110 84 109 112 74 90 48 53 54 83 87 100 78 86 69
                                70 52 83 85 82 70 10 100 48 57 68 81 88 104 78 82 71 100 110 84 86 82 70 101 69 108
                                69 85 84 66 74 82 69 49 53 83 85 82 110 77 48 108 69 82 88 104 78 85 48 70 52 84 86
                                82 82 90 48 49 85 81 84 82 74 82 69 86 51 84 85 78 66 101 107 49 53 81 84 74 78 81
                                48 69 119 10 84 110 108 66 101 69 49 69 85 87 100 79 86 69 86 110 84 109 112 74 99
                                67 73 112 75 83 107 112 75 83 65 111 89 110 74 118 100 51 78 108 76 88 86 121 98 67
                                49 118 90 105 49 109 97 87 120 108 73 71 90 112 98 71 85 112 73 67 107 103)))))

enter image description here

Jordon Biondo

Posted 2014-03-05T13:57:07.643

Reputation: 1 030

2

CJam

One of the few answers satisfying the original requirement for the character set:

72c101c108c108c111c44c32c87c111c114c108c100c33c

This straightforwardly builds the string character by character.

Another solution:

389960998265612367812323333 115b{Xc}fX

This converts the first number to base 115 then converts each digit to a character.

And finally, a solution that uses only 3 different characters: K, ) and c (newlines are optional):

K))))))))))))))))))))))))))))))))))))))))))))))))))))c
K)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))c
K))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))c
K))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))c
K)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))c
K))))))))))))))))))))))))c
K))))))))))))c
K)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))c
K)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))c
K))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))c
K))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))c
K))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))c
K)))))))))))))c

I used K because it's the variable initialized with the largest number (20).

Online interpreter: http://cjam.aditsu.net/

aditsu quit because SE is EVIL

Posted 2014-03-05T13:57:07.643

Reputation: 22 326

1

FORTH

UPDATE: Here's the basically similar version that executed straight from forth file, as opposed to defining a WORD (subroutine) and it uses only alphanumeric characters.

72 EMIT
101 EMIT
108 EMIT
108 EMIT
111 EMIT
44 EMIT
32 EMIT
87 EMIT
111 EMIT
114 EMIT
108 EMIT
100 EMIT
33 EMIT

been a while with FORTH but this seems to work, thanks for the 'C' language reply I didn't bother looking up ACSII codes. I used the iMop and iBucket (http://sourceforge.net/projects/powermops/files/iMops/) and also tested with an osx variant (https://sites.google.com/site/chrishinsley/)

: HELLOWORLD ( -- )
72 EMIT
101 EMIT
108 EMIT
108 EMIT
111 EMIT
44 EMIT
32 EMIT
87 EMIT
111 EMIT
114 EMIT
108 EMIT
100 EMIT
33 EMIT
;

code: 224 data: 16

cr HELLOWORLD

Hello, World!

labiche

Posted 2014-03-05T13:57:07.643

Reputation: 11

I don't think :, -, or ; are allowed. Otherwise, nice post. – None – 2014-03-08T01:29:56.003

the colon, dash, and semi-colon are language basic delimiters. although there might be some way to type it in the interpreter without defining a WORD (which is Forth for subroutine). maybe I'll try APL next. :-0 – labiche – 2014-03-08T02:57:43.193

Yeah, I know. This challenge is a tough one to start on. – None – 2014-03-08T02:59:15.910

1

Python, 148 bytes

from binascii import unhexlify
print unhexlify(bytearray(str(0)if c in hex(14)else c for c in hex(0x48656c6c6f2c2e776f726c6421)if c not in hex(0L)))

Aleksi Torhamo

Posted 2014-03-05T13:57:07.643

Reputation: 1 871

1

REXX

Using standard build-in functions only (ASCII based)

  SAY x2c(48656c6c6f2c20576f726c6421)

Yields:

Hello, World!

NealB

Posted 2014-03-05T13:57:07.643

Reputation: 111

1

PHP - 46 bytes (with invalid underscore)

if(print(base64_decode(SGVsbG8sIFdvcmxkIQ))){}

PHP - 88 bytes

if(print(Hello))if(print(chr(44)))if(print(chr(32)))if(print(World))if(print(chr(33))){}

Works by abusing the fact that PHP will assume any unassigned constant is a string equal to its name.

Yoda

Posted 2014-03-05T13:57:07.643

Reputation: 151

1Underscore is not allowed – Sylwester – 2014-05-13T11:37:19.810

So second nature I hadn't even realised. Luckily, I had an alternate. – Yoda – 2014-05-13T15:17:31.927

1

Racket

(quasiquote (unquote (quote (Hello (unquote (quote World))))))

It barely works. The output is '(Hello ,'world)

To run this code, start DrRacket and paste the code above to the console.

Don't do it in Advanced Student Language, it shows up (list 'Hello (list 'unquote (list 'quote 'world))) instead.

Ming-Tang

Posted 2014-03-05T13:57:07.643

Reputation: 5 383

0

JavaScript:

with(String) {
    with(console) {
        log(fromCharCode(72))
        log(fromCharCode(101))
        log(fromCharCode(108))
        log(fromCharCode(108))
        log(fromCharCode(111))
        log(fromCharCode(44))
        log(fromCharCode(32))
        log(fromCharCode(87))
        log(fromCharCode(111))
        log(fromCharCode(114))
        log(fromCharCode(108))
        log(fromCharCode(100))
        log(fromCharCode(33))
    }
}

Unfortunately the Firefox console displays this as

H
e
l(2)
o

etc....

Neil

Posted 2014-03-05T13:57:07.643

Reputation: 95 035

I managed to find a way of displaying it on the browser screen... see my answer below: http://codegolf.stackexchange.com/a/23169/8555

– WallyWest – 2014-03-06T11:15:57.257

0

Java

class Hello extends Exception
{
    Hello(String s)
    {
        super(s)
    }
}

public class HelloWorld
{
    public static void main(String[] args) throws Hello
    {
        world((char)130)
    }

    static void world(char c) throws Hello
    {
        throw new Hello(new String(new char[]{c}))
    }
}

Output:

Exception in thread "main" Hello: ,
    at HelloWorld.world(HelloWorld.java:18)
    at HelloWorld.main(HelloWorld.java:13)
Java Result: 1

A few notes:

  1. NetBeans allows you to omit semicolons, but isn't happy about it. Eclipse and javac don't compile.
  2. I don't get the +10 brownie points, since including unnecessary output is bending (but not violating) the rules.
  3. The exclamation point is courtesy of NetBeans, objecting like crazy to the lack of semicolons.

Ypnypn

Posted 2014-03-05T13:57:07.643

Reputation: 10 485

1I get Hello.java:12: error: ';' expected super(s) from the compiler. – Riking – 2014-03-06T20:27:56.760

@Riking What IDE are you using? – Ypnypn – 2014-03-06T20:30:24.420

That was with javac. Eclipse gives Exception in thread "main" java.lang.Error: Unresolved compilation problem: Syntax error, insert ";" to complete BlockStatements when you try to run it. – Riking – 2014-03-06T20:50:48.710

Okay; I guess it's compiler-dependent. – Ypnypn – 2014-03-06T20:54:48.560

0

Lua

io[ [[write]]][[Hello]]
io[ [[write]]](string[ [[char]]](44))
io[ [[write]]][[ World]]
io[ [[write]]](string[ [[char]]](33))

edit: Didn't see AlliedEnvy's answer, which is identical to mine, except mine doesn't print a newline at the end.

Seeker14491

Posted 2014-03-05T13:57:07.643

Reputation: 81

0

VBA

Since equals, quotes and dot are out of the question, and as everyone loves message boxes:

Sub helloworld()
    MsgBox Chr(72)
    MsgBox Chr(101)
    MsgBox Chr(108)
    MsgBox Chr(108)
    MsgBox Chr(111)
    MsgBox Chr(44)
    MsgBox Chr(87)
    MsgBox Chr(111)
    MsgBox Chr(114)
    MsgBox Chr(108)
    MsgBox Chr(100)
    MsgBox Chr(33)
End Sub

jaybee3

Posted 2014-03-05T13:57:07.643

Reputation: 11

0

PHP (111 chars)

<?=chr(72).chr(101).chr(108).chr(108).chr(111).chr(44).chr(32).chr(87).chr(111).chr(114).chr(108).chr(100).chr(33)?>

Assuming . is OK (I have used: [chr0-9\(\)\.]).

Fabien Sa

Posted 2014-03-05T13:57:07.643

Reputation: 119

0

dc - 25 bytes

33[ World]44[Hello]PaPPap

I'm starting to like dc.

user3188175

Posted 2014-03-05T13:57:07.643

Reputation: 329

0

Logo, 52 chars

pr se word [Hello] char 44 word char [World] char 33

Using the new rule that brackets are allowed. Otherwise, one could word together lots more chars to achieve the same goal.

tomsmeding

Posted 2014-03-05T13:57:07.643

Reputation: 2 034

0

Julia

Option 1, using square brackets and join, and just one print/char:

print(join(char([72 101 108 108 111 44 32 87 111 114 108 100 33])))

Option 2, one "char" at a time:

print(char(72))
print(char(101))
print(char(108))
print(char(108)
print(char(111))
print(char(44))
print(char(32))
print(char(87))
print(char(111))
print(char(114))
print(char(108))
print(char(100))
print(char(33))

Options 3 + 4, same as above, but with 0x?? char creation. That is, rather than char(72), use 0x72. Or, in the join case, replace 72 with 0x72 (and so on) and remove the "char" operation entirely.

Glen O

Posted 2014-03-05T13:57:07.643

Reputation: 2 548

-2

Common Lisp

This almost works, except that - isn't allowed. If only there were the functions stringCapitalize and codeChar instead…

(mapcar (lambda (x)
          (princ (string-capitalize x)))
        (list (quote hello)
              (code-char 44)
              (code-char 32)
              (quote world)
              (code-char 33))))

The nice thing here is that string-capitalize takes a string designator, which can be a string, symbol, or character. Sample use:

CL-USER> (mapcar (lambda (x)
                   (princ (string-capitalize x)))
                 (list (quote hello)
                       (code-char 44)
                       (code-char 32)
                       (quote world)
                       (code-char 33)))
Hello, World!

Joshua Taylor

Posted 2014-03-05T13:57:07.643

Reputation: 660

Unfortunately, - is banned. – Geobits – 2014-03-05T18:59:03.257

@Geobits aww… I got excited when I saw that parens were allowed… I think I can work around this, though – Joshua Taylor – 2014-03-05T18:59:49.950