Anonymous user
Talk:Hofstadter Figure-Figure sequences: Difference between revisions
Talk:Hofstadter Figure-Figure sequences (view source)
Revision as of 21:34, 3 March 2019
, 5 years ago→timings for the REXX solutions: changed verb tense.
(→timings for the REXX solutions: added/changed whitespace and comments, change a variable's name.) |
m (→timings for the REXX solutions: changed verb tense.) |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 32:
==timings for the REXX solutions==
I normally don't
I decided to go back and include the timings here as the REXX 2<sup>nd</sup> example's timings seemed a bit high.
<br>I didn't expect a difference of
<lang rexx>/*REXX program calculates and verifies the Hofstadter Figure─Figure sequences. */
call time 'Reset████████████████████████████████████████████████████████████████████████████████'
parse arg x top bot . /*obtain optional arguments from the CL*/
if x=='' | x==
if top=='' | top==
if bot=='' | bot==
low=1; if x<0 then low=abs(x) /*only display a single │X│ value? */
r.=0; r.1=1; rr.=r.; rr.1=1; s.=r.; s.1=2 /*initialize the R, RR, and S arrays.*/
end
if x<1 then exit /*if X isn't positive, then we're done.*/
$.=0
do m=1 for
end /*m*/ /* [↑] ($.) is used for memoization. */
do n=1 for top-bot;
if $.s then call
end /*n*/ /* [↑] calculate the 1st 960 S values.*/
do v=1 for top; if \$.v then call ser 'missing R │ S:' v
say
if errs==0 then say 'verification completed for all numbers from 1 ──►' top " [inclusive]."
else say 'verification failed with' errs "errors."
say 'and took' format(time('Elapsed█████████████████████████████████████████████████████████████████'),,2) "seconds."▼
exit /*stick a fork in it, we're all done. */
▲say 'took' format(time('Elapsed█████████████████████████████████████████████████████████████████'),,2) "seconds."
/*──────────────────────────────────────────────────────────────────────────────────────*/
▲exit /*stick a fork in it, we're done.*/
r.n=_
/*──────────────────────────────────────────────────────────────────────────────────────*/
FFS: procedure expose r. s. rr.; parse arg n /*search for not null R or S number. */
if s.n==0 then do k=1 for n /* [↓] 1st IF is a SHORT CIRCUIT. */
▲ffs: procedure expose r. s. rr.; parse arg n /*search for ¬null R or S number.*/
if s.
end /*k*/
return s.n /*return S.n value to the invoker. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
ser: errs=errs+1; say '***error***
'''output''' when using the default inputs:
<pre>
Line 97 ⟶ 96:
verification completed for all numbers from 1 ──► 1000 [inclusive].
and took 0.22 seconds.
</pre>
The (above) example was run under Windows 7 on an air-gap
<br><br>
==Formulae hidden to most browsers by under-tested cosmetic edits at 18:19, 28 August 2016 ==
Under-tested cosmetic edits made to the task page at 18:19, 28 August 2016, including the injection of spaces around expressions in <math> tags, have left some or all of the task description formulae completely invisible to all browsers which display the graphic file version of formulae rather than processing the MathML (this is, in fact, the majority of browsers). The MediaWiki processor does not currently expect such spaces, and generates syntactically ill-formed HTML if they are introduced. Other aspects of these cosmetic edits may further compound the problem. [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 19:50, 22 September 2016 (UTC)
: Visibility of formulae now restored for mainstream browsers like Chrome, IE Edge, Safari, Opera etc [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 12:59, 21 November 2016 (UTC)
|