Talk:Hofstadter Figure-Figure sequences: Difference between revisions

m
→‎timings for the REXX solutions: changed IF statement to use short circuit. -- ~~~~
(→‎timings for the REXX solutions: added a new section. -- ~~~~)
m (→‎timings for the REXX solutions: changed IF statement to use short circuit. -- ~~~~)
Line 35:
I normally don't including timings for the REXX solutions that I post, but when I saw the 2<sup>nd</sup> REXX example's timings,
<br>I decided to go back and include the timings here as the 2<sup>nd</sup> example's timings seemed a bit high.
<br><br>I didn't expect a magnitude difference of magnitude.
<lang rexx>/*REXX pgm to calculate & verify the Hofstadter Figure-Figure sequences.*/
call time 'Reset'
Line 81:
ffs: procedure expose r. s. rr. ss.; parse arg n
do k=1 for n while s.n==0 /*search for not null R │ S num.*/
if s.k\==0 & then if ffr(k)\==0 then iterate /*short circuit*/
km=k-1; _=s.km+1 /*the next SS number, possibly.*/
_=_+rr._ /*maybe adjust for the FRR num.*/
Line 106:
took 1.58 seconds.
</pre>
The (above) example was run under Windows 7 on mya HP box (3.2GHz) using Regina.
<br><br>