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

SECOND minichallenge on date functions.

8 views
Skip to first unread message

Wolfgang Rautenberg

unread,
Jun 17, 2003, 1:13:29 PM6/17/03
to
Hallo all,
the new edition of Timeman contains also a fast and comfortable alarm
setter. It allows repeating an alarm after precisely one (or several)
year(s), to remind on birthdays, say. "one year later" means here: the
alarm repeats at the *same day of the same month* one year later. Alarms
set on the 29th of a February follow the "Birthday rule", i.e., a year
later is the 1st of March next year. This type of alarm setting cannot
be done on the 49 in the standard way. Hence the following

CHALLENGE. Write a shortest program in (a) UsrRPL program (b) SysRPL
whose input is a whole number n in Level2 and a DATE real in Level1, and
whose output is the correct date n years later as explained above.

CONDITIONS: The program should be independent on the date flag -42. Only
supported pointers and named rompointers are allowed. The input DATE can
be any real accepted by ->DATE. The output must be correct as long as <<
DATE n 365. * DATE+ >> does not error. Argument checking is not
required. The number in Level2 is a positive real with fractional part
0. TIME is not considered in the challenge.

- Wolfgang
ftp://ftp.math.fu-berlin.de/pub/usr/raut/HP49/time/Timeman/Timeman.htm

BlackLotus

unread,
Jun 17, 2003, 9:09:18 PM6/17/03
to
I can't remember the name of the program made in the previous challenge
(calculate the number of days in a month), so I'll use nDays as that program
name. My attempt uses that program.

<< DUP DUP nDays 29 == SWAP 1 DATE+ nDays 31 == AND -> test
// We just tested if we were a Feb 29th
<< test {1 DATE+} IFT
//If it's the case, we work with March 1st for calculation
DUP 3 ROLL 1 SWAP FOR i i 4 MOD
// Every 4 years is expected as a leap year
0 == {366} {365} IFTE DATE+ NEXT SWAP 2 PICK
//The next part corrects any missing/extra leap year that could have been
added
2 ->LIST IP EVAL -
// here we correct the Feb 29th back if it's a leap year, or leave it to
March 1st
1 - DATE+ DUP nDays 29 <> test NOT OR DATE+
>>
>>
I can't test it without said previous program though, nor say the size. I'll
rewrite that for sysRPL tomorrow, because 3am is too late to read through
the doc.
The problem is that a loop takes time for huge jumps (around 26 seconds for
a 1253 year jump test)

The loop is likely to be useless, I expect something like (with n on the
first level):
"DUP 4 / IP SWAP 365 * +" to make the same number of days added.

It should look like this:

<< DUP DUP nDays 29 == SWAP 1 DATE+ nDays 31 == AND ->test
// We just tested if we were a Feb 29th
<< test {1 DATE+} IFT
//If it's the case, we work with March 1st for calculation
DUP 3 ROLL DUP
// Every 4 years is expected as a leap year
4 / IP SWAP 365* + DATE+ SWAP 2 PICK
//The next part corrects any missing/extra leap year that could have been
added
2 ->LIST IP EVAL -
// here we correct the Feb 29th back if it's a leap year, or leave it to
March 1st
1 - DATE+ DUP nDays 29 <> test NOT OR DATE+
>>
>>


"Wolfgang Rautenberg" <ra...@math.fu-berlin.de> a écrit dans le message de
news:3EEF4C39...@math.fu-berlin.de...

Wolfgang Rautenberg

unread,
Jun 18, 2003, 4:50:25 AM6/18/03
to
BlackLotus wrote:
> // here we correct the Feb 29th back if it's a leap year, or leave it to
> March 1st

If started from a 29th of February, 1, 2 or 3 years later means the 1st
of March, i.e., the same day as if you'd started from the 1st of March.
To simplify things, no return to a 29th of February is demanded also in
the general case. Thus, even 1000 years later deviates from a 29th of
February in at most one day. Call this the simple solution in contrast
to the "remember-solution" (return to a 29th of February if started on
that day). This will certainly cost a lot of extra bytes.

- Wolfgang
ftp://ftp.math.fu-berlin.de/pub/usr/raut/HP49/time/Timeman/Timeman.htm

Thomas Rast

unread,
Jun 18, 2003, 7:20:29 AM6/18/03
to
Wolfgang Rautenberg <ra...@math.fu-berlin.de> writes:

> CHALLENGE. Write a shortest program in (a) UsrRPL program (b) SysRPL
> whose input is a whole number n in Level2 and a DATE real in Level1, and
> whose output is the correct date n years later as explained above.

How about

::
%0 DATE+DAYS
SWAP %-6 ALOG %+ %*
%0
ERRSET
DATE+DAYS
ERRTRAP
::
DROP
%100 %1/ %1+ %+
%5 %6 %* %1-
DATE+DAYS
;
;

It's possible to do the same in UserRPL, but the IFERR..THEN..END
construct, the program delimiters and the reals 1.01 and 29 take extra
space.

Bytes (compiled): 62.5
HP49 Checksum: #BDC8h

Greetings
Thomas

--
Thomas Rast <t.r...@freesurf.ch>
"There is no way to peace. Peace is the way!"
-- Gandhi

Werner Huysegoms

unread,
Jun 18, 2003, 9:46:13 AM6/18/03
to
Wolfgang Rautenberg <ra...@math.fu-berlin.de> wrote in message news:<3EF027D1...@math.fu-berlin.de>...

first (working) try, and I took the liberty of changing the input sequence...
(seemed more logical to me? cfr. date days DATE+, now date years YEARS+)
68.0 CCCAh
In : date n
Out: date + n years
\<<
6. ALOG / SWAP
DUPDUP -2. ALOG MOD 3.03 + DDAYS 3. SAME
UNROT PICK3 NEG DATE+ + SWAP DATE+
\>>

It works for negative input years as well.
I can get it one byte shorter using 303 MANT io 3.03 ... oh well.

Cheers, Werner

Thomas Rast

unread,
Jun 18, 2003, 4:40:23 PM6/18/03
to
Thomas Rast <t.r...@freesurf.ch> writes:

> ::
> %0 DATE+DAYS
> SWAP %-6 ALOG %+ %*
> %0
> ERRSET
> DATE+DAYS
> ERRTRAP
> ::
> DROP
> %100 %1/ %1+ %+
> %5 %6 %* %1-
> DATE+DAYS
> ;
> ;

*Don't* try this, it's flawed and might well cause crashs. Sorry for
posting too quickly!

- Thomas

--

BlackLotus

unread,
Jun 18, 2003, 7:26:12 PM6/18/03
to

"Wolfgang Rautenberg" <ra...@math.fu-berlin.de> a écrit dans le message de
news:3EF027D1...@math.fu-berlin.de...

> BlackLotus wrote:
> > // here we correct the Feb 29th back if it's a leap year, or leave it to
> > March 1st
>
> If started from a 29th of February, 1, 2 or 3 years later means the 1st
> of March, i.e., the same day as if you'd started from the 1st of March.
> To simplify things, no return to a 29th of February is demanded also in
> the general case. Thus, even 1000 years later deviates from a 29th of
> February in at most one day. Call this the simple solution in contrast
> to the "remember-solution" (return to a 29th of February if started on
> that day). This will certainly cost a lot of extra bytes.

Taking what was said into account, I came up with this:
::
DUP %100 %* %IP DUP % 2902 // I haven't found how to downsize that real
%= SWAP %23 %10 %* %1- %= OR IT
:: %1 DATE+DAYS ;
SWAP %-6 %ALOG %* %+
;

73 bytes, crc #421h on my hp48+mk
>
> - Wolfgang
> ftp://ftp.math.fu-berlin.de/pub/usr/raut/HP49/time/Timeman/Timeman.htm


Werner Huysegoms

unread,
Jun 19, 2003, 8:15:15 AM6/19/03
to
werner-h...@freegates.be (Werner Huysegoms) wrote in message news:<44ec85ff.03061...@posting.google.com>...

>
> first (working) try, and I took the liberty of changing the input sequence...
> (seemed more logical to me? cfr. date days DATE+, now date years YEARS+)
> 68.0 CCCAh
> In : date n
> Out: date + n years
> \<<
> 6. ALOG / SWAP
> DUPDUP -2. ALOG MOD 3.03 + DDAYS 3. SAME
> UNROT PICK3 NEG DATE+ + SWAP DATE+
> \>>
>
> It works for negative input years as well.
> I can get it one byte shorter using 303 MANT io 3.03 ... oh well.
>
> Cheers, Werner

second try:
@ 50.0 bytes
@ 1786h
\<<
6. ALOG / SWAP
DUP MANT IP 2. SAME


UNROT PICK3 NEG DATE+ + SWAP DATE+
\>>

The idea is that I don't have to test for Feb 29th specifically.
date - 1 day + n years + 1 day will work for all days, except Mar 1.
The test above will produce a 0. for Mar 1 and a 1. for Feb 20th till 29th,
whatever the date format is.

Cheers,
Werner

Wolfgang Rautenberg

unread,
Jun 19, 2003, 1:43:27 PM6/19/03
to
Werner Huysegoms wrote:
> second try:
> @ 50.0 bytes
> @ 1786h
> \<<
> 6. ALOG / SWAP
> DUP MANT IP 2. SAME
> UNROT PICK3 NEG DATE+ + SWAP DATE+
> \>>

Hi Werner, your smart program translated into SysRPL would probably look
as follows:

:: %6 %ALOG %/ SWAPDUP %MANTISSA %IP %2
'EvalNoCK:_sup (the strange name for PTR 25F29 in CD&TR's extable)
xSAME
DUP4UNROLL %CHS DATE+DAYS %+ SWAP DATE+DAYS
;

Do you know the reason why it doesn't work if 'EvalNoCk_sup xSAME is
replaced by the more natural %= COERCEFLAG ???

Regards Wolfgang

Heiko Arnemann

unread,
Jun 19, 2003, 4:52:32 PM6/19/03
to
> CHALLENGE. Write a shortest program in (a) UsrRPL program (b) SysRPL
> whose input is a whole number n in Level2 and a DATE real in Level1,
and
> whose output is the correct date n years later as explained above.
>
> CONDITIONS: The program should be independent on the date flag -42.
Only
> supported pointers and named rompointers are allowed. The input DATE
can
> be any real accepted by ->DATE. The output must be correct as long as
<<
> DATE n 365. * DATE+ >> does not error. Argument checking is not
> required. The number in Level2 is a positive real with fractional part
> 0. TIME is not considered in the challenge


Hi Wolfgang,
I did not understand the requiremet:


"as long as
<< DATE n 365. * DATE+ >> does not error"

Would you please expain, the needs.

Here is my 57,5 Byte-b-version-contribution:
::
%0 @ to make sure, that e.g. 28.02 or 2.28 is
accepted
DATE+DAYS @ in the right way
SWAP
%6
%ALOG
%/
2DUP
%+
%0
ERRSET
::
DATE+DAYS
ROTROT2DROP
;
ERRTRAP
::
SWAP
%1
DATE+DAYS
%+
;
;
@

Wolfgang Rautenberg

unread,
Jun 20, 2003, 6:31:05 AM6/20/03
to
Heiko Arnemann wrote:
> ... the input DATE can

> > be any real accepted by ->DATE. The output must be correct as long as
> <<
> > DATE n 365. * DATE+ >> does not error.

> Hi Wolfgang,


> I did not understand the requiremet:
> "as long as
> << DATE n 365. * DATE+ >> does not error"
> Would you please expain, the needs.

Heiko, it is obvious that if you try to compute DATE plus 1 Million
years then the builtin date command will error. I simplified things in
not demanding from you this kind of error trapping.

IMHO it will be hard to beat Werner with his ingenious UsrRpl-program
for solving the problem. Werner did more as expected in 2 directions:
the program is correct also for negative year addings, and it returns to
a 29th of a february if it exist.

- Wolfgang

BlackLotus

unread,
Jun 20, 2003, 1:25:09 PM6/20/03
to

"Wolfgang Rautenberg" <ra...@math.fu-berlin.de> a écrit dans le message de
news:3EF1F63F...@math.fu-berlin.de...

I tried something as simple as :: TRUE CORECEFLAG %1 %1 %+ ;
and it inputs 1 instead of 1 1, so I assume that entry also exits out of the
program.

On a side note,
::


%6 %ALOG %/ SWAPDUP %MANTISSA %IP %2

xSAME
DUP4UNROLL %CHS DATE+DAYS %+ SWAP DATE+DAYS
;

works fine on a hp48, and I don't see what 'EvalNoCK:_sup is doing here.

>
> Regards Wolfgang


Wolfgang Rautenberg

unread,
Jun 20, 2003, 2:45:29 PM6/20/03
to
BlackLotus wrote:
> > Do you know the reason why it doesn't work if 'EvalNoCk_sup xSAME is
> > replaced by the more natural %= COERCEFLAG ???
>
> I tried something as simple as :: TRUE CORECEFLAG %1 %1 %+ ;
> and it inputs 1 instead of 1 1, so I assume that entry also exits out of the program.

Yes, but this seems to depend on the status of the Return stack.

> On a side note,
> ::
> %6 %ALOG %/ SWAPDUP %MANTISSA %IP %2
> xSAME
> DUP4UNROLL %CHS DATE+DAYS %+ SWAP DATE+DAYS
> ;
> works fine on a hp48, and I don't see what 'EvalNoCK:_sup is doing here.

The problem is that if an error occurs after xSAME (by DATE+DAYS, say)
you would get the misleading error message
"SAME error
blabla"
That is a main reason why UsrRPL commands should be avoided inside
SysRPL, or be forced to "forget their names" by EvalNoCK. Anyway,
'EvalNoCk:_sup is unsupported. Hence, my program is inadmissable for the
challenge. Here my work-around for Werner's idea in SysRPL:

:: %-6 %ALOG %* SWAPDUP %MANTISSA %CEIL %2 %MOD


DUP4UNROLL %CHS DATE+DAYS %+ SWAP DATE+DAYS
;

That is faster than Werners wonderful program, and only 40 bytes :-)
It is the program-part for the year-browser keys of the virtual
date-browser in the latest edition of Timeman, see
ftp://ftp.math.fu-berlin.de/pub/usr/raut/HP49/time/Timeman/Timeman.htm

Regards Wolfgang

Werner Huysegoms

unread,
Jun 20, 2003, 5:01:19 PM6/20/03
to
Wolfgang Rautenberg <ra...@math.fu-berlin.de> wrote in message news:<3EF1F63F...@math.fu-berlin.de>...

Hi, Wolfgang!
I looked at the code and could still read ASM well enough to see that
COERCEFLAG does not return to the RPL LOOP as every well-behaved object
ought to, but instead passes control to SEMI (;).
So, writing
%MANTISSA %IP %2 %= :: COERCEFLAG ;
will work. Or
... %= ITE %1 %0
which will probably make you cringe less.
A solution that does not waste bytes:
%MANTISSA %CEIL %2 %MOD
er it's even 2.5 bytes less! - SysRPL version only

Moreover, I have rewritten the UserRPL program to be 48/49 compatible:

third try:
@ 50.0 bytes
@ 1CA6h (49)
\<<
6. ALOG /
OVER MANT IP 2. SAME
ROT OVER NEG DATE+ ROT + SWAP DATE+
\>>

And the SysRPL version would be something like:
40 bytes, 47E7h (49)
::
%6 %ALOG %/
SWAPDUP %MANTISSA %CEIL %2 %MOD


DUP4UNROLL %CHS DATE+DAYS %+ SWAP DATE+DAYS
;

Best Regards,
Werner

John H Meyers

unread,
Jun 20, 2003, 5:39:02 PM6/20/03
to
Yes, COERCEFLAG acts as if it should have been called COLACOERCEFLAG :)
[because it's often the terminal action of various user commands
which return True/False results in the form of 1/0]

[r->] [OFF]

.


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----

Jonathan Busby

unread,
Jun 21, 2003, 7:56:19 PM6/21/03
to

Assuming my interpretation of the above requirements is correct, then
here are two solutions that should work. Each accepts a positive or
negative year argument in level 2 and a date argument in level 1.

User-rpl
Bytes : 48
Checksum : # 1A3h (48)

<< 1.012 DUP ROT
DDAYS SWAP ROT 6
ALOG / + SWAP DATE+ >>


System-rpl
Bytes : 35.5
Checksum : # 7595h (48)

::
% 1.012 DUPROT DDAYS SWAPROT
%6 %ALOG %/ %+SWAP DATE+DAYS
;


Jonathan

Jonathan Busby

unread,
Jun 21, 2003, 8:04:48 PM6/21/03
to
On Sat, 21 Jun 2003 18:56:19 -0500, Jonathan Busby
<temp...@thisIsInvalid.net> wrote:


>Assuming my interpretation of the above requirements is correct, then
>here are two solutions that should work. Each accepts a positive or
>negative year argument in level 2 and a date argument in level 1.
>
>User-rpl
>Bytes : 48
>Checksum : # 1A3h (48)
>
><< 1.012 DUP ROT
> DDAYS SWAP ROT 6
> ALOG / + SWAP DATE+ >>
>
>
>System-rpl
>Bytes : 35.5
>Checksum : # 7595h (48)
>
>::
> % 1.012 DUPROT DDAYS SWAPROT
> %6 %ALOG %/ %+SWAP DATE+DAYS
>;

Crap. Posted too soon. Dates other than february 29 are off by 1.

Nth note to self: think before posting....

Jonathan


Veli-Pekka Nousiainen

unread,
Jun 21, 2003, 9:46:18 PM6/21/03
to
"Jonathan Busby" <temp...@thisIsInvalid.net> wrote in message
news:8hs9fv8qnhrjkpegn...@4ax.com...
X

> Crap. Posted too soon. Dates other than february 29 are off by 1.
> Nth note to self: think before posting....
> Jonathan
The dangerous VPN virus is spreading...
VPN ~ Virus: Post Now!


Jonathan Busby

unread,
Jun 23, 2003, 2:00:31 AM6/23/03
to
On Sat, 21 Jun 2003 19:04:48 -0500, Jonathan Busby
<temp...@thisIsInvalid.net> wrote:

>On Sat, 21 Jun 2003 18:56:19 -0500, Jonathan Busby
><temp...@thisIsInvalid.net> wrote:
>
>
>>Assuming my interpretation of the above requirements is correct, then
>>here are two solutions that should work. Each accepts a positive or
>>negative year argument in level 2 and a date argument in level 1.

Here's a "conventional" sys-rpl solution. Still falls 5 bytes short of
Werner's though. ( just 2 commands ;)

::
SWAP %6 %ALOG %/ SWAP2DUP %+
DUP
ERRSET
DDAYS
ERRTRAP
%-1
DUP4UNROLL DATE+DAYS %+SWAP
%CHS DATE+DAYS
;


Jonathan


Wolfgang Rautenberg

unread,
Jun 26, 2003, 7:09:37 AM6/26/03
to
Jonathan Busby wrote:
> Here's a "conventional" sys-rpl solution. Still falls 5 bytes short of
> Werner's though. ( just 2 commands ;)

Thanks to all participants. The winner of this challenge in both
sections, UsrRPL and SysRPL, is Werner Huysegoms with his programs

\<< 6. ALOG / OVER MANT IP 2. SAME ROT OVER

NEG DATE+ ROT + SWAP DATE+ \>> (50 bytes)

:: %6 %ALOG %/ SWAPDUP %MANTISSA %CEIL %2 %MOD
DUP4UNROLL %CHS DATE+DAYS %+ SWAP DATE+DAYS ; (40 bytes)

The small UsrRPL program belongs to the best ones I have ever seen.
The "Ceil"-trick in the second program was proposed by Werner and myself
independently.

It can be replaced by the unsupported but stable HP49-PTR 3CCB4 which is
the already mentioned :: EQUAL COERCEFLAG ; This pointer is very useful
and should be included in TR's extable2. Any good name for it?

- Wolfgang

Wolfgang Rautenberg

unread,
Jun 27, 2003, 2:22:24 AM6/27/03
to
Carsten Dominik wrote:
> WR> It can be replaced by the unsupported but stable HP49-PTR 3CCB4 which is
> WR> the already mentioned :: EQUAL COERCEFLAG ; This pointer is very useful
> WR> and should be included in TR's extable2. Any good name for it?

> SAME, obviously.

I just used TR's Extable Tools library to add the pointer "SAME" but
forgot to write "SAME_" as it should perhaps be. I thought that would be
done by ->ETAB automatically :-)

Some remarks to Extable Tools (for the HP49, not for a PC!).
1. It should perhaps do the necessary temporary UNDO_OFF by itself, by
just warning at the very end that Last Stack may be disabled.
2. It should not check for the name extable but for a name beginning
with extable. In this way extable could be given another name,
extable2, say.
3. The command ->ETAB should accept a 3rd argument, the name the user
wants to give his own updated extable, to distinguish it from the
various public versions.
4. In tabtool.txt should not be written "Make a short one-line string"
if in reality this has to be a 2-line string, with a single blank
in the second line.

- Wolfgang

Wolfgang Rautenberg

unread,
Jun 27, 2003, 2:37:25 AM6/27/03
to
Carsten Dominik wrote:
> WR> It can be replaced by the unsupported but stable HP49-PTR 3CCB4 which is
> WR> the already mentioned :: EQUAL COERCEFLAG ; This pointer is very useful
> WR> and should be included in TR's extable2. Any good name for it?

> SAME, obviously.

I just used TR's Extable Tools library to add the pointer "SAME" but
forgot to write "SAME_" as it should perhaps be. I thought that would be
done by ->ETAB automatically :-)

Some remarks to Extable Tools (for the HP49, not for a PC!).
1. It should perhaps do the necessary temporary UNDO_OFF by itself, by
just warning at the very end that Last Stack may be disabled.
2. It should not check for the name extable but for a name beginning
with extable. In this way extable could be given another name,
extable2, say.
3. The command ->ETAB should accept a 3rd argument, the name the user
wants to give his own updated extable, to distinguish it from the

various public versions. Better if ETAB-> would not check for the
name at all.
4. In tabtool.txt "Make a short one-line string" should be completed
by "with a newline-character at the very end, e.g. as follows:"

- Wolfgang

Wolfgang Rautenberg

unread,
Jun 27, 2003, 2:49:10 AM6/27/03
to
Carsten Dominik wrote:
> WR> It can be replaced by the unsupported but stable HP49-PTR 3CCB4 which is
> WR> the already mentioned :: EQUAL COERCEFLAG ; This pointer is very useful
> WR> and should be included in TR's extable2. Any good name for it?

> SAME, obviously.

I just used TR's Extable Tools library to add the pointer "SAME" but
forgot to write "SAME_" as it should perhaps be. I thought that would be
done by ->ETAB automatically :-)

Some remarks to Extable Tools (for the HP49, not for a PC!).
1. It should perhaps do the necessary temporary UNDO_OFF by itself, by
just warning at the very end that Last Stack may be disabled.
2. It should not check for the name extable but for a name beginning

with extable. IMHO it would suffice if it checks for LibID 258. In this


way extable could be given another name, extable2, say.

3. The command ->ETAB should accept a 2nd argument, the name the user
wants to give his individually updated extable, to distinguish it from
the various public versions.

Jonathan Busby

unread,
Jun 27, 2003, 3:04:58 AM6/27/03
to

A small optimization brings the sys-rpl version down to 37.5 bytes :

:: %6 %ALOG %/ SWAPDUP %MANTISSA %CEIL %2 %MOD
DUP4UNROLL %CHS DATE+DAYS %+SWAP DATE+DAYS ;

Heh, I just realized that the second line is almost identical to the
end of my (working) sys-rpl solution (which was developed
independently). I guess that's what happens when there's really only
one optimum way to do it. :)

Jonathan


Jonathan Busby

unread,
Jun 27, 2003, 3:05:13 AM6/27/03
to
On Mon, 23 Jun 2003 01:00:31 -0500, Jonathan Busby
<temp...@thisIsInvalid.net> wrote:


>Here's a "conventional" sys-rpl solution. Still falls 5 bytes short of
>Werner's though. ( just 2 commands ;)

Actually, if you remove the initial SWAP ( arguments reversed ), it's
only 2.5 bytes. (if anyone cares)


Jonathan


Carsten Dominik

unread,
Jun 27, 2003, 3:58:15 AM6/27/03
to
>>>>> "WR" == Wolfgang Rautenberg <ra...@math.fu-berlin.de> writes:

WR> I just used TR's Extable Tools library to add the pointer "SAME" but
WR> forgot to write "SAME_" as it should perhaps be. I thought that would be
WR> done by ->ETAB automatically :-)

No, it is not the extable tools which are doing this, because they
cannot know which entries are stable and which not. Appending "_"
happens when I export from the database, because the DB knows which
entries are supported and which not. In the database, entries are
called "SAME" - only for extable do we add the "_". So indeed, you
should have added the "_" yourself.

WR> 4. In tabtool.txt "Make a short one-line string" should be completed
WR> by "with a newline-character at the very end, e.g. as follows:"


Thomas, I think also the "*" as a replacement for the space separator
is currently undocumented.

- Carsten

Wolfgang Rautenberg

unread,
Jun 27, 2003, 4:52:59 AM6/27/03
to
Jonathan Busby wrote:
> >Thanks to all participants. The winner of this challenge in both
> >sections, UsrRPL and SysRPL, is Werner Huysegoms ...

> A small optimization brings the sys-rpl version down to 37.5 bytes :
>
> :: %6 %ALOG %/ SWAPDUP %MANTISSA %CEIL %2 %MOD
> DUP4UNROLL %CHS DATE+DAYS %+SWAP DATE+DAYS ;

Hi, I'm so pleased with your saving of another 2.5 bytes that I put you
postumum equi loco on place 1 for SysRPL, together with Werner. It's the
first time I saw this %+SWAP in a SysRPL program :-)

- Wolfgang

PS - ADDITIONAL REMARK. I repeat that Werner's UsrRPL program is the
most beautyful one I've ever seen. I'm sad that this minichallenge which
(in contrast to similar ones) has some obvious application in practice,
didn't find much resonance by people in this NG who program in UsrRPL.
It turns out that the so-called gurus which normally don't care much on
UsrRPL are still winning nearly all UsrRPL-competitions. Why is this
so?

Raymond Del Tondo

unread,
Jun 27, 2003, 5:24:53 AM6/27/03
to
Hi,

> [..]


> It's the first time I saw this
> %+SWAP in a SysRPL program :-)
>

The entry itself is not new.
It's even in the HP-48SX....

Raymond


Wolfgang Rautenberg

unread,
Jun 27, 2003, 6:04:29 AM6/27/03
to
Raymond Del Tondo wrote:
> > It's the first time I saw this
> > %+SWAP in a SysRPL program :-)

> The entry itself is not new.

I know, it's well-document. But I never met a place in the HP48-ROM
where it is used. Do you have such an example (from the ROM)?

- Wolfgang

Raymond Del Tondo

unread,
Jun 27, 2003, 6:27:10 AM6/27/03
to
Hi Wolfgang,

"Wolfgang Rautenberg" <ra...@math.fu-berlin.de> schrieb im Newsbeitrag
news:3EFC16AD...@math.fu-berlin.de...

Yes, of course.

Here are locations where %+SWAP is used:

C%R+C
C%C+C
DOARC# (which is called by xARC)

Ok, it's not many, but however;-)

Raymond


Bruce Horrocks

unread,
Jun 27, 2003, 2:06:48 PM6/27/03
to
In message <3EFC05EB...@math.fu-berlin.de>, Wolfgang Rautenberg
<ra...@math.fu-berlin.de> writes

>It turns out that the so-called gurus which normally don't care much on
>UsrRPL are still winning nearly all UsrRPL-competitions. Why is this
>so?

Two reasons:
a) It probably helps to know userRPL really well before learning sysRPL
b) Those who have time to learn sysRPL also have time to enter the
mini-challenges. ;-)

Regards,
--
Bruce Horrocks
Surrey
England
<firstname>@<surname>.plus.com -- fix the obvious for email

0 new messages