Super Small Hello World

Discussion of challenges you have already solved
Post Reply
User avatar
m!nus
Posts: 202
Joined: Sat Jul 28, 2007 6:49 pm
Location: Germany

Super Small Hello World

Post by m!nus »

Code: Select all

Hello, World!%0@s!@@@@@~01^gP1+$
Could it look any different? I'd like to see your solutions please (i bet there can't be a very small of this, so it's save)
User avatar
efe
Posts: 45
Joined: Sun Oct 26, 2008 10:28 am
Location: germany

Post by efe »

I have the same solution as m!nus!
User avatar
m!nus
Posts: 202
Joined: Sat Jul 28, 2007 6:49 pm
Location: Germany

Post by m!nus »

again! *checks for keyloggers* -- oh wait, last time you had it before me :D

now i only have fast strrev and sorting left, the hardest ones :/
both will maybe work with threading :/
ShardFire
Posts: 26
Joined: Wed May 30, 2007 4:26 pm
Location: United Kingdom

Post by ShardFire »

That would be identical to mine too! Any variants?
User avatar
efe
Posts: 45
Joined: Sun Oct 26, 2008 10:28 am
Location: germany

Post by efe »

I tried a different method. I managed to print "Hello, World" using 29 instructions.
Only one char is missing !
User avatar
Yharaskrik
Posts: 31
Joined: Wed Nov 05, 2008 11:44 am
Location: Germany

Post by Yharaskrik »

Ufffff...

I finally got it. And I did it in 2 lines of code!

Thanks for your sharings - sometimes THE one idea to solve something (in 1 line) doesn't
come to ones mind...

Here is my solution:

Code: Select all

/Èåììï¬ ×ïòìä¡\
\%4]1+76+02^gP:!
The characters between / and \ in the first line are the "Hello, World!" characters +128.

I needed 3 days to find the tricky 4] solution ;)

By the way... I would like to see more discussions about different solutions in the solved section.
Okay, we have to be carefull about future challenges.
But I use this site to learn something and not to be on top of the list (, if so I had to hide my solution).

What do you think?

Best regards,
Yharaskrik
User avatar
Yharaskrik
Posts: 31
Joined: Wed Nov 05, 2008 11:44 am
Location: Germany

Post by Yharaskrik »

Hey, efe!

Did my solution help you to shorten your solution? :D

When I saw that I cannot see my own posting in the forum
(I really don't like these "King of the Hill" challenges :( )
I had to start working again...
User avatar
efe
Posts: 45
Joined: Sun Oct 26, 2008 10:28 am
Location: germany

Post by efe »

Yharaskrik, in fact, your clever solution helped me shortening the 1-liner ! Thank you!

Here is my solution:

Code: Select all

9@s!@@@@@Èåììï¬ ×ïòìä¡01^gP1+$
arthur
Posts: 21
Joined: Fri Jul 23, 2010 12:44 pm

Post by arthur »

This is one of my solutions.

Code: Select all

0@H@e@l@l2o+,1 ^Wgo8r1l^d?!P$
There is an invisible char in the code so that the size is 30 :(
harvestsnow
Posts: 8
Joined: Mon Nov 21, 2011 9:15 pm

Post by harvestsnow »

Amazing puzzle!

My first idea was to use numeric representation, pushing digits on the stack and converting them into ascii chars. This is pseudo-base-9:

Code: Select all

10574819781600317848486744@s!@@@@@ 9*+84*+P$
Obviously this method couldn't satisfy the 29-char constraint.
It took me some time to realize that the data could be embedded in the code and find the 32 chars solution that m!nus posted.

Seeking further, I tried to alternate the instructions and the data chars, as arthur did, unfortunately loosing control on the loop. This one has 29 chars but it loops 16 times and so prints 3 extra trailing null bytes:

Code: Select all

4@s!H@e@l@l@o2,2 ^WgoPr+lsd$!
Working again on the 'easy' solution, I could go down to 30 with the MSB trick by dropping the '%' and taking advantage of the ',':

Code: Select all

Hello, Worlä¡@s!@@@@@ 01^gP1+$
and finally I found how to drop the useless space that was bothering me since the beginning:
9@s!@@@@@Hello, Worlä¡1^gP1+$
Probably the unique solution, modulo trivial modifications (unless someone finds a voodoo thread-trick).
User avatar
Hippo
Posts: 339
Joined: Sat Feb 01, 2014 12:05 am
Location: Praha 5

Post by Hippo »

Yes, I got the same at the end.
harvestsnow wrote:

Code: Select all

9@s!@@@@@Hello, Worlä¡1^gP1+$
I got following 30 chars solutions ... in order of finding:

Code: Select all

2@H@e@l@lxo5,2 ^WgoPrxl*d?!2+$

Code: Select all

\
@
2
@
H
@
e
@
l
2
l
+
o
x
,
g
 
P
W
x
o
3
r
9
l
*
d
?
!
$

Code: Select all

Hello, Worlä¡@s!@@@@@ 01^gP1+$

Code: Select all

\
H
e
l
l
o
,
 
W
o
r
l
ä
¡
@
s
!
@
@
@
@
@
 
1
+
x
0
g
P
$
Grrr ... it would be so easy if one would read the state of the thread at the time it was on 30... with optimal layout already mentioned ...
arthur wrote:This is one of my solutions.

Code: Select all

0@H@e@l@l2o+,1 ^Wgo8r1l^d?!P.$
(asc(.)<9)
This solution was very close to mine ... using all working characters of the result.
Post Reply