Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

99... (hint: not red baloons)

16 views
Skip to first unread message

Douglas Hunter

unread,
Mar 19, 2003, 5:38:01 PM3/19/03
to perl6-i...@perl.org
Thank you everyone for bringing this fun tool to such a useful state so
quickly. The progress Parrot has shown is impressive. I offer you my
thanks in probably not-so-elegantly written pasm emitted song and drink.

-- dug

99_bottles.pasm

Robert Spier

unread,
Mar 19, 2003, 6:37:44 PM3/19/03
to Douglas Hunter, perl6-i...@perl.org

Someone please stick this man's ditty into the examples directory :)

-R!

Benjamin Goldberg

unread,
Mar 20, 2003, 2:14:44 AM3/20/03
to perl6-i...@perl.org
Douglas Hunter wrote:
[snip]
> branch ONE_BOTTLE # 'bout time for a liver transplant
>
> ONE_BOTTLE: # it's been fun

The ONE_BOTTLE label isn't gone to by anything else in the program, and
the one instruction which does go to it, is immediately before it.

So, what's the reason for it?


--
$a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca
);{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print "$@[$a%6
]\n";((6<=($a-=6))?$a+=$_[$a%6]-$a%6:($a=pop @b))&&redo;}

Leopold Toetsch

unread,
Mar 20, 2003, 3:05:14 AM3/20/03
to Benjamin Goldberg, perl6-i...@perl.org
Benjamin Goldberg wrote:

> Douglas Hunter wrote:
> [snip]
>
>> branch ONE_BOTTLE # 'bout time for a liver transplant
>>
>>ONE_BOTTLE: # it's been fun
>>
>
> The ONE_BOTTLE label isn't gone to by anything else in the program, and
> the one instruction which does go to it, is immediately before it.
>
> So, what's the reason for it?


Optimizer test?

$ imcc -O1p -d60 beer.pasm 2>&1 | head
dead branch deleted N_BOTTLES:
dead branch deleted ONE_BOTTLE:
block 4 label ONE_BOTTLE deleted
99 bottles of beer on the wall,

SCNR,
leo

Douglas Hunter

unread,
Mar 20, 2003, 9:39:45 AM3/20/03
to perl6-i...@perl.org
Benjamin Goldberg wrote:

> The ONE_BOTTLE label isn't gone to by anything else in the program, and
> the one instruction which does go to it, is immediately before it.
>
> So, what's the reason for it?
>
>

Lack of experience. Thanks for the pointer.

-- dug

Leopold Toetsch

unread,
Mar 21, 2003, 6:21:04 AM3/21/03
to Douglas Hunter, perl6-i...@perl.org
Douglas Hunter wrote:

Thanks, applied.
leo

0 new messages