[comp.sys.amiga.programmer] Ok.Somebody Post a 20byte Hello World prg!!

epa@phobos.cis.ksu.edu (Eric P. Armstrong) (02/25/91)

J56QC@CUNYVM.BITNET writes:

>Ok..I would like to see a program That displays "HELLO WORLD" in 20bytes if tha
> is possible.....anyway write it in a language other that assembler(which is th
> best!) Thanks....


>                    By the way..the fastest and smallest prg's are
>                    written in assembler! No ifs ands or buts!


1> echo "Hello World"
Hello World

Nah! 17 bytes!  :-)


----
Eric Paul Armstrong                     Kansas State University 
   Bitnet:  ericpaul@ksuvm.bitnet  Internet: epa@phobos.cis.ksu.edu  

dac@prolix.pub.uu.oz.au (Andrew Clayton) (02/25/91)

In article <epa.667413611@phobos>, Eric P. Armstrong writes:

> J56QC@CUNYVM.BITNET writes:
> 
> >Ok..I would like to see a program That displays "HELLO WORLD" in 20bytes if tha
> > is possible.....anyway write it in a language other that assembler(which is th
> > best!) Thanks....
> 
> 
> >                    By the way..the fastest and smallest prg's are
> >                    written in assembler! No ifs ands or buts!
> 
              1 
     123456789012345678
> 1> echo "Hello World"
> Hello World
> 
> Nah! 17 bytes!  :-)
> 

Nah, 18. ;-) (19 with Ctrl-J)

Alias e echo
                  1
         1234567890123
2. Dac > e Hello_World
Hello_World

13 bytes. I tried aliasing 'h' to hello and 'w' to world, but that didn't
work, of course. :-)

The shortest way is just Hello_World all by itself, and the shell responds
with 'Unknown command Hello_world'

11 bytes. Not including the ^j at the end. :-)

Isn't this silly.

Dac
--

cedman@golem.ps.uci.edu (Carl Edman) (02/25/91)

In article <18bd40a0.ARN0184@prolix.pub.uu.oz.au> dac@prolix.pub.uu.oz.au (Andrew Clayton) writes:
   > 
                 1 
        123456789012345678
   > 1> echo "Hello World"
   > Hello World
   > 
   > Nah! 17 bytes!  :-)
   > 

   Nah, 18. ;-) (19 with Ctrl-J)

   Alias e echo
                     1
            1234567890123
   2. Dac > e Hello_World
   Hello_World

   13 bytes. I tried aliasing 'h' to hello and 'w' to world, but that didn't
   work, of course. :-)

   The shortest way is just Hello_World all by itself, and the shell responds
   with 'Unknown command Hello_world'

   11 bytes. Not including the ^j at the end. :-)

No, you can use. Just use
        alias e "echo hello world"
        e
Say 1 byte (+ ^J).

   Isn't this silly.

Very.

        Carl Edman

"We hold that what one man cannot morally do, a million men cannot
morally do, and government, representing many millions of men, cannot
do." -- Auberon Herbert
          Send mail to Carl Edman <cedman@golem.ps.uci.edu>

higgin@cbmvax.commodore.com (Paul Higginbottom - CATS) (02/26/91)

In article <91053.081053J56QC@CUNYVM.BITNET> J56QC@CUNYVM.BITNET writes:
$Ok..I would like to see a program That displays "HELLO WORLD" in 20bytes if tha
$ is possible.....anyway write it in a language other that assembler(which is th
$ best!) Thanks....

Here it is (ARexx)...

/**/
say hello world

hamlin@afit.af.mil (News System Account) (02/26/91)

cedman@golem.ps.uci.edu (Carl Edman) writes:

>No, you can use. Just use
>        alias e "echo hello world"
>        e
>Say 1 byte (+ ^J).

If that's 1 byte, then this one is zero bytes!?  :-)

	set prompt = "Hello world"
	^J

-- 
Joe Hamlin    <hamlin@blackbird.afit.af.mil>

dac@prolix.pub.uu.oz.au (Andrew Clayton) (02/26/91)

In article <19298@cbmvax.commodore.com>, Paul Higginbottom - CATS writes:

> In article <91053.081053J56QC@CUNYVM.BITNET> J56QC@CUNYVM.BITNET writes:
> $Ok..I would like to see a program That displays "HELLO WORLD" in 20bytes if tha
> $ is possible.....anyway write it in a language other that assembler(which is th
> $ best!) Thanks....
> 
> Here it is (ARexx)...
> 
> /**/
> say hello world

How about a really small ROT program in Arexx...

/*Rot 13 in REXX*/
Rotated = "nopqrstuvwxyzabcdefghijklm"
Normal  = "abcdefghijklmnopqrstuvwxyz"
PARSE ARG Input
Temp = Translate(Input,Rotated,Normal)
Say Translate(Temp,UPPER(Rotated),UPPER(Normal))

I used variables that were readable, and it's even got a comment, and is only
201 bytes long.

Well, I thought it was neat. :-/

Dac
--
David Andrew Clayton. // _l _  _ dac@prolix.pub.uu.oz.au    *or*|I post.I am.
Canberra, Australia.\X/ (_](_l(_ ccadfa.cc.adfa.oz.au!prolix!dac@munnari.oz

root@gallifrey.outbound.wimsey.bc.ca (Steve Lyons) (02/26/91)

In article <18be8cca.ARN1037@prolix.pub.uu.oz.au>, David Clayton writes:

>/*Rot 13 in REXX*/
>Rotated = "nopqrstuvwxyzabcdefghijklm"
>Normal  = "abcdefghijklmnopqrstuvwxyz"
>PARSE ARG Input
>Temp = Translate(Input,Rotated,Normal)
>Say Translate(Temp,UPPER(Rotated),UPPER(Normal))
>
>I used variables that were readable, and it's even got a comment, and is only
>201 bytes long.
>
>Well, I thought it was neat. :-/

It is, but not as neat as this:

/* Rot 13 Mark II */
rot = xrange('n', 'z')xrange('a', 'm')
norm = xrange('a', 'z')
say translate(arg(1), upper(rot)rot, upper(norm)norm)

That does both upper and lower case in one go and is only 138 bytes.  :-)
I fear we're about to be caught in a deluge of dimutive ARexx programs and
people telling their authors to stop posting them, but I couldn't resist.

Steve Lyons (root@gallifrey.outbound.wimsey.bc.ca)

dac@prolix.pub.uu.oz.au (Andrew Clayton) (02/28/91)

In article <root.0029@gallifrey.outbound.wimsey.bc.ca>, Steve Lyons writes:

> In article <18be8cca.ARN1037@prolix.pub.uu.oz.au>, David Clayton writes:
> 
> >/*Rot 13 in REXX*/

[poor version deleted]

> >201 bytes long.
> >
> >Well, I thought it was neat. :-/
> 
> It is, but not as neat as this:
> 
> /* Rot 13 Mark II */
> rot = xrange('n', 'z')xrange('a', 'm')
> norm = xrange('a', 'z')
> say translate(arg(1), upper(rot)rot, upper(norm)norm)

Cute. I didn't read past 'translate' in my manual. :-). For a first time
effort, I did alright.

I also got it down to one translate operation :

/*Rot 13 in REXX*/
Rotated = "nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM"
Normal  = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
PARSE ARG Input
Say Translate(Input,Rotated,Normal)

But it's still 201 bytes. :-), and nowhere near as neat as yours.

Mine is more readable though. Ack Thptptpt. :-) :-)

> I fear we're about to be caught in a deluge of dimutive ARexx programs and
> people telling their authors to stop posting them, but I couldn't resist.

Hey, I don't MIND learning more Arexx tricks.

> Steve Lyons (root@gallifrey.outbound.wimsey.bc.ca)

Dac
--