Fractran: Difference between revisions

Content added Content deleted
m (→‎showing prime numbers: simplified the program.)
m (→‎showing all terms: simplified the program.)
Line 3,435: Line 3,435:
say right('term' j, 35) "──► " N /*display the Nth term with the N. */
say right('term' j, 35) "──► " N /*display the Nth term with the N. */
N= N % d.k * n.k /*calculate next term (use %≡integer ÷)*/
N= N % d.k * n.k /*calculate next term (use %≡integer ÷)*/
iterate j /*go start calculating the next term. */
leave /*go start calculating the next term. */
end /*k*/ /* [↑] if an integer, we found a new N*/
end /*k*/ /* [↑] if an integer, we found a new N*/
end /*j*/ /*stick a fork in it, we're all done. */</lang>
end /*j*/ /*stick a fork in it, we're all done. */</lang>