Arnaud Amiel
2019-04-08 08:17:18 UTC
I used to be good at this but this was many years ago.
I have now dusted off my emulator and try to do the thing below.
It is not optimised in any way and doesn't work.
It looks like the NULLLAMs are not available inside the DO loop. There is something in the back of my mind that tells me "you should know why" but it has been a good 10? years.
Any pointers appreciated
Arnaud
!NO CODE
!RPL
::
DUPDUP
%%*
%%1
%%+
%%2
%%/
3UNROLL
%%1
%%+
%%2
%%/
%%1
%%1
4NULLLAM{}
BIND
DO
1GETLAM
4GETLAM
%%-
%%2
%%/
DUP
2GETLAM
%%*
%%*
%%-
1GETLAM
4GETLAM
%%*
%%SQRT
4PUTLAM
2GETLAM
%%2
%%*
2PUTLAM
3GETLAM
DUPDUP
1PUTLAM
4GETLAM
%%+
%%2
%%/
DUP
3PUTLAM
%%-
%%0=
UNTIL
1GETABND
%%/
;
@
I have now dusted off my emulator and try to do the thing below.
It is not optimised in any way and doesn't work.
It looks like the NULLLAMs are not available inside the DO loop. There is something in the back of my mind that tells me "you should know why" but it has been a good 10? years.
Any pointers appreciated
Arnaud
!NO CODE
!RPL
::
DUPDUP
%%*
%%1
%%+
%%2
%%/
3UNROLL
%%1
%%+
%%2
%%/
%%1
%%1
4NULLLAM{}
BIND
DO
1GETLAM
4GETLAM
%%-
%%2
%%/
DUP
2GETLAM
%%*
%%*
%%-
1GETLAM
4GETLAM
%%*
%%SQRT
4PUTLAM
2GETLAM
%%2
%%*
2PUTLAM
3GETLAM
DUPDUP
1PUTLAM
4GETLAM
%%+
%%2
%%/
DUP
3PUTLAM
%%-
%%0=
UNTIL
1GETABND
%%/
;
@