RosettaCodeData/Task/Jensens-Device/Forth/jensens-device-2.fth
2014-04-02 16:56:35 +00:00

6 lines
207 B
Forth

fvariable ii \ i is a Forth word that we need
: sum ( xt1 lo hi xt2 -- r )
0e swap 1+ rot ?do ( addr xt r1 )
i s>f over execute f! dup execute f+
loop 2drop ;
' ii 1 100 :noname 1e ii f@ f/ ; sum f.