Hello, World! (Every other character)

130

13

Write a program that prints "Hello, World!". But also, if you take only the first, third, fifth, etc. characters of your program, the resulting program should still print "Hello, World!".

If your program is:

abc
def

It should output "Hello, World!", but so should

acdf

No solutions with fewer than 2 characters.

Leo Tenenbaum

Posted 2017-06-26T20:07:15.810

Reputation: 2 655

2Can there be whitespace around the output? – vroomfondel – 2017-06-26T20:20:55.057

1@rogaos Sure, as long as it's the same in both variations. – Leo Tenenbaum – 2017-06-26T20:26:01.647

18Amazing first post! – Adám – 2017-06-26T22:49:17.033

11Seeing all the answers with "HHeelllloo" reminded me of speaking Whale. – Brian Minton – 2017-06-27T04:19:44.593

32Pro tip for avoiding "Hello, World!" built-ins in challenges like this: use a slightly different string of similar complexity like "Greetings, Earthlings!" – Martin Ender – 2017-06-27T07:15:16.403

1I suppose creating a Stuck program (which prints Hello World by default) with 2 ASCII NUL characters (which are both ignored by the interpreter) is considered cheating? – Daniel – 2017-06-27T09:50:38.490

1@Daniel Well it is not banned so :/ – Christopher – 2017-06-27T09:52:15.223

6"No solutions with fewer than 2 characters." Amazing. – Robert Grant – 2017-06-28T09:10:44.303

What does "take" mean? take out? keep? And I'm assuming that you are counting the newline after 'c', in your example, because you have "acdf". – veganaiZe – 2017-06-29T00:09:35.087

can there be quotes around the output? – Alexis Andersen – 2017-06-29T17:58:31.317

Honestly, I would just say "no use of 'Hello World' builtins." But I'd also add a penalty for golfing languages (or exclude them entirely), so I'm not necessarily the best person to ask. – trlkly – 2017-06-30T02:11:40.367

@trlkly Not all golfing languages have a built-in for "Hello, World!", so I think your former proposition would be a lot fairer than the latter. And to be honest, I don't think the built-ins are that much of problem either. On this challenge (at the moment) only three of the thirty answers on the first page use a built-in. – Steadybox – 2017-07-01T22:11:41.533

Is program purposefully excluding functions or are functions that print ok? – NonlinearFruit – 2017-07-02T01:40:16.037

1

@NonlinearFruit The consensus is, that just saying program means that both full programs and functions are allowed.

– Steadybox – 2017-07-02T02:03:23.677

Golfing languages are specifically designed for small code, and thus get an unfair advantage in golfing contests. That is why I do not like them. Similarly, having a Hello World built-in also gives an unfair advantage. If we actually treated this like real code-golfing, these languages would always win. Instead we just rely on people not liking them. Objective criteria would be better, IMHO. – trlkly – 2017-07-02T07:04:46.503

Answers

198

Python 3, 61 bytes

rant="partisn't"
print(("HHeelllloo,,  WWoorrlldd!!"""[::2]))

Try it online!

Abusing the fact that print is a function in Python 3 :)

The least partisan solution you'll find here on PPCG.

Becomes

rn=print
rn("Hello, World!"[:])

vroomfondel

Posted 2017-06-26T20:07:15.810

Reputation: 2 094

49This is beautiful. – musicman523 – 2017-06-26T22:30:53.433

If you want to do a Python REPL version, it would just be "HHeelllloo,, WWoorrlldd!!"""[::2], and that works in 2 or 3. – musicman523 – 2017-06-26T22:55:35.490

1@musicman523 But, Doesn't REPL surround the text with single-quotes in that case. – officialaimm – 2017-06-27T02:38:02.293

1@officialaimm Yes, I suppose it does – musicman523 – 2017-06-27T03:25:07.190

What is the point of the rant="partisn't. It runs perfectly fine without it – None – 2017-06-27T03:47:59.447

1@yamboy1 Try deleting every other letter – vroomfondel – 2017-06-27T03:49:49.223

I didn't realise it was every other character off the source code. I though that it was every other letter off of the output – None – 2017-06-27T03:51:07.867

1I did not know [:] actually worked :o Nice! – HyperNeutrino – 2017-07-15T02:07:55.370

1This is art. This made me cry. – Koishore Roy – 2017-07-20T12:47:09.490

56

Cardinal, 29 bytes

%
"
H
e
l
l
o
,
 
W
o
r
l
d
!

Try it online!

Removing every other character removes all the linefeeds, which still results in Hello, World!:

%"Hello, World!

Try it online!

The reason this works is that % creates four instruction pointers, moving in each of the four cardinal directions. IPs that leave the source code are simply removed. So in the first case, only the south-going IP remains and in the second case, only the east-going IP remains, all the others are simply dropped. In either case, the executed program is then just "Hello, World!. The " toggles to string mode where each cell is simply printed to STDOUT. We don't need to terminate the string, because leaving the source code still terminates the program.

Note that the same idea works in Beeswax, using * instead of % and ` instead of " (this is because Beeswax was largely inspired by Cardinal but uses a hexagonal grid).

Try it online! (vertical) | | Try it online! (horizontal)

Martin Ender

Posted 2017-06-26T20:07:15.810

Reputation: 184 808

49

C, 125 bytes

xpxuxtxs( ) { }xuxs ( ) { } main( ) {puts ( "Hello, World!" ) ; } mxaxixn ( ) {xpxuxtxs ( " H e l l o ,   W o r l d ! " ) ; }

Try it online!

With even characters removed:

xxxx(){}us(){}mi(){us("el,Wrd");}main(){puts("Hello, World!");}

Try it online!

Steadybox

Posted 2017-06-26T20:07:15.810

Reputation: 15 798

31

Actually, 2 bytes

HH

Explanation:

H, as you might expect, pushes Hello, World! to the stack.

The main program (HH) will encounter the first H and push Hello, World! to the stack. On the second H, however, it will try to use two arguments (as the stack needs to be empty to push Hello, World!) and fail. However, this error will be ignored and then Hello, World! will be implicitly printed.

The second program (H) will push Hello, World! once, and that will be impliclty printed.

This is similar to Fatalize's 2-byte answer, but this doesn't really "cheat".

Try it online!

Okx

Posted 2017-06-26T20:07:15.810

Reputation: 15 025

4Nice solution, but I think this shouldn't count since it's too much like a one-character solution. – Leo Tenenbaum – 2017-06-26T20:54:54.863

32@LeoTenenbaum Why not? It conforms to the rules perfectly fine. – Okx – 2017-06-26T21:06:11.010

2What you explain isn't the case, H would only push Hello, World! on an empty stack, and if the stack isn't empty, it would expect 2 arguments, so there will be an error, and errors are ignored. And no Actually doesn't implicitly print only the topmost element. – Erik the Outgolfer – 2017-06-27T07:30:11.200

@EriktheOutgolfer Oops. Will fix. – Okx – 2017-06-27T09:37:31.410

This is why Actually is my favorite golfing language. It's at the perfect level of stupid. – RShields – 2017-07-03T00:07:13.467

22

Lua, 89 bytes

--- [ [
print("Hello, World!")
--[[ ] ]
pCrAiLnCtU(L"AHTeOlRlFoE,L IWNoEr:lDd !:"D)
---]]

Try it online! As the syntax highlighting shows, this is massive comment abuse.

Alternate:

--[[pit"el,Wrd"
-[]]print("Hello, World!")--]

Try it online!

And for convenience, a program to convert a program into every other character form: Try it online!

CalculatorFeline

Posted 2017-06-26T20:07:15.810

Reputation: 2 608

I like this one! The commenting format of Lua seems similar to T-SQL, I'm going to try and work on one for that language. – BradC – 2017-06-26T21:11:06.223

3This sort of trick should work for any language with both block comments and line comments (C, JS, etc) – CalculatorFeline – 2017-06-26T21:25:39.557

2CALCULATORFELINE:D :D – Riking – 2017-06-28T01:50:40.073

2HHeelllloo WWoorrlldd!! is kinda boring :P – CalculatorFeline – 2017-06-28T15:34:03.940

19

Retina, 39 bytes


HHeelllloo,,  WWoorrlldd!!


(.).x?
$1

Try it online!

Taking every other character gives:


Hello, World!
()x
1

Try it online!

The first program creates a string with the greeting duplicated. Then it replaces each pair of characters with the first character. There is also an empty stage that replaces all empty strings with empty strings in between, but that doesn't do anything. The second program fails to match the letter "x" so it doesn't replace anything after creating the greeting.

Perhaps more amusingly, if the third stage is changed slightly the first set of characters doesn't have to be the same message. This could lead to many identical length solutions such as full and halved.

FryAmTheEggman

Posted 2017-06-26T20:07:15.810

Reputation: 16 206

17

Charcoal, 25 bytes

H→e→l→l→o→,→ →W→o→r→l→d→!

Try it online!

If you remove the even characters, you just remove the arrow commands that indicate the direction of the next text, and that leaves the following code:

Hello, World!

Try it online!

That also prints the greeting.

Charlie

Posted 2017-06-26T20:07:15.810

Reputation: 11 448

17

Haskell, 85 bytes

{--}main=putStr"Hello, World!"--} m a i n = p u t S t r " H e l l o ,   W o r l d ! "

Try it online!

Every second character removed:

{-mi=uSrHlo ol!-}main=putStr"Hello, World!"

Try it online!

This exploits the two comment formats in Haskell: {- -} for in-line or multi-line comments and -- to comment the rest of the line.

Laikoni

Posted 2017-06-26T20:07:15.810

Reputation: 23 676

16

Javascript, 67 bytes

/**/alert`Hello, World`// * / a l e r t ` H e l l o ,   W o r l d `

Every second letter removed:

/*aetHlo ol`/*/alert`Hello, World`

Just like Laikoni's Haskell answer, this exploits comments.

SuperStormer

Posted 2017-06-26T20:07:15.810

Reputation: 927

Nice answer, +1! Saved 2 bytes by creating a port of your answer in my Java 8 answer, and an additional byte when I changed // * / to //**/ (which unfortunately isn't possible in your case due to /**/alert`Hello, World` being an odd amount of bytes, instead of even like in my case.

– Kevin Cruijssen – 2017-06-27T09:54:50.837

14

Brachylog, 4 bytes

Ḥ~wḤ

Try it online!

Explanation

~w writes its right variable to STDOUT, and ignores its left argument. is "Hello, World!", so this prints Hello, World!.

If we only take the first and third chars, we get Ḥw. In that case w writes its left variable and ignores its right variable, so it also prints Hello, World!.

2 bytes

ḤḤ

Try it online!

This is technically a valid answer, but this unifies the output variable of the program instead of printing to STDOUT, so I guess the 4 bytes program is more in the spirit of the challenge.

Fatalize

Posted 2017-06-26T20:07:15.810

Reputation: 32 976

I do not think the 2 byte answer is 'technically' valid, as the challenge states print. – Okx – 2017-06-26T21:56:01.293

1@Okx print, as in onto a piece of paper? – theonlygusti – 2017-06-27T10:39:14.463

@theonlygusti It means print to STDOUT. – Okx – 2017-06-27T10:40:22.480

@Okx the challenge doesn't specify that, so you can't use it as your reason for invalidating Fatalize's answer. – theonlygusti – 2017-06-27T10:41:56.167

5@theonlygusti Sigh... that's what's meant by print by default. – Okx – 2017-06-27T10:42:49.753

3@Okx you're trying to be pedantic to invalidate a solution, but actually there's nothing invalid about it. The challenge only says "output." – theonlygusti – 2017-06-27T10:43:49.373

11

Haskell, 102 bytes

The full program:

main= putStr"Hello, World!";;
putSt   x ="p u t S t r  \" H e l l o ,   W o r l d !\"";
mmaaiin = main

and with every other character removed:

mi=ptt"el,Wrd";ptt x=putStr "Hello, World!";main=mi

siracusa

Posted 2017-06-26T20:07:15.810

Reputation: 623

You can take off 2 bytes by removing the spaces between p u t S t r and \". – Post Rock Garf Hunter – 2018-02-16T19:54:19.507

11

x86 machine code, 162 bytes

demo

PROG.COM Download and run it in MS-DOS emulator, DOSBox for example.

90 B3 B4 B4 02 90 90 B3 B2 B2 48 90 90 B3 CD CD 21 90 90 B3 B2 B2 65 90 
90 B3 CD CD 21 90 90 B3 B2 B2 6C 90 90 B3 CD CD 21 90 90 B3 CD CD 21 90 
90 B3 B2 B2 6F 90 90 B3 CD CD 21 90 90 B3 B2 B2 2C 90 90 B3 CD CD 21 90 
90 B3 B2 B2 20 90 90 B3 CD CD 21 90 90 B3 B2 B2 77 90 90 B3 CD CD 21 90 
90 B3 B2 B2 6F 90 90 B3 CD CD 21 90 90 B3 B2 B2 72 90 90 B3 CD CD 21 90 
90 B3 B2 B2 6C 90 90 B3 CD CD 21 90 90 B3 B2 B2 64 90 90 B3 CD CD 21 90 
90 B3 B2 B2 21 90 90 B3 CD CD 21 90 90 B3 CD CD 20 90

after removal MINI.COM Download

90 B4 02 90 B2 48 90 CD 21 90 B2 65 90 CD 21 90 B2 6C 90 CD 21 90 CD 21 
90 B2 6F 90 CD 21 90 B2 2C 90 CD 21 90 B2 20 90 CD 21 90 B2 77 90 CD 21 
90 B2 6F 90 CD 21 90 B2 72 90 CD 21 90 B2 6C 90 CD 21 90 B2 64 90 CD 21 
90 B2 21 90 CD 21 90 CD 20

How to run?

Install DOSBox, for Ubuntu/Debian

sudo apt install dosbox

Run it

dosbox

In DOSBOX

mount c /home/user/path/to/your/directory
c:
PROG.COM
MINI.COM

How does it works?

Machine operation codes represents assembly language instructions.

In MS-DOS to print char you will set registers and make interrupt. AH register will be 0x02, DL register contains your char. Interrupt vector is 0x21.

mov ah,0x2  ;AH register to 0x2 (B4 02)
mov dl,0x48 ;DL register to "H" (B2 48)
int 0x21    ;0x21 interrupt     (CD 21)

MS-DOS COM file tiny model is good choise, because it doesn't have any headers. It is limited by 64K, but in our case it doesn't matters.

To stop program use 0x20 interrupt

int 0x20    ;0x20 interrupt     (CD 20)

Magic

If you want to execute 0xAB opcode command with one parameter 0xCD, you write

AB CD

In PROG.COM

90 B3 AB AB CD 90
nop         ; No operation (90)
mov bl,0xb4 ; BL register to AB (B3 AB)
AB CD command (AB CD)
nop         ; No operation (90)

In MINI.COM

90 AB CD
nop         ; No operation (90)
AB CD command (AB CD)

It is equal machine codes, if you don't use BL register.

Generator

Convert text file with hex to hex binary

cat hex_file | xxd -r -p > exec.com

function byte2hex(byte){
 var ret=byte.toString(16).toUpperCase();
 return ret.length==1 ? "0"+ret : ret;
}

function str2hex(str){
 var ret = [];
 for(var i=0;i<str.length;i++){
  ret.push(byte2hex(str.charCodeAt(i)));
 }
 return ret;
}

function genCode(hexArr){
 var ret = [["B4","02"]];
 for(var i=0;i<hexArr.length;i++){
  if(hexArr[i]!=hexArr[i-1]){
   ret.push(["B2",hexArr[i]]);
  }
  ret.push(["CD","21"]);
 }
 ret.push(["CD","20"]);

 return ret;
}


function magicCode(str){
 var ret=[""];
 var code=genCode(str2hex(str));

 for(var i=0;i<code.length;i++){
  ret.push("90 B3 "+code[i][0]+" "+code[i][0]+" "+code[i][1]+" 90");
  if(i%4==3){ret.push("\n");}
 }
 return ret.join(" ");
}

function magicCodeMinified(str){
 var ret=[""];
 var code=genCode(str2hex(str));

 for(var i=0;i<code.length;i++){
  ret.push("90 "+code[i][0]+" "+code[i][1]);
  if(i%8==7){ret.push("\n");}
 }
 return ret.join(" ");
}

var str=prompt("string","Hello, world!");
var out="PROG.COM\n" + magicCode(str)+"\n\nMINI.COM\n"+magicCodeMinified(str);

document.write(out.replace("\n","<br>"));
alert(out);

Евгений Новиков

Posted 2017-06-26T20:07:15.810

Reputation: 987

Remove all 90 90 for -52 bytes. – NieDzejkob – 2018-12-22T19:37:38.877

Also the nop at the very end will never be reached. – NieDzejkob – 2018-12-22T20:00:05.583

10

Pyth, 31 bytes

p% 2"HHeelllloo,,  WWoorrlldd!!

Try it online!

Becomes

p "Hello, World!

Thanks to @CalculatorFeline for pointing out an error and removing one byte.

vroomfondel

Posted 2017-06-26T20:07:15.810

Reputation: 2 094

Characters kept start from the first, not the second. You can drop the leading space. – CalculatorFeline – 2017-06-26T20:54:16.983

Ah, thanks @CalculatorFeline. I read "Take" as "Remove" in the spec. – vroomfondel – 2017-06-26T20:55:44.173

8

V, 32 bytes

i;H;e;l;l;o;,; ;w;o;r;l;d;!;<esc>;Ó;

Note that <esc> is a single character, e.g. 0x1b

Try it online!

Removing every other character gives:

iHello, world!<esc>Ó

Try it online!

James

Posted 2017-06-26T20:07:15.810

Reputation: 54 537

7

Jelly, 26 25 bytes

““3ḅaė;œ»ḷ“ 3 ḅ a ė ; œ »

Try it online!

After removing every second character, we're left with the following code.

“3a;»“3ḅaė;œ»

Try it online!

How it works

““3ḅaė;œ»ḷ“ 3 ḅ a ė ; œ »  Main link.

““3ḅaė;œ»                  Index into Jelly's dictionary to yield
                           ["", "Hello, World!"]. 
          “ 3 ḅ a ė ; œ »  Index into Jelly's dictionary to yield.
                          " FullERebitingBEfluffiest adoptable".
         ḷ                 Take the left result.
“3a;»“3ḅaė;œ»  Main link.

“3a;»          Index into Jelly's dicrionary to yield " N-".
               Set the argument and the return value to the result.
     “3ḅaė;œ»  Index into Jelly's dicrionary to yield "Hello, World!".
               Set the return value to the result.

Dennis

Posted 2017-06-26T20:07:15.810

Reputation: 196 637

7

Mathematica, 62 bytes

P0r0i0n0t0@0"0H0e0l0l0o0,0 0W0o0r0l0d0!0"Print@"Hello, World!"

It returns "0H0e0l0l0o0,0 0W0o0r0l0d0!0" Null P0r0i0n0t0[0], and prints Hello, World! as a side effect. When run as a program (not in the REPL), the return value will not be printed.

After removing every other character:

Print@"Hello, World!"rn@Hlo ol!

It returns Null ol! rn[Hlo], and prints Hello, World!.

alephalpha

Posted 2017-06-26T20:07:15.810

Reputation: 23 988

7

05AB1E, 29 bytes

”™ ,ï‚‚ï ! ”# ¦2 ä ø¨øJð ý

Try it online!

Explanation

”™ ,ï‚‚ï ! ”                # push the string "Weekly Hello , Changed World ! "
               #               # split on spaces
                               # RESULT: ['Weekly','Hello',',','Changed','World','!','']
                ¦              # remove the first element (Weekly)
                 2ä            # split in 2 parts
                               # RESULT: [['Hello', ',', 'Changed'], ['World', '!', '']]
                   ø           # zip
                               # RESULT: [['Hello', 'World'], [',', '!'], ['Changed', '']]
                    ¨          # remove the last element
                     ø         # zip
                               # RESULT: [['Hello', ','], ['World', '!']]
                      J        # join each inner list
                       ðý      # join on space

After removing every other character we are left with the code

”Ÿ™,‚ï!” 2äøøðý

Try it online!

Explanation

”Ÿ™,‚ï!”       # push the string "Hello, World!"
        2ä     # split in 2 parts
               # RESULT: ['Hello, ', 'World!']
          ø    # zip, as the string has an odd length the space is lost
               # RESULT: ['HW', 'eo', 'lr', 'll', 'od', ',!']
           ø   # zip again
               # RESULT: ['Hello,', 'World!']
            ðý # join on space

Emigna

Posted 2017-06-26T20:07:15.810

Reputation: 50 798

7

Cubically v2.1, 222 bytes

+0503 @@6 :22 //1 +050501 @@6 :55 +0502 @@6@6 :33 //1 +050502 @@6 :55 +03 //1 +04 @@6 :55 //1 +03 @@6 :55 +01 //1 +0504 @@6 :33 //1 +050502 @@6 :55 +01 //1 +050502 @@6 :55 +0502 @@6 :11 //1 +050501 @@6 :55 +01 //1 +03 @@6

Try it online!

Every other letter:

+53@6:2/1+551@6:5+52@66:3/1+552@6:5+3/1+4@6:5/1+3@6:5+1/1+54@6:3/1+552@6:5+1/1+552@6:5+52@6:1/1+551@6:5+1/1+3@6

Try it online!

TehPers

Posted 2017-06-26T20:07:15.810

Reputation: 899

6

CJam, 32 bytes

"HHeelllloo,,  WWoorrlldd!! "2 %

Try it online!

Taking every other character gives:

"Hello, World!" 

Try it online!

Business Cat

Posted 2017-06-26T20:07:15.810

Reputation: 8 927

Note the trailing space on the alternated version. – CalculatorFeline – 2017-06-26T20:59:28.930

6

Octave, 49 45 bytes

Saved 4 bytes since Octave doesn't require brackets to do indexing.

'HHeelllloo,,  WWoorrlldd!! ' (1:2 : 3 ^ 3)''

Try it online!

And the reduced one:

'Hello, World!'(:    )'

Try it online!

Explanation:

The initial code has the letters in the string duplicated, so that we're left with Hello, World! when every second is removed. Some spaces are added to ensure the brackets and apostrophes are kept.

The indexing is really 1:2:end. There are 27 characters, and we can't use end or 27 since we must remove a character, so we go with 3 ^ 3 instead. When we remove every third character, the indexing becomes (:) (and some additional spaces).

(:) means "flatten and turn into a vertical vector". So, we need to transpose it, using '. We don't need to transpose the string in the original code, but double transposing works, so the first string is transposed twice using '', and the second is transposed just once.

Stewie Griffin

Posted 2017-06-26T20:07:15.810

Reputation: 43 471

6

Help, WarDoq!, 2 bytes

Hi

Try it online!

H prints Hello, World!, i is a no-op.

Help, WarDoq! can add two numbers and test for primes, so it is considered as a valid programming language per this meta post.

Uriel

Posted 2017-06-26T20:07:15.810

Reputation: 11 708

why was this downvoted? – Uriel – 2017-07-01T22:33:13.253

NOP and massive spaces are against the spirit. – RShields – 2017-07-03T00:09:50.697

1+1 because of the novelty on how the resulting source code re-emphasizes the message that gets output. – TOOGAM – 2017-07-04T09:53:21.023

6

///, 25 bytes

H\e\l\l\o\,\ \W\o\r\l\d\!

Try it online!

With every other character removed:

Hello, World!

jimmy23013

Posted 2017-06-26T20:07:15.810

Reputation: 34 042

6

APL (Dyalog), 35 34 bytes

-1 thanks to Martin Ender.

'0H0e0l0l0o0,0 0W0o0r0l0d0!0'~ ⍕ 0

Try it online!

'0H0e0l0l0o0,0 0W0o0r0l0d0!0' the message with zeros as removable filler characters

~ except

 formatted (stringified)

0 number zero

Leaving just the odd characters, this becomes 'Hello, World!' .

Adám

Posted 2017-06-26T20:07:15.810

Reputation: 37 779

6

PHP, 53 bytes

#
echo date(
$e_c_h_o='\H\e\l\l\o\,\ \W\o\r\l\d\!
');

With every other character removed:

#eh ae
echo'Hello, World!';

user63956

Posted 2017-06-26T20:07:15.810

Reputation: 1 571

5

,,,, 34 bytes

 2"Hteoltlaol,l yWhourmladn!! "⟛

On removing the even numbered characters...

 "Hello, World!"

Explanation

With all the characters:

 2"..."⟛

               no-op
 2             push 2 to the stack
  "..."        push "Hteoltlaol,l yWhourmladn!! " to the stack
       ⟛      pop 2 and the string and push every 2nd character of the string
               implicit output

Without the even numbered characters:

 "..."

               no-op
 "..."         push "Hello, World!" to the stack
               implicit output

totallyhuman

Posted 2017-06-26T20:07:15.810

Reputation: 15 378

5This implies you don't need to say this is non-competing. – FryAmTheEggman – 2017-06-26T20:54:20.773

2But you're supposed to keep all of the even-indexed characters... (0-indexed)... – HyperNeutrino – 2017-06-26T21:06:24.977

Whoops, fixed. Just add another character lol. – totallyhuman – 2017-06-26T21:15:40.810

5

T-SQL, 75 bytes

---
PRINT 'Hello, World!'
/*
-P-R-I-N-T-'-H-e-l-l-o-,- -W-o-r-l-d-!-'
---*/

Single- and multi-line comment abuse, inspired by CalculatorFeline's LUA version.

After removal of all even-numbered characters, some of which are line breaks:

--PIT'el,Wrd'/
PRINT'Hello, World!'--/

BradC

Posted 2017-06-26T20:07:15.810

Reputation: 6 099

5

Javascript, 73 bytes

a ='a0l0e0r0t0`0H0e0l0l0o0,0 0W0o0r0l0d0!0`0/0/';eval(a.replace(/0/g,''))

Constructs a string a with the content a0l0e0r0t0`0H0e0l0l0o0,0 0W0o0r0l0d0!0`0/0/, then removes all 0's to give alert`Hello, World!`//, which is eval'd.

Taking every other character of the program gives

a=alert`Hello, World!`//;vlarpae//,')

which alerts Hello, World using template string syntax the same way as what was eval'd in the full program, then stores the result of the call in a and includes the insightful comment //;vlarpae//,').

jrich

Posted 2017-06-26T20:07:15.810

Reputation: 3 898

5

><>, 47 bytes

Original:

| v~" H e l l o ,   W o r l d ! "

~o<< ;!!!? l

With every second character removed:

|v"Hello, World!"
o<;!?l

Try them online: original, modified

The original program pushes the characters of "Hello, World!" to the stack (in reverse order) interspersed with spaces, then alternately prints a character and deletes one until the length of the stack is zero. The second program does the same, except the deletion instructions ~ are gone.

If you don't mind halting with an error, we can take a leaf out of Martin Ender's Cardinal book: the modified code is

\"!dlroW ,olleH"!#o#

and the original is the same but with newlines inserted between all the characters, for 39 bytes. Try them online: original, modified.

Not a tree

Posted 2017-06-26T20:07:15.810

Reputation: 3 106

4

Jelly, 32 bytes

 2“HHeelllloo,,  WWoorrlldd!! ”m

Try it online!

-2 bytes thanks to @totallyhuman's answer

Now mine is a dupe >.<

Go upvote that one too :D

HyperNeutrino

Posted 2017-06-26T20:07:15.810

Reputation: 26 575

4

dc, 112

 6   C * P
A d * 1 + d P
7 + d P
d P
3 + d P
B   4 * d P
C - P
F   6 * 3 - P
d P
3 + d P
6 - d P
8 - P
B   3 * P

All odd-indexed characters are whitespace that don't affect the output of the program. Character values are built arithmetically from single digits

Try it online.

Digital Trauma

Posted 2017-06-26T20:07:15.810

Reputation: 64 644

4

Brainfuck, 155 bytes

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

Try it online!

Every second character removed:

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

Uriel

Posted 2017-06-26T20:07:15.810

Reputation: 11 708

4

Java 8, 245 243 241 239 238 237 bytes (full program)

/**/interface M{static void main(String[]a){System.out.print("Hello, World!");}}//**/ iinntteerrffaaccee  MM{{ssttaattiicc  vvooiidd  mmaaiinn((SSttrriinngg[[]]aa)){{SSyysstteemm..oouutt..pprriinntt((""HHeelllloo,,  WWoorrlldd!!""));;}}}

Try it online.

After removing every other character:

/*itraeMsai odmi(tig])Sse.u.rn(Hlo ol!)}/*/interface M{static void main(String[]a){System.out.print("Hello, World!");}}

Try it online.

-2 bytes (243 → 241) thanks to @OlivierGrégoire.
-2 bytes (241 → 239) by creating a port of @SuperStormer's JavaScript answer.


Java 8, 63 bytes (lambda function)

/**/v->"Hello, World!"//**/vv-->>""HHeelllloo,,  WWoorrlldd!!""

Try it online.

After removing every other character:

/*v>Hlo ol!/*/v->"Hello, World!"

Try it online.

Explanation:

Utilizes //abc single-line comments and /*abc*/ multi-line comments.
See the Java-highlighting of the two programs/functions to see how these type of comments are used.

Kevin Cruijssen

Posted 2017-06-26T20:07:15.810

Reputation: 67 575

4

My naive solution

C/C++, 111 105 byes 97 bytes

(6 bytes saved using "puts", inspired by Hawkings)

///
f(){puts("Hello, World!");}
#define x\
_f_(_)_{_p_u_t_s_(_"_H_e_l_l_o_,_ _W_o_r_l_d_!_"_)_;_}

After takeaway

//f)pt(Hlo ol!)}#eiex 
f(){puts("Hello, World!");}

hucancode

Posted 2017-06-26T20:07:15.810

Reputation: 199

4

Befunge-93, 43 41 bytes

"#!>d l r o:W$ #,#o l l e H#"#>#:###, _ @

Try It Online

Second version

"!dlroW ,olleH">:#,_@

is the shortest possible "Hello World!". This therefore is literally the shortest answer to this question for Befunge-93.

Try It Online

Jo King

Posted 2017-06-26T20:07:15.810

Reputation: 38 234

That's brilliant! Much better than my Befunge answer. Can't believe you haven't got any votes for this. – James Holderness – 2017-12-20T00:06:43.240

3

Befunge-98, 39 bytes

"" '!'d'l'r'o'W' ','o'l'l'e'H ""c k , @

Try it online!

Every second character removed:

" !dlroW ,olleH"ck,@

Try it online!

ovs

Posted 2017-06-26T20:07:15.810

Reputation: 21 408

3

Standard ML (MLton), 75 bytes

(*p r i n t " H e l l o ,   w o r l d ! " ( *)print"Hello, world!"(*  * )*)

Try it online!

After removing every other character, we have:

(print"Hello, world!"(*pitHlo ol!( *))

Try it online!

Just exploits the fact that comments are a digraph.

musicman523

Posted 2017-06-26T20:07:15.810

Reputation: 4 472

3

Pip, 33 bytes

"0H0e0l0l0o0,0 0W0o0r0l0d0!0"RM 0

Removes the 0s from the string, leaving just Hello, World!. Try it online!

The every-other-character version:

"Hello, World!"M0

Uses the map operator to replace each character in 0 with the string "Hello, World!". Try it online!

DLosc

Posted 2017-06-26T20:07:15.810

Reputation: 21 213

3

TeX, 54 bytes

Full version:

 %H e l l o ,   W o r l d ! \ e n d%
Hello, World!\end

Every other character:

 Hello, World!\end
el,Wrd\n

A bit boring, but for completeness.

siracusa

Posted 2017-06-26T20:07:15.810

Reputation: 623

3

Alice, 37 bytes

"_!_d_l_r_o_W_ _,_o_l_l_e_H_"_d_&_o_@

Try it online!

Removing every other character gives:

"!dlroW ,olleH"d&o@

Try it online!

The way this works is that Alice's string mode doesn't push all cell values directly to the stack. Some characters have a special meaning. In particular, _ is a wall which retains it's control flow meaning even when in string mode. But a horizontal wall is a no-op when the IP moves horizontally, so none of those _ do anything. Hence, they can be safely removed.

Martin Ender

Posted 2017-06-26T20:07:15.810

Reputation: 184 808

3

Self-modifying Brainfuck, 39 bytes

< - [ . <<- ] " e m s p X ! - p m m f I

Try it online!

Explanation

For anyone that is not familir with self-modifying brainfuck: The program itself gets put into registers directly left to where you start out from. This allows for some cool stuff you can't do with regular brainfuck.

This program will move back two registers (one with every second char removed) increment it and output in until the loop stops. The loop will stop once you increment the char that ends the loop itself thus making brainfuck ignore it.

Version without every second character:

 <-[.<-]"emspX!-pmmfI     

Datboi

Posted 2017-06-26T20:07:15.810

Reputation: 1 213

3

Japt, 25 23 bytes

Saved 2 bytes thanks to @Shaggy

`\H\e\¥\o\,\ \W\Ž\l\d\!

Try it online!

This seems to be the optimal compressed string that would output Hello, World! while ignoring every other \.

Oliver

Posted 2017-06-26T20:07:15.810

Reputation: 7 160

2

PHP, 63 bytes

#
echo"Hello, World!";
#eecchhoo""HHeelllloo,,  WWoorrlldd!!"";

Try it online!

PHP, 32 bytes

#eh"el,Wrd"
echo"Hello, World!";

Try it online!

Jörg Hülsermann

Posted 2017-06-26T20:07:15.810

Reputation: 13 026

2

05AB1E, 32 bytes

"
H
e
l
l
o
,

W
o
r
l
d
!
"¶ K

Basically the "s make a string, and the ¶ K removes all newlines.

Try it online!

Version with even characters removed, 16 bytes.

"Hello, World!" 

Try it online!

Oliver Ni

Posted 2017-06-26T20:07:15.810

Reputation: 9 650

Actually, the even characters are removed, not the odd ones. – Okx – 2017-06-27T09:58:39.883

Just remove the first space. Then everything works out and you can save a byte in the process :) – Datboi – 2017-06-27T10:05:02.043

My bad, fixing... – Oliver Ni – 2017-06-27T15:47:28.287

2

Braingolf, 42 40 bytes

#"#H#e#l#l#o#,# #W#o#r#l#d#!#" $_ <$_& @

Try it online!

After removing odd characters:

"Hello, World!"$ $&@

Try it online!

Explanation

Full program:

#"#H#e#l#l#o#,# #w#o#r#l#d#!#" pushes "Hello, World!" (including quotes)

$ adds the silent modifier to the next operator
space does nothing
_ Pops and prints the last item on the stack, but due to silent mode, does not print
< moves the first item on the stack to the end of the stack

This means that $_ <$_ will remove both quotes from the stack

& adds the greedy modifier to the next operator
@ pops and prints the last item on the stack as an ASCII character
  greedy modifier means it prints the entire stack.

With characters removed:

"Hello, World!" Pushes Hello, World!
Spaces are no-ops
&@ Prints entire stack as ASCII
@ is not affected by the silent modifier (apparently)

It feels really cheap using no-ops for this, but it's better than the Java/Python comment solutions imo

Skidsdev

Posted 2017-06-26T20:07:15.810

Reputation: 9 656

2

Noodel, 25 bytes

Hðeðlðlðoð,ð¤ðWðoðrðlðdð!

Try it:)


How it works

Hðeðlðlðoð,ð¤ðWðoðrðlðdð! # The ð character breaks the string into an array and pushes the array ["H", "e", "l", "l", "o", ",", "¤", "W", "o", "r", "l", "d", "!"].
                          # Implicitly printed to the screen (¤ is the space).

Without every other character gives you :

Hello,¤World!

<div id="noodel" code="Hðeðlðlðoð,ð¤ðWðoðrðlðdð" input="" cols="12" rows="2"></div>

<script src="https://tkellehe.github.io/noodel/noodel-latest.js"></script>
<script src="https://tkellehe.github.io/noodel/ppcg.min.js"></script>

tkellehe

Posted 2017-06-26T20:07:15.810

Reputation: 605

2

Lua, 85 bytes

I decided to try making a function copying Lua answer. It's slightly shorter than the comment abuse submission.

paints= p_r_i_n_t----
print("Hello, World!")

paints( " H e l l o ,   W o r l d ! " )

Try it online!

Alternated:

pit=print--pit"el,Wrd"
pit("Hello, World!")

Try it online!

Alternator script is in my other answer.

CalculatorFeline

Posted 2017-06-26T20:07:15.810

Reputation: 2 608

2

C, 111 101 bytes

10 bytes saved thanks to Jasen

Full version:

//*
main(){puts("Hello, World!");}
//**// m a i n ( ) { p u t s ( " H e l l o ,   W o r l d ! " ) ; }

Every other character

/*mi({us"el,Wrd";
/*/main(){puts("Hello, World!");}

Hawkings

Posted 2017-06-26T20:07:15.810

Reputation: 191

2

shell (ksh), 58 bytes

 #e c h o   H e l l o ,   W o r l d ! #
echo Hello World!

(in interactive bash, you'd need to add '\' before the '!')

Olivier Dulac

Posted 2017-06-26T20:07:15.810

Reputation: 209

2

JavaScript (ES6), 66 bytes

/ /;alert`Hello, World!`
'a l e r t ` H e l l o ,   W o r l d ! `'

//aetHlo ol!
alert`Hello, World!`

darrylyeo

Posted 2017-06-26T20:07:15.810

Reputation: 6 214

2

Python 2, 73 bytes

print"=#0##Hello, World!"[5:] 
#portionate ""IHeeelallof,A TWookralade!?"

Try it online!

Python 2, unfortunately doesn't have that nifty trick the Python 3 answer used :( So I did the obvious comment trickery. "Try it online" code provides the halved version and execs it to make checking easier.

Halved version:

pit=0#el,Wrd"5] 
print "Hello, World!"

Coty Johnathan Saxman

Posted 2017-06-26T20:07:15.810

Reputation: 280

2

Ruby, 58 bytes

$/>%< <> > ;puts a= %w( H e l l o ,\  W o r l d ! )* "#{}"

Which becomes:

$><<  pt =%(Hello, World!) #}

I borrowed the puts/assignment trick from @G B's solution

Explanation:

The first version compares the ruby global $/ which evaluates to \n to the string " <> " and does nothing with it. Then it creates an array of all the characters in "Hello, World!" and joins them by multiplying by empty string

The second pushes the return value of assignment of the string "Hello, World!" (which happens to be "Hello, World!" directly to $> which is the global for standard out.

Try it online!

Alexis Andersen

Posted 2017-06-26T20:07:15.810

Reputation: 591

2

JavaScript (ES6), 65 bytes

Latecomer to the game...

01?alert`Hello, World!` : a_l_e_r_t ` H e l l o ,   W o r l d ! `

Becomes:

0?lr`el,Wrd`:alert`Hello, World!`

Obviously, neither the a_l_e_r_t function nor the lr function does exist. That's OK, because their respective code paths are never executed.

Demo

let code0 = "01?alert`Hello, World!` : a_l_e_r_t ` H e l l o ,   W o r l d ! `";
let code1 = code0.replace(/../g, s => s[0]);

console.log(code0);
eval(code0);
console.log(code1);
eval(code1);

Arnauld

Posted 2017-06-26T20:07:15.810

Reputation: 111 334

2

Befunge-93, 51 bytes

Inspired by Martin's Cardinal solution, I thought it might be fun to try and do something vertical in Befunge as well. It's a little more complicated in Befunge though.

?
"
!
d
l
r
o
W

,
o
l
l
e
H
" :
>>:v$
#^,__@@
v >

Try it online!

We start with a ?(random direction) command, which can potentially send the instruction pointer in any direction. Left and right will just wrap around back to the start, and going up will hit the v at the bottom of the program and reflect back to the start as well. So while we may bounce around for a while, we'll eventually be forced down at some point, pushing the "Hello, World!" string (in reverse) onto the stack. Which brings us to this sequence:

>>:v
 ^,__@

This is just a simple output loop that writes out the string on the stack. The only thing out of the ordinary is the extra _ (branch) when the loop terminates. But because there are only zeros on the stack at that point, the second test will safely continue on to to the right, finishing with the @ (exit) command.


Once we remove every second character, the code looks like this:

?"!dlroW ,olleH":>:$#,_@v>

Try it online!

Again we start with a ?(random direction) command, and again most directions will just end up wrapping back to the start. So eventually we're forced to go to the right, pushing "Hello, World!" (in reverse) onto the stack. Which then brings us to this sequence:

:>:$#,_@

Again this is just a loop outputting the string on the stack. It's very similar to the classic inline print loop, but we've got an extra : (dup) command, and thus require a $ (drop) to cancel it out.

James Holderness

Posted 2017-06-26T20:07:15.810

Reputation: 8 298

2

Stax, 33 bytes

"zHzezlzlzoz,z zWzozrzlzdz!z"'z -

Run and debug it

Every other character, 17 bytes

"Hello, World!"z-

Run and debug it

In the first version, 'z - remove all zs from the string. In the second version, z by itself is empty set, and z- is noop.

Weijun Zhou

Posted 2017-06-26T20:07:15.810

Reputation: 3 396

1

Pyth, 31 bytes

%y1t"pHEeGlGlhoz,e QwjolrDlBdJ!

eh

clap

Posted 2017-06-26T20:07:15.810

Reputation: 834

1

Forth, 61 bytes

This uses the fact that \ makes the rest of the line a comment.

 \  . (   H e l l o ,   W o r l d ! )   \
 .( Hello, World! )

Full program

Remove every other byte to get:

  .( Hello, World!) \ (Hlo ol!)

Every other

mbomb007

Posted 2017-06-26T20:07:15.810

Reputation: 21 944

1

Ruby, 63 bytes

puts a= 'Hello, World!'#; p u t s ' H e l l o ,   W o r l d ! '

Which becomes:

pt ='el,Wrd';puts'Hello, World!'                    

(Abusing comments like a lot of people do)

Try it online!

G B

Posted 2017-06-26T20:07:15.810

Reputation: 11 099

Very cool, I couldn't think about any way to write it in Ruby. Here's another way to Try it online

– Eric Duminil – 2017-06-28T14:42:32.830

61 bytes (Includes Eric Duminil's test suite) – Value Ink – 2017-06-30T02:51:38.573

1

Python 2, 63 bytes

#
print'Hello, World!'
#p r i n t ' H e l l o ,   W o r l d ! '

Try it online!

After transformation, this becomes:

#pitHlo ol!
print'Hello, World!'

Erik the Outgolfer

Posted 2017-06-26T20:07:15.810

Reputation: 38 134

1

Japt, 32 28 bytes

Wrote this up and then noticed Oliver beat me to it with the same method in 05AB1E.

Note: The empty line after the comma contains a space character and the empty line after the "W" contains an unprintable.

`
H
e
¥
o
,

W

l
d
!
` rR

Test it

With every second character removed, it becomes (with the unprintable still present between the "W" and the "l"):

`He¥o, Wld!`r

Test it

Shaggy

Posted 2017-06-26T20:07:15.810

Reputation: 24 623

1

Swift, 77 bytes

/**/print("Hello, World!")//  * / p r i n t ( " H e l l o ,   W o r l d ! " )

Every other character:

/*pit"el,Wrd"/ */print("Hello, World!")

Herman L

Posted 2017-06-26T20:07:15.810

Reputation: 3 611

1

LOGO, 63 bytes

 ;p r [ H e l l o ,   W o r l d ! ] e r [
 pr[Hello, World!] ;]

With characters at even index removed

 pr[Hello, World!]er[ rHlo ol! ]

Explanation:

; starts an inline comment in Logo. Therefore the first program is equivalent to

 pr[Hello, World!] 

which obviously print "Hello, World!".

In the second program, a function er is invoked. er stands for erase, receive a list in a suitable format as input, and erase some contents specified in the list (the details does not matter). The key point is that er does not return anything, so it is a shorter alternative to ignore, which ignores its contents.

user202729

Posted 2017-06-26T20:07:15.810

Reputation: 14 620

1

x86 machine code, 73 bytes

Inspired by Евгений Новиков's solution, I thought it should be doable with less tricks, i.e., just jumping around to otherwise "disjoint" codes for all three variants. I'm still trying with a smart variant that uses lodsb; lodsb as central point (so only one string constant is needed for all variants)

EB 14 00 00 8A 8A 17 16 01 01 B4 B4 09 09 CD CD
21 21 CD CD 20 20 8A 1f 01 B4 09 CD 21 CD 20 48
65 6c 6c 6f 2c 20 57 6f 72 6c 64 21 00 48 48 65
65 6c 6c 6c 6c 6f 6f 2c 2c 20 20 57 57 6f 6f 72
72 6c 6c 64 64 21 21 00 00

If I recall correctly from my childhood days, COM's tiny model starts with DS=CS=SS and the code is loaded beginning from CS:0100h. I do not assume it is guaranteed that the code is loaded into a zeroed memory block (if it were guaranteed, I could drop two bytes).

Disassembly of the long code should be

  JMP *+14h
  ; 20 irrelevant bytes
  MOV DX,message
  MOV AH,09h
  INT 21h;  print string pointed to by DS:DX
  INT 20h;  exit program
message:
  DB "Hello, World!\0"
  DB "HHeelllloo,,  WWoorrlldd!!\0\0"

Disassembly of odd code

  JMP *+00h
  MOV DX,message
  MOV AH,09h
  INT 21h;  print string pointed to by DS:DX
  INT 20h;  exit program
  ; some irrelevant bytes
message:
  DB "Hello, World!\0"

Disassembly of even code:

  ADC AL,00h
  MOV DX,message
  MOV AH,09h
  INT 21h;  print string pointed to by DS:DX
  INT 20h;  exit program
  ; some irrelevant bytes
message:
  DB "Hello, World!\0"

Hagen von Eitzen

Posted 2017-06-26T20:07:15.810

Reputation: 371

1

Powershell, 46 bytes

Full version:

#
"Hello, World"
#" H e l l o ,   W o r l d " 

Try it online here

Every other character

#"el,Wrd
"Hello, World"

Try it online here

Doug Coburn

Posted 2017-06-26T20:07:15.810

Reputation: 141

1

Cubically, 155 bytes

R U + 4 3 2 @ 6 + 5 0 - 4 @ 6 + 3 - 4 @ 6 @ 6 + 1 - 0 0 @ 6 - 3 3 1 @ 6 - 0 0 @ 6 + 4 1 1 0 @ 6 + 0 0 0 0 @ 6 + 1 - 0 0 @ 6 - 0 @ 6 - 2 + 4 @ 6 - 3 3 1 @ 6

The new parser strips out all spaces ¯\_(ツ)_/¯ so either way the code is interpreted like this:

RU+432@6+50-4@6+3-4@6@6+1-00@6-331@6-00@6+4110@6+0000@6+1-00@6-0@6-2+4@6-331@6

Try it online! (spaced)

Try it online! (every other character)

MD XF

Posted 2017-06-26T20:07:15.810

Reputation: 11 605

1

Bash, 36 bytes

e\c\h\o  "H"e"l"l"o"," "W"o"r"l"d"!"

With every other character removed:

echo Hello, World!

Invalid escape sequences will be ignored, so \c\h\o makes no difference from cho.

iBug

Posted 2017-06-26T20:07:15.810

Reputation: 2 477

0

Stacked, 60 bytes

'Hello, World!'  '''H e l l o ,   W o r l d !''' @oouutt out

Try it online!

I generated the second code with this snippet. Second code is:

'el,Wrd' 'Hello, World!' out u

The first one generates two strings, Hello, World! and 'H e l l o , W o r l d !'. The latter is saved to variable oouutt, and the former is printed.

The second one generates two strings, outputs the second, then errors after encountering u.

Conor O'Brien

Posted 2017-06-26T20:07:15.810

Reputation: 36 228

0

Java 8, 123 122 bytes

Here is the full code

/**/()->System.out.print("Hello, World!")//_*_/_(_)_-_>_S_y_s_t_e_m_._o_u_t_._p_r_i_n_t_(_"_H_e_l_l_o_,_ _W_o_r_l_d_!_"_)_

Try it online here


Here is the 'every other' code

/*(-Sse.u.rn(Hlo ol!)/*/()->System.out.print("Hello, World!")

Try it online here

NonlinearFruit

Posted 2017-06-26T20:07:15.810

Reputation: 5 334

0

dc, 52 bytes

0#[#H#e#l#l#o#,# #W#o#r#l#d#!#]#P#q
[Hello, World!]P

Try it online!

The first line puts a zero on the stack, and then the rest of the line is commented out. The second line prints 'Hello, World!'

With every even character removed, all the #s in the first line disappear, and the line is no longer commented out. It then prints 'Hello, World!' and quits before hitting the second line.

brhfl

Posted 2017-06-26T20:07:15.810

Reputation: 1 291

0

Brainfuck 156 bytes

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

Christopher

Posted 2017-06-26T20:07:15.810

Reputation: 3 428

0

Ly, 38 bytes

"""!!ddllrrooWW  ,,oolllleeHH" [po ]

Try it online!

Explanation:

"""HHeelllloo,,  WWoorrlldd!!" [po ]

"""           # open a string literal, close it, then open one again
   ...        # push "HHeelloo,,  WWoorrlldd!!" backwards
      "       # close string literal
         [    # until the stack is empty
          po  # pop off the stack, then output
            ] # end loop

Every other character:

"!dlroW ,olleH"[o]

Try it online!

Explanation:

"!dlroW ,olleH"[o]

"!dlroW ,olleH"    # push "Hello, World!" backwards
               [o] # output until the stack is empty

LyricLy

Posted 2017-06-26T20:07:15.810

Reputation: 3 313

0

BotEngine, 91 bytes

 vv 
 v < 
 eHH 
 eee 
 ell 
 ell 
 eoo 
 e,, 
 e   
 eWW 
 eoo 
 err 
 ell 
 edd 
 e!! 
 P

SuperJedi224

Posted 2017-06-26T20:07:15.810

Reputation: 11 342