Hello world! with NO repetition
Perl 6 (29 28 characters)
This was somewhat annoying, but I finally managed to make a program for this task. Thanks go to the great #perl6 community, for helping me with this task. It took me two hours, hope you enjoy. The output is completely up to specification, including a newline.
say
Q[@A`DO world!]~|<HeLhg>
There are four tokens of interest.
say
This outputs the argument with new line at end. The new line after the command itself is needed as a space replacement.
Q[@A`DO world!]
This is the first string.
Q[]
is for raw strings (liker""
in Python). It can take any delimiter (or pair of them), in this case[]
. In this case, I use this for quotes, I don't need raw string behavior.~|
This is stringwise (
~
) bitwise or (|
) operator.<HeLhg>
<>
is list literal, which takes space separated list of elements. In this case, it has one element, and used as a scalar, it gives a string.
Perl 5 with -M5.010
, 29 bytes
say+He.v108
x2,q(O world!)^$"
Try it online!
I've gained a lot of knowledge since I first attempted this. Still not as short as the other answers, but the best I can come up with!
Perl 5.10+: 24 chars
say+He,YZX^q(567 world!)
OK, I think this is as short as it gets in Perl.
Run with perl -M5.010
(or just perl -E
) to enable the Perl 5.10+ say
feature.