Re: Euler Project Problems.

"Ray St. Marie" <[email protected]> Tue, 20 May 2008 00:15:19 -0600
Newsgroups gmane.comp.lang.forth.colorforth
Message-ID <[email protected]>
On Mon, May 19, 2008 at 11:59 PM, Ray St. Marie <[email protected]> wrote:
> Dear Albert,

> : READ.DECIMAL.NUMBER           \ ( --- >> "number.string" )
>     1 TO PRECISION             \ Reset precision
>     BL WORD                    \ get from input
>     COUNT                      \ String.address length
>     DUP 0= ABORT" Please input a number"
>     DUP length !               \ Remember!
>     0 DO                       \  Convert each digit

****************************************************************

I see from the Dutch version that C@+ is defined as COUNT

: C@+ ( addres -- addres+1 byte ) COUNT ;


>          C@ dup . \ C@+ is this a typing error? RAS 080519
>          ASCII->BINARY
>          I num digit!          \  to binary in number.
>     LOOP DROP                  \  Drop string address.
>     10 current.base digit!     \ Start with decimal
>     0 current.base CELL+ !     \ Guard decimal for the overflow
> ;

I keep refering to the Dutch document, trying what you have there in
the ANS file. I have to ask, was either of these programs ever tested
in an ANS environment? I realize your answer is yes, but I'm
frustrated and can't seem to get it to do what you say it does.

Ray


-- 
Raymond St. Marie ii,
colorforthray.info